Exemplo n.º 1
0
  @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());
  }
Exemplo n.º 2
0
 private <N extends Node> N computeTokenAnnotation(N node) {
   node.setLineNumberAttribute(locationTracker.getLineNumber());
   node.setColumnNumberAttribute(locationTracker.getColumnNumber());
   return node;
 }