Example usage for org.antlr.v4.runtime.tree Trees descendants

List of usage examples for org.antlr.v4.runtime.tree Trees descendants

Introduction

In this page you can find the example usage for org.antlr.v4.runtime.tree Trees descendants.

Prototype

public static List<ParseTree> descendants(ParseTree t) 

Source Link

Usage

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*/
}