Package org.antlr.runtime.tree
Class RewriteRuleNodeStream
java.lang.Object
org.antlr.runtime.tree.RewriteRuleElementStream
org.antlr.runtime.tree.RewriteRuleNodeStream
Queues up nodes matched on left side of -> in a tree parser. This is
the analog of RewriteRuleTokenStream for normal parsers.
-
Field Summary
Fields inherited from class org.antlr.runtime.tree.RewriteRuleElementStream
adaptor, cursor, dirty, elementDescription, elements, singleElement
-
Constructor Summary
ConstructorsConstructorDescriptionRewriteRuleNodeStream
(TreeAdaptor adaptor, String elementDescription) RewriteRuleNodeStream
(TreeAdaptor adaptor, String elementDescription, Object oneElement) Create a stream with one elementRewriteRuleNodeStream
(TreeAdaptor adaptor, String elementDescription, List elements) Create a stream, but feed off an existing list -
Method Summary
Methods inherited from class org.antlr.runtime.tree.RewriteRuleElementStream
_next, add, getDescription, hasNext, nextTree, reset, size
-
Constructor Details
-
RewriteRuleNodeStream
-
RewriteRuleNodeStream
Create a stream with one element -
RewriteRuleNodeStream
Create a stream, but feed off an existing list
-
-
Method Details
-
nextNode
-
toTree
Description copied from class:RewriteRuleElementStream
Ensure stream emits trees; tokens must be converted to AST nodes. AST nodes can be passed through unmolested.- Overrides:
toTree
in classRewriteRuleElementStream
-
dup
Description copied from class:RewriteRuleElementStream
When constructing trees, sometimes we need to dup a token or AST subtree. Dup'ing a token means just creating another AST node around it. For trees, you must call the adaptor.dupTree() unless the element is for a tree root; then it must be a node dup.- Specified by:
dup
in classRewriteRuleElementStream
-