Beispiel #1
0
 private static <L> void appendPreTerminalYield(Tree<L> tree, List<L> yield) {
   if (tree.isPreTerminal()) {
     yield.add(tree.getLabel());
     return;
   }
   for (Tree<L> child : tree.getChildren()) {
     appendPreTerminalYield(child, yield);
   }
 }
Beispiel #2
0
 public List<L> getPreTerminalYield() {
   List<L> yield = new ArrayList<L>();
   appendPreTerminalYield(this, yield);
   return yield;
 }