Example #1
0
 public static void printSingleNode(HiddenTokenAwareTree tree) {
   String base = " " + tree.getType() + " " + tree.getText();
   if (printIndexes) {
     String optionalsuffix =
         " "
             + tree.getTokenStartIndex()
             + "-"
             + tree.getTokenStopIndex()
             + " "
             + (tree.getToken() == null ? "" : tree.getToken().getTokenIndex());
     base = base + optionalsuffix;
   }
   if (printComments) {
     String optionalsuffix =
         " PC:" + printComments(tree.getPreceding()) + " FC:" + printComments(tree.getFollowing());
     base = base + optionalsuffix;
   }
   System.out.println(base);
 }