Package org.antlr.v4.runtime.tree
Class IterativeParseTreeWalker
- java.lang.Object
-
- org.antlr.v4.runtime.tree.ParseTreeWalker
-
- org.antlr.v4.runtime.tree.IterativeParseTreeWalker
-
public class IterativeParseTreeWalker extends ParseTreeWalker
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 Constructor Description IterativeParseTreeWalker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
-
-
-
-
Method Detail
-
walk
public void walk(ParseTreeListener listener, ParseTree t)
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
-
-