| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| public static List | |
| public static List | |
| public static Collection | |
| public static Collection | |
| public static Tree | |
| public static List | |
| public static List | |
| public static List | |
| public static String | |
| public static String | |
| public static ParserRuleContext | getRootOfSubtreeEnclosingRegion(ParseTree t, int startTokenIndex, int stopTokenIndex)
Find smallest subtree of t enclosing range startTokenIndex..stopTokenIndex inclusively using postorder traversal. |
| public static boolean | |
| public static void | stripChildrenOutOfRange(ParserRuleContext t, ParserRuleContext root, int startIndex, int stopIndex)
Replace any subtree siblings of root that are completely to left or right of lookahead range with a CommonToken(Token.INVALID_TYPE,"...") node. |
| public static String | |
| public static String | |
| public static String |
| Trees | back to summary |
|---|---|
| private Trees() | |
| _findAllNodes | back to summary |
|---|---|
| public static void _findAllNodes(ParseTree t, int index, boolean findTokens, List<? super ParseTree> nodes) | |
| descendants | back to summary |
|---|---|
| public static List Deprecated
| |
| findAllNodes | back to summary |
|---|---|
| public static List | |
| findAllRuleNodes | back to summary |
|---|---|
| public static Collection | |
| findAllTokenNodes | back to summary |
|---|---|
| public static Collection | |
| findNodeSuchThat | back to summary |
|---|---|
| public static Tree findNodeSuchThat(Tree t, Predicate<Tree> pred) Return first node satisfying the pred
| |
| getAncestors | back to summary |
|---|---|
| public static List Return a list of all ancestors of this node. The first node of list is the root and the last is the parent of this node.
| |
| getChildren | back to summary |
|---|---|
| public static List Return ordered list of all children of this node | |
| getDescendants | back to summary |
|---|---|
| public static List Get all descendents; includes t itself.
| |
| getNodeText | back to summary |
|---|---|
| public static String getNodeText(Tree t, Parser recog) | |
| getNodeText | back to summary |
|---|---|
| public static String getNodeText(Tree t, List<String> ruleNames) | |
| getRootOfSubtreeEnclosingRegion | back to summary |
|---|---|
| public static ParserRuleContext getRootOfSubtreeEnclosingRegion(ParseTree t, int startTokenIndex, int stopTokenIndex) Find smallest subtree of t enclosing range startTokenIndex..stopTokenIndex inclusively using postorder traversal. Recursive depth-first-search.
| |
| isAncestorOf | back to summary |
|---|---|
| public static boolean isAncestorOf(Tree t, Tree u) Return true if t is u's parent or a node on path to root from u. Use == not equals().
| |
| stripChildrenOutOfRange | back to summary |
|---|---|
| public static void stripChildrenOutOfRange(ParserRuleContext t, ParserRuleContext root, int startIndex, int stopIndex) Replace any subtree siblings of root that are completely to left or right of lookahead range with a CommonToken(Token.INVALID_TYPE,"...") node. The source interval for t is not altered to suit smaller range! Warning destructive to t.
| |
| toStringTree | back to summary |
|---|---|
| public static String toStringTree(Tree t) Print out a whole tree in LISP form. | |
| toStringTree | back to summary |
|---|---|
| public static String toStringTree(Tree t, Parser recog) Print out a whole tree in LISP form. | |
| toStringTree | back to summary |
|---|---|
| public static String toStringTree(final Tree t, final List<String> ruleNames) Print out a whole tree in LISP form. | |