com.singularsys.jep.configurableparser
Class ShuntingYard
java.lang.Object
com.singularsys.jep.configurableparser.ShuntingYard
- All Implemented Interfaces:
- GrammarParser
public class ShuntingYard
- extends java.lang.Object
- implements GrammarParser
An operator precedence parser based on the shunting yard algorithm.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DUMP
protected static final boolean DUMP
- See Also:
- Constant Field Values
ops
protected java.util.Stack<Operator> ops
nodes
protected java.util.Stack<Node> nodes
it
protected Lookahead2Iterator<Token> it
matchers
protected java.util.List<GrammarMatcher> matchers
jep
protected Jep jep
sentinel
protected static Operator sentinel
ShuntingYard
public ShuntingYard(Jep jep,
java.util.List<GrammarMatcher> gm)
parse
public Node parse(java.util.Iterator<Token> input)
throws ParseException
- Throws:
ParseException
parseSubExpression
public Node parseSubExpression()
throws ParseException
- Callback function used by GrammerMatchers
- Specified by:
parseSubExpression
in interface GrammarParser
- Returns:
- the root node of the matched sub expression.
- Throws:
ParseException
dumpState
protected void dumpState(java.lang.String msg)
getIterator
public Lookahead2Iterator<Token> getIterator()
setIterator
public void setIterator(Lookahead2Iterator<Token> it)
Copyright © 2008 Singular Systems http://www.singularsys.com/jep