Top Fields Constructors Methods
org.antlr.v4.runtime.tree

public Class ParseTreeWalker

extends Object
Class Inheritance
Known Direct Subclasses
org.antlr.v4.runtime.tree.IterativeParseTreeWalker
Imports
org.antlr.v4.runtime.ParserRuleContext

Field Summary

Modifier and TypeField and Description
public static final ParseTreeWalker

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
enterRule(ParseTreeListener
The listener responding to the trigger events
listener
,
RuleNode
The grammar rule containing the rule context
r
)

Enters a grammar rule by first triggering the generic event ParseTreeListener#enterEveryRule then by triggering the event specific to the given parse tree node

protected void
exitRule(ParseTreeListener
The listener responding to the trigger events
listener
,
RuleNode
The grammar rule containing the rule context
r
)

Exits a grammar rule by first triggering the event specific to the given parse tree node then by triggering the generic event ParseTreeListener#exitEveryRule

public void
walk(ParseTreeListener
The listener used by the walker to process grammar rules
listener
,
ParseTree
The parse tree to be walked on
t
)

Performs a walk on the given parse tree starting at the root and going down recursively with depth-first search.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULTback to summary
public static final ParseTreeWalker DEFAULT

Constructor Detail

ParseTreeWalkerback to summary
public ParseTreeWalker()

Method Detail

enterRuleback to summary
protected void enterRule(ParseTreeListener listener, RuleNode r)

Enters a grammar rule by first triggering the generic event ParseTreeListener#enterEveryRule then by triggering the event specific to the given parse tree node

Parameters
listener:ParseTreeListener

The listener responding to the trigger events

r:RuleNode

The grammar rule containing the rule context

exitRuleback to summary
protected void exitRule(ParseTreeListener listener, RuleNode r)

Exits a grammar rule by first triggering the event specific to the given parse tree node then by triggering the generic event ParseTreeListener#exitEveryRule

Parameters
listener:ParseTreeListener

The listener responding to the trigger events

r:RuleNode

The grammar rule containing the rule context

walkback to summary
public 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. On each node, ParseTreeWalker#enterRule is called before recursively walking down into child nodes, then ParseTreeWalker#exitRule is called after the recursive call to wind up.

Parameters
listener:ParseTreeListener

The listener used by the walker to process grammar rules

t:ParseTree

The parse tree to be walked on