Home | Trees | Indices | Help |
|
---|
|
object --+ | Node
Abstract class for any node in the term tree.
In its original form a position (pos
) is a tuple
of non-negative integers comprising a path from a node in the term tree.
It identifies a node in the tree. After the FAC has been constructed,
only positions that are leaf nodes in the term tree remain, and the
corresponding symbol value (Python instance) is used as the position.
An update instruction (psi
) is a map from
positions to either Node.RESET or Node.INCREMENT. It identifies actions to be taken on
the counter states corresponding to the positions in its domain.
A transition is a pair containing a position and an update instruction. It identifies a potential next node in the state and the updates that are to be performed if the transition is taken.
A follow value is a map from a position to a set of transitions that may originate from the pos. This set is represented as a Python list since update instructions are dicts and cannot be hashed.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
|
|||
|
|||
|
|
|||
_Precedence = None An integral value used for parenthesizing expressions. |
|||
RESET = False An arbitrary value representing reset of a counter. |
|||
INCREMENT = True An arbitrary value representing increment of a counter. |
|||
__metadata = None
|
|||
__first = None
|
|||
__last = None
|
|||
__nullable = None
|
|||
__follow = None
|
|||
__posNodeMap = None
|
|||
__nodePosMap = None
|
|||
__counterPositions = None
|
|
|||
metadata Application-specific metadata provided during construction. |
|||
first The first set for the node. |
|||
last The last set for the node. |
|||
nullableTrue iff the empty string is accepted by this node.
|
|||
follow The follow map for the node. |
|||
posNodeMap A map from positions to nodes in the term tree. |
|||
nodePosMap A map from nodes to their position in the term tree. |
|||
counterPositions Implement definition 13.1 from HOV09. |
|
Create a FAC term-tree node.
|
Create a deep copy of the node. All term-tree--related attributes and properties are replaced with deep clones. Other attributes are preserved.
Note:
Subclasses should pre-extend this method to augment the
|
The first set for the node. This is the set of positions leading to symbols that can appear first in a string matched by an execution starting at the node. |
Abstract method that defines first for the subclass. The return value should be an iterable of tuples of integers denoting paths from this node through the term tree to a symbol. |
The last set for the node. This is the set of positions leading to symbols that can appear last in a string matched by an execution starting at the node. |
Abstract method that defines last for the subclass. The return value should be an iterable of tuples of integers denoting paths from this node through the term tree to a symbol. |
Abstract method that defines nullable for the subclass. The return value should be |
Abstract method that defines follow for the subclass. The return value should be a map from tuples of integers (positions) to a list of transitions, where a transition is a position and an update instruction. |
Reset any term-tree state associated with the node. Any change to the structure of the term tree in which the node appears invalidates memoized first/follow sets and related information. This method clears all that data so it can be recalculated. It does not clear the metadata link, or any existing structural data. |
Utility function for term tree processing.
|
Implement definition 13.1 from HOV09. The return value is the set of all positions leading to NumericalConstraint nodes for which either the minimum value is not 1 or the maximum value is not unbounded. |
Implement definition 13.2 from HOV09. This is the subset of counterPositions that occur along the path to
|
Obtain a description of the FAC in text format. This is a diagnostic tool, returning first, last, and follow maps using positions. |
|
_PrecedenceAn integral value used for parenthesizing expressions. A subterm that has a precedence less than that of its containing term must be enclosed in parentheses when forming a text expression representing the containing term.
|
|
metadataApplication-specific metadata provided during construction.
|
firstThe first set for the node. This is the set of positions leading to symbols that can appear first in a string matched by an execution starting at the node.
|
lastThe last set for the node. This is the set of positions leading to symbols that can appear last in a string matched by an execution starting at the node.
|
nullable
|
followThe follow map for the node.
|
posNodeMapA map from positions to nodes in the term tree.
|
nodePosMapA map from nodes to their position in the term tree.
|
counterPositionsImplement definition 13.1 from HOV09. The return value is the set of all positions leading to NumericalConstraint nodes for which either the minimum value is not 1 or the maximum value is not unbounded.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Sep 18 10:35:37 2013 | http://epydoc.sourceforge.net |