Package org.antlr.v4.runtime.tree
Class IterativeParseTreeWalker
java.lang.Object
org.antlr.v4.runtime.tree.ParseTreeWalker
org.antlr.v4.runtime.tree.IterativeParseTreeWalker
An iterative (read: non-recursive) pre-order and post-order tree walker that
doesn't use the thread stack but heap-based stacks. Makes it possible to
process deeply nested parse trees.
-
Field Summary
Fields inherited from class org.antlr.v4.runtime.tree.ParseTreeWalker
DEFAULT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
walk
(ParseTreeListener listener, ParseTree t) Performs a walk on the given parse tree starting at the root and going down recursively with depth-first search.Methods inherited from class org.antlr.v4.runtime.tree.ParseTreeWalker
enterRule, exitRule
-
Constructor Details
-
IterativeParseTreeWalker
public IterativeParseTreeWalker()
-
-
Method Details
-
walk
Description copied from class:ParseTreeWalker
Performs a walk on the given parse tree starting at the root and going down recursively with depth-first search. On each node,ParseTreeWalker.enterRule(org.antlr.v4.runtime.tree.ParseTreeListener, org.antlr.v4.runtime.tree.RuleNode)
is called before recursively walking down into child nodes, thenParseTreeWalker.exitRule(org.antlr.v4.runtime.tree.ParseTreeListener, org.antlr.v4.runtime.tree.RuleNode)
is called after the recursive call to wind up.- Overrides:
walk
in classParseTreeWalker
- Parameters:
listener
- The listener used by the walker to process grammar rulest
- The parse tree to be walked on
-