|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.singularsys.jep.configurableparser.ShuntingYard com.singularsys.jep.misc.lineNumbering.LineNumberingShuntingYard
public class LineNumberingShuntingYard
Version of the shunting yard algorithm which sets lines numbers in the parse tree. By convention numbering starts from line 1 column 1.
Nested Class Summary | |
---|---|
static class |
LineNumberingShuntingYard.LineNumberGrammarParserFactory
|
Nested classes/interfaces inherited from class com.singularsys.jep.configurableparser.ShuntingYard |
---|
ShuntingYard.ShuntingYardGrammarParserFactory |
Field Summary | |
---|---|
protected java.util.Stack<com.singularsys.jep.misc.lineNumbering.LineNumberingShuntingYard.Position> |
posns
Stack to track positions when pushing and popping operators |
Fields inherited from class com.singularsys.jep.configurableparser.ShuntingYard |
---|
DUMP, implicitMul, it, jep, matchers, nf, nodes, ops, sentinel |
Constructor Summary | |
---|---|
LineNumberingShuntingYard(Jep jep,
java.util.List<GrammarMatcher> gm)
Constructor |
Method Summary | |
---|---|
Node |
parseSubExpression()
Callback function used by GrammerMatchers |
protected void |
popOp()
Pops an operator off the Operator stack, and creates a new node. |
protected void |
prefix()
Matches identifies, numbers, prefix operators and plugged in grammar matchers. |
protected void |
pushOp(Operator op,
Token tok)
The pushOp function is worth some explanation Say 1+2*3 is parsed. |
Methods inherited from class com.singularsys.jep.configurableparser.ShuntingYard |
---|
compareOps, dumpState, expression, getIterator, parse, prefixSuffix, setIterator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Stack<com.singularsys.jep.misc.lineNumbering.LineNumberingShuntingYard.Position> posns
Constructor Detail |
---|
public LineNumberingShuntingYard(Jep jep, java.util.List<GrammarMatcher> gm)
jep
- gm
- Method Detail |
---|
public Node parseSubExpression() throws ParseException
ShuntingYard
parseSubExpression
in interface GrammarParser
parseSubExpression
in class ShuntingYard
ParseException
protected void popOp() throws ParseException
ShuntingYard
popOp
in class ShuntingYard
ParseException
protected void prefix() throws ParseException
ShuntingYard
prefix
in class ShuntingYard
ParseException
protected void pushOp(Operator op, Token tok) throws ParseException
ShuntingYard
pushOp
in class ShuntingYard
tok
- Token operator came from
ParseException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |