|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--geneseo.cs.compiler.LRParser | +--geneseo.cs.miniml.MinimLLRParser
Represents LR parsers for MinimL.
Constructor Summary | |
MinimLLRParser()
Initialize an LR parser for MinimL. |
Method Summary | |
void |
error(int code,
TokenSeq input,
java.util.Stack parseStack)
Handle an error for a MinimL SLR parser. |
protected int |
leftSide(int production)
Figures out the non-terminal on the left side of a production, given the production number. |
protected ParseNode |
reduce(int production)
Reduce by a specified production during a parse. |
Methods inherited from class geneseo.cs.compiler.LRParser |
a, e, parse, popSymbol, r, s |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MinimLLRParser()
Method Detail |
protected ParseNode reduce(int production) throws CompilerException
LRParser
reduce
in class LRParser
geneseo.cs.compiler.LRParser
production
- The number of the production by which to reduce.CompilerException
- If the parse stack doesn't have enough items
on it to complete the reduction, or if the production number is invalid.protected int leftSide(int production)
LRParser
leftSide
in class LRParser
geneseo.cs.compiler.LRParser
production
- The production number.public void error(int code, TokenSeq input, java.util.Stack parseStack) throws CompilerException
error
in class LRParser
code
- The error code from the parse table.input
- The sequence of tokens being processed when the error was detected.parseStack
- The parser's stack at the time of the error.CompilerException
- To report the error to other parts of the compiler.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |