public abstract class PrefixTreeWalker
extends java.lang.Object
ParserVisitor
to traverse the various nodes. In general these methods should not
recursively walk the child nodes.
This class uses a prefix traversal scheme hence the nodes of '1+2'
will be visited in the order
+,1,2.PostfixTreeWalker
Constructor and Description |
---|
PrefixTreeWalker() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
visit(ASTConstant node,
int nchildren,
int depth1) |
protected abstract void |
visit(ASTFunNode node,
int nchildren,
int depth1) |
protected abstract void |
visit(ASTOpNode node,
int nchildren,
int depth1) |
protected abstract void |
visit(ASTVarNode node,
int nchildren,
int depth1) |
void |
walk(Node top)
Uses a non-recursive method to traverse the tree under the node 'top'.
|
public void walk(Node top) throws JepException
top
- the top node of the parse tree.JepException
protected abstract void visit(ASTFunNode node, int nchildren, int depth1) throws JepException
JepException
protected abstract void visit(ASTOpNode node, int nchildren, int depth1) throws JepException
JepException
protected abstract void visit(ASTVarNode node, int nchildren, int depth1) throws JepException
JepException
protected abstract void visit(ASTConstant node, int nchildren, int depth1) throws JepException
JepException
Copyright © 2018 Singular Systems http://www.singularsys.com/jep