@Override protected void computeAnnotation(Node node) { List<Node> nodeList = node.nodeList(); if (!nodeList.isEmpty()) { int nodeListSize = nodeList.size(); for (int i = 0; i < nodeListSize; i++) { Node firstNode = nodeList.get(i); if (firstNode == null) { continue; } node.setLineNumberAttribute(firstNode.getLineNumberAttribute()); node.setColumnNumberAttribute(firstNode.getColumnNumberAttribute()); return; } } node.setLineNumberAttribute(locationTracker.getLineNumber()); node.setColumnNumberAttribute(locationTracker.getColumnNumber()); }
private <N extends Node> N computeTokenAnnotation(N node) { node.setLineNumberAttribute(locationTracker.getLineNumber()); node.setColumnNumberAttribute(locationTracker.getColumnNumber()); return node; }