public class GenericParser extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
GenericParser.ParseException |
| Modifier and Type | Field and Description |
|---|---|
protected Grammar |
grammar |
protected GenericParseContext.TextSource |
source |
protected int |
tmHead |
protected GenericLexer |
tmLexer |
protected GenericLexer.Span |
tmNext |
protected GenericLexer.Span[] |
tmStack |
| Constructor and Description |
|---|
GenericParser(GenericLexer.ErrorReporter reporter,
ParserData tables,
Grammar grammar,
boolean debugSyntax) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyRule(GenericLexer.Span tmLeft,
int rule,
int ruleLength) |
protected void |
cleanup(GenericLexer.Span value)
cleans node removed from the stack
|
protected void |
dispose(GenericLexer.Span value)
disposes symbol dropped by error recovery mechanism
|
Object |
parse(GenericLexer lexer,
int initialState,
int finalState,
boolean noEoi) |
protected void |
reduce(int rule) |
protected boolean |
restore() |
protected void |
shift(boolean lazy) |
protected int |
tmAction(int state,
int symbol)
-3-n Lookahead (state id)
-2 Error
-1 Shift
0..n Reduce (rule index)
|
protected int |
tmGoto(int state,
int symbol) |
protected GenericParseContext.TextSource source
protected final Grammar grammar
protected int tmHead
protected GenericLexer.Span[] tmStack
protected GenericLexer.Span tmNext
protected GenericLexer tmLexer
public GenericParser(GenericLexer.ErrorReporter reporter, ParserData tables, Grammar grammar, boolean debugSyntax)
protected final int tmAction(int state,
int symbol)
protected final int tmGoto(int state,
int symbol)
public Object parse(GenericLexer lexer, int initialState, int finalState, boolean noEoi) throws IOException, GenericParser.ParseException
protected boolean restore()
throws IOException
IOExceptionprotected void shift(boolean lazy)
throws IOException
IOExceptionprotected void reduce(int rule)
protected void applyRule(GenericLexer.Span tmLeft, int rule, int ruleLength)
protected void dispose(GenericLexer.Span value)
protected void cleanup(GenericLexer.Span value)
Copyright © 2014. All rights reserved.