Lines Matching refs:nodes
100 @brief Abstract baseclass for tree nodes.
343 """Is tree considered a nil node used to make lists of child nodes?"""
386 constructing these nodes so we should have this control for
415 How to identify nodes so we can say "add node to a prior node"?
492 all children? Each rule that creates AST nodes will call this
820 # if same number of nodes, do direct replace
977 If you specify your own kind of tree nodes, you will likely have to
1062 constructing these nodes so we should have this control for
1171 Tell me how to create a token for use with imaginary token nodes.
1322 are set. Walk depth first, visit bottom up. Only updates nodes
1483 To get your parser to build nodes of a different type, override
1485 dupNode is called to duplicate nodes during rewrite operations.
1509 Tell me how to create a token for use with imaginary token nodes.
1527 Only works with Tree nodes. For rules that match nothing,
1638 """@brief A stream of tree nodes
1640 It accessing nodes from a tree of some kind.
1649 If you don't want to buffer up nodes, then this method makes no
1659 i<0 indicates nodes in the past. So LT(-1) is previous node, but
1675 Where is this stream pulling nodes from? This is not the name, but
1695 What adaptor can tell me how to interpret/navigate nodes and
1704 As we flatten the tree, we use UP, DOWN nodes to represent
1705 the tree structure. When debugging we need unique nodes
1708 navigation nodes. Default should be false;
1725 Return the text of all nodes from start to stop, inclusive.
1726 If the stream does not buffer all the nodes then it can still
1753 """@brief A buffered stream of tree nodes.
1755 Nodes can be from a tree of ANY kind.
1757 This node stream sucks all nodes out of the tree specified in
1760 includes pointers to DOWN and UP and EOF nodes.
1779 nodes = None
1788 nodes = None
1801 nodes = parent.nodes[start:stop]
1809 # all these navigation nodes are shared and hence they
1827 # This buffer includes pointers to DOWN, UP, and EOF nodes.
1834 if nodes is not None:
1835 self.nodes = nodes
1837 self.nodes = []
1839 # Pull nodes from which tree?
1848 # Reuse same DOWN, UP navigation nodes unless this is true
1851 # The index into the nodes list of the current node (next node
1852 # to consume). If -1, nodes array not filled yet.
1867 """Walk tree with depth-first-search and fill nodes buffer.
1868 Don't do DOWN, UP nodes if its a list (t is isNil).
1872 self.p = 0 # buffer of nodes intialized now
1879 self.nodes.append(t) # add this node
1903 for i, t in enumerate(self.nodes):
1912 As we flatten the tree, we use UP, DOWN nodes to represent
1913 the tree structure. When debugging we need unique nodes
1933 self.nodes.append(navNode)
1940 return self.nodes[i]
1953 if self.p + k - 1 >= len(self.nodes):
1956 return self.nodes[self.p + k - 1]
1964 """Look backwards k nodes"""
1972 return self.nodes[self.p - k]
2082 return len(self.nodes)
2101 for node in self.nodes
2128 # else use token range from start/stop nodes
2137 # walk nodes looking for start
2139 for i, t in enumerate(self.nodes):
2145 t = self.nodes[i]
2153 t = self.nodes[i]
2170 for node in self.nodes:
2183 A parser for a stream of tree nodes. "tree grammars" result in a subclass
2235 Context means sequence of nodes towards root of tree. For example,
2238 parent is a CLASS node. You can use "..." to mean zero-or-more nodes.
2268 nodes = context.split()
2270 ni = len(nodes) - 1
2273 if nodes[ni] == "...":
2274 # walk upwards until we see nodes[ni-1] then continue walking
2278 goal = nodes[ni-1]
2286 if name != nodes[ni]:
2293 # at root but more nodes to match
2344 We have DOWN/UP nodes in the stream that have no line info; override.
2369 Tree parsers parse nodes they usually have a token object as
2449 Return a node stream from a doubly-linked tree whose nodes
2452 Emit navigation nodes (DOWN, UP, and EOF) to let show tree structure.
2465 # If we emit UP/DOWN nodes, we need to spit out multiple nodes per
2467 self.nodes = []
2469 # navigation nodes to return during walk and at end
2478 self.nodes = []
2489 if len(self.nodes) > 0:
2511 self.nodes.append(self.eof)
2517 if len(self.nodes) > 0:
2518 return self.nodes.pop(0)
2520 # no nodes left?
2528 self.nodes.append(self.tree)
2537 self.nodes.append(self.up)
2541 # no nodes left?
2544 self.nodes.append(self.eof) # add to queue, might have UP nodes in there
2545 return self.nodes.pop(0)
2551 self.nodes.append(self.tree) # add to queue, might have UP nodes in there
2552 return self.nodes.pop(0)
2709 Ensure stream emits trees; tokens must be converted to AST nodes.
2710 AST nodes can be passed through unmolested.
2747 # This way we can do hetero tree nodes in rewrite.
2787 # since this is for making root nodes).
2807 Queues up nodes matched on left side of -> in a tree parser. This is
2828 the start property is a tree nodes not Token object