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

public Class RewriteRuleNodeStream

extends RewriteRuleElementStream
Class Inheritance
Imports
java.util.List

Queues up nodes matched on left side of -> in a tree parser. This is the analog of RewriteRuleTokenStream for normal parsers.

Field Summary

Inherited from org.antlr.runtime.tree.RewriteRuleElementStream:
adaptorcursordirtyelementDescriptionelementssingleElement

Constructor Summary

AccessConstructor and Description
public
RewriteRuleNodeStream(TreeAdaptor adaptor, String elementDescription)

public
RewriteRuleNodeStream(TreeAdaptor adaptor, String elementDescription, Object oneElement)

Create a stream with one element

public
RewriteRuleNodeStream(TreeAdaptor adaptor, String elementDescription, List<Object> elements)

Create a stream, but feed off an existing list

Method Summary

Modifier and TypeMethod and Description
protected Object
dup(Object el)

Implements abstract org.antlr.runtime.tree.RewriteRuleElementStream.dup.

When constructing trees, sometimes we need to dup a token or AST subtree.
public Object
protected Object
toTree(Object el)

Overrides org.antlr.runtime.tree.RewriteRuleElementStream.toTree.

Ensure stream emits trees; tokens must be converted to AST nodes.
Inherited from org.antlr.runtime.tree.RewriteRuleElementStream:
_nextaddgetDescriptionhasNextnextTreeresetsize

Constructor Detail

RewriteRuleNodeStreamback to summary
public RewriteRuleNodeStream(TreeAdaptor adaptor, String elementDescription)
RewriteRuleNodeStreamback to summary
public RewriteRuleNodeStream(TreeAdaptor adaptor, String elementDescription, Object oneElement)

Create a stream with one element

RewriteRuleNodeStreamback to summary
public RewriteRuleNodeStream(TreeAdaptor adaptor, String elementDescription, List<Object> elements)

Create a stream, but feed off an existing list

Method Detail

dupback to summary
protected Object dup(Object el)

Implements abstract org.antlr.runtime.tree.RewriteRuleElementStream.dup.

Doc from org.antlr.runtime.tree.RewriteRuleElementStream.dup.

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.

Annotations
@Override
nextNodeback to summary
public Object nextNode()
toTreeback to summary
protected Object toTree(Object el)

Overrides org.antlr.runtime.tree.RewriteRuleElementStream.toTree.

Doc from org.antlr.runtime.tree.RewriteRuleElementStream.toTree.

Ensure stream emits trees; tokens must be converted to AST nodes. AST nodes can be passed through unmolested.

Annotations
@Override