Package schrodinger :: Package application :: Package desmond :: Package antlr3 :: Module tree :: Class RewriteRuleNodeStream
[hide private]
[frames] | no frames]

Class RewriteRuleNodeStream

              object --+    
                       |    
RewriteRuleElementStream --+
                           |
                          RewriteRuleNodeStream

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

Instance Methods [hide private]
 
nextNode(self)
 
toTree(self, el)
Ensure stream emits trees; tokens must be converted to AST nodes.
 
dup(self, el)
When constructing trees, sometimes we need to dup a token or AST subtree.

Inherited from RewriteRuleElementStream: __init__, __len__, add, getDescription, hasNext, nextTree, reset, size

Inherited from RewriteRuleElementStream (private): _next

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

toTree(self, el)

 

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

Overrides: RewriteRuleElementStream.toTree
(inherited documentation)

dup(self, el)

 

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.

Overrides: RewriteRuleElementStream.dup
(inherited documentation)