| Home | Trees | Indices | Help |
|---|
|
|
|
|||
|
Rewriter base class for rewriters, supporting a fixed ordering. |
|||
|
Flatten A rewriter that flattens And and Or lists. |
|||
|
ComposeTransforms A rewriter that joins adjacent transformations into a single operation, avoiding trampolining in some cases. |
|||
|
TraceVariables A rewriter needed for TraceVariables which adds the trace_variables attribute to untransformable matchers that need a transform. |
|||
|
RightMemoize A rewriter that adds RMemo to all nodes in the matcher graph. |
|||
|
LeftMemoize A rewriter that adds LMemo to all nodes in the matcher graph. |
|||
|
AutoMemoize Apply two different memoizers, one to left recursive loops and the other elsewhere (either can be omitted). |
|||
|
OptimizeOr A rewriter that re-arranges Or matcher contents for left--recursive loops. |
|||
|
SetArguments Add/replace named arguments while cloning. |
|||
|
DirectEvaluation Replace given matchers if all Matcher arguments are subclasses of NoTrampolineWrapper |
|||
|
FullFirstMatch If the parser fails, raise an error at the maxiumum depth. |
|||
|
NodeStats Provide statistics and access by type to nodes. |
|||
|
NodeStats2 Avoid using graph code (so we can check that...) |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Return This allows us to clone a DAG of matchers in the same way as it was first created - by creating linear trees and then connecting the Delayed() instances. The postorder ordering is used to match the ordering in the more general
iteration over matchers based on the graph support classes and helps
keep things consistent (there was a strange issue where the |
Clone a tree of matchers. This clones all the matchers in a linearised set, except for the Delayed() instances, which are re-created without their contents (these are set later, to connect the trees into the final matcher DAG).
clone is the function used to create a new node instance.
|
This used to be implemented using the graph support classes
(ConstructorWalker() etc). But the left-recursive handling was
unreliable and that was too opaque to debug easily. It's possible this
code could now be moved back to that approach, as not everything
here is used (the
clone is a function used to create new instances.
|
Return (an estimate of) all left-recursive loops from the given node. We cannot know for certain whether a loop is left recursive because we don't know exactly which parsers will consume data. But we can estimate by assuming that all matchers eventually (ie via their children) consume something. We can also improve that slightly by ignoring Lookahead. So we estimate left-recursive loops as paths that start and end at the given node, and which are first children of intermediate nodes unless the node is Or, or the preceding matcher is a Lookahead. Each loop is a list that starts and ends with the given node. |
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Sat Jun 9 21:50:50 2012 | http://epydoc.sourceforge.net |