List of usage examples for org.antlr.v4.runtime.tree Trees descendants
public static List<ParseTree> descendants(ParseTree t)
From source file:de.se_rwth.langeditor.modelstates.Nodes.java
License:Open Source License
void addNodes(ParseTree parseTree) { getAstNode(parseTree).ifPresent(astNode -> astParentMaps.add(ASTNodes.childToParentMap(astNode))); for (ParseTree descendant : Trees.descendants(parseTree)) { getAstNode(descendant).ifPresent(astNode -> astToParseTree.put(astNode, descendant)); }/* w w w .ja v a 2 s .c om*/ }