Public Member Functions | |
LLkParser (int k_) | |
LLkParser (ParserSharedInputState state, int k_) | |
LLkParser (TokenBuffer tokenBuf, int k_) | |
LLkParser (TokenStream lexer, int k_) | |
void | consume () throws TokenStreamException |
int | LA (int i) throws TokenStreamException |
Token | LT (int i) throws TokenStreamException |
void | traceIn (String rname) throws TokenStreamException |
void | traceOut (String rname) throws TokenStreamException |
Package Attributes | |
int | k |
An LL(k) parser.
antlr.LLkParser.LLkParser | ( | int | k_ | ) |
References antlr.LLkParser.k.
antlr.LLkParser.LLkParser | ( | ParserSharedInputState | state, | |
int | k_ | |||
) |
References antlr.LLkParser.k.
antlr.LLkParser.LLkParser | ( | TokenBuffer | tokenBuf, | |
int | k_ | |||
) |
References antlr.LLkParser.k, and antlr.Parser.setTokenBuffer().
antlr.LLkParser.LLkParser | ( | TokenStream | lexer, | |
int | k_ | |||
) |
References antlr.LLkParser.k, and antlr.Parser.setTokenBuffer().
void antlr.LLkParser.consume | ( | ) | throws TokenStreamException [virtual] |
Consume another token from the input stream. Can only write sequentially! If you need 3 tokens ahead, you must consume() 3 times.
Note that it is possible to overwrite tokens that have not been matched. For example, calling consume() 3 times when k=2, means that the first token consumed will be overwritten with the 3rd.
Implements antlr.Parser.
References antlr.TokenBuffer.consume(), antlr.ParserSharedInputState.input, and antlr.Parser.inputState.
Referenced by antlr.preprocessor.Preprocessor.class_def(), antlr.ANTLRParser.classDef(), antlr.preprocessor.Preprocessor.exceptionGroup(), antlr.preprocessor.Preprocessor.exceptionHandler(), antlr.preprocessor.Preprocessor.exceptionSpec(), antlr.ANTLRTokdefParser.file(), antlr.preprocessor.Preprocessor.grammarFile(), antlr.ANTLRTokdefParser.line(), antlr.preprocessor.Preprocessor.optionSpec(), antlr.preprocessor.Preprocessor.rule(), antlr.preprocessor.Preprocessor.superClass(), and antlr.preprocessor.Preprocessor.throwsSpec().
int antlr.LLkParser.LA | ( | int | i | ) | throws TokenStreamException [virtual] |
Return the token type of the ith token of lookahead where i=1 is the current token being examined by the parser (i.e., it has not been matched yet).
Implements antlr.Parser.
References antlr.ParserSharedInputState.input, antlr.Parser.inputState, and antlr.TokenBuffer.LA().
Referenced by antlr.debug.ParseTreeDebugParser.addCurrentTokenToParseTree(), antlr.ANTLRParser.alternative(), PascalParser.arrayType(), antlr.ANTLRParser.ast_type_spec(), PascalParser.block(), antlr.ANTLRParser.block(), PascalParser.caseStatement(), antlr.ANTLRParser.charSet(), antlr.preprocessor.Preprocessor.class_def(), antlr.ANTLRParser.classDef(), PascalParser.conditionalStatement(), PascalParser.constant(), PascalParser.constantDefinitionPart(), PascalParser.constList(), antlr.ANTLRParser.ebnf(), PascalParser.element(), antlr.ANTLRParser.element(), PascalParser.elementList(), antlr.ANTLRParser.elementNoOptionSpec(), antlr.ANTLRParser.elementOptionSpec(), antlr.preprocessor.Preprocessor.exceptionGroup(), antlr.ANTLRParser.exceptionGroup(), antlr.preprocessor.Preprocessor.exceptionSpec(), antlr.ANTLRParser.exceptionSpec(), antlr.ANTLRParser.exceptionSpecNoLabel(), PascalParser.expression(), PascalParser.factor(), PascalParser.fieldList(), antlr.ANTLRTokdefParser.file(), antlr.ANTLRParser.fileOptionsSpec(), PascalParser.fileType(), PascalParser.fixedPart(), PascalParser.forList(), PascalParser.formalParameterList(), PascalParser.formalParameterSection(), PascalParser.functionDeclaration(), PascalParser.functionType(), antlr.ANTLRParser.grammar(), antlr.preprocessor.Preprocessor.grammarFile(), antlr.ANTLRParser.id(), PascalParser.identifierList(), PascalParser.ifStatement(), PascalParser.labelDeclarationPart(), antlr.ANTLRParser.lexerOptionsSpec(), antlr.ANTLRParser.lexerSpec(), antlr.ANTLRTokdefParser.line(), antlr.ANTLRParser.notTerminal(), antlr.preprocessor.Preprocessor.optionSpec(), antlr.ANTLRParser.optionValue(), PascalParser.parameterList(), antlr.ANTLRParser.parserOptionsSpec(), antlr.ANTLRParser.parserSpec(), PascalParser.procedureDeclaration(), PascalParser.procedureOrFunctionDeclaration(), PascalParser.procedureStatement(), PascalParser.procedureType(), PascalParser.program(), PascalParser.programHeading(), antlr.ANTLRParser.qualifiedID(), antlr.ANTLRParser.range(), PascalParser.recordVariableList(), PascalParser.repetetiveStatement(), antlr.ANTLRParser.rootNode(), antlr.preprocessor.Preprocessor.rule(), antlr.ANTLRParser.rule(), antlr.ANTLRParser.ruleOptionsSpec(), antlr.ANTLRParser.rules(), PascalParser.set(), antlr.ANTLRParser.setBlockElement(), PascalParser.sign(), PascalParser.signedFactor(), PascalParser.simpleExpression(), PascalParser.simpleStatement(), PascalParser.simpleType(), PascalParser.statement(), PascalParser.statements(), PascalParser.stringtype(), PascalParser.structuredStatement(), PascalParser.structuredType(), antlr.ANTLRParser.subruleOptionsSpec(), PascalParser.tag(), PascalParser.term(), antlr.ANTLRParser.terminal(), antlr.preprocessor.Preprocessor.throwsSpec(), antlr.ANTLRParser.throwsSpec(), antlr.ANTLRParser.tokensSpec(), antlr.ANTLRParser.tokensSpecOptions(), antlr.ANTLRParser.tree(), antlr.ANTLRParser.treeParserOptionsSpec(), antlr.ANTLRParser.treeParserSpec(), PascalParser.type(), PascalParser.typeDefinition(), PascalParser.typeDefinitionPart(), PascalParser.typeIdentifier(), PascalParser.typeList(), PascalParser.unlabelledStatement(), PascalParser.unpackedStructuredType(), PascalParser.unsignedConstant(), PascalParser.unsignedNumber(), PascalParser.variable(), PascalParser.variableDeclarationPart(), and PascalParser.variantPart().
Token antlr.LLkParser.LT | ( | int | i | ) | throws TokenStreamException [virtual] |
Return the ith token of lookahead
Implements antlr.Parser.
References antlr.ParserSharedInputState.input, antlr.Parser.inputState, and antlr.TokenBuffer.LT().
Referenced by antlr.debug.ParseTreeDebugParser.addCurrentTokenToParseTree(), antlr.ANTLRParser.alternative(), antlr.ANTLRParser.ast_type_spec(), antlr.preprocessor.Preprocessor.class_def(), antlr.ANTLRParser.classDef(), antlr.ANTLRParser.ebnf(), antlr.ANTLRParser.element(), antlr.ANTLRParser.elementNoOptionSpec(), antlr.ANTLRParser.exceptionGroup(), antlr.preprocessor.Preprocessor.exceptionHandler(), antlr.ANTLRParser.exceptionHandler(), antlr.preprocessor.Preprocessor.exceptionSpec(), antlr.ANTLRParser.exceptionSpec(), antlr.ANTLRTokdefParser.file(), antlr.ANTLRParser.grammar(), antlr.preprocessor.Preprocessor.grammarFile(), antlr.ANTLRParser.id(), antlr.ANTLRParser.lexerSpec(), antlr.ANTLRTokdefParser.line(), antlr.debug.LLkDebuggingParser.match(), antlr.debug.LLkDebuggingParser.matchNot(), antlr.ANTLRParser.notTerminal(), antlr.preprocessor.Preprocessor.optionSpec(), antlr.ANTLRParser.optionValue(), antlr.ANTLRParser.parserSpec(), antlr.ANTLRParser.range(), antlr.ANTLRParser.rootNode(), antlr.preprocessor.Preprocessor.rule(), antlr.ANTLRParser.rule(), antlr.ANTLRParser.rules(), antlr.ANTLRParser.setBlockElement(), antlr.preprocessor.Preprocessor.superClass(), antlr.ANTLRParser.superClass(), antlr.ANTLRParser.terminal(), antlr.preprocessor.Preprocessor.throwsSpec(), antlr.ANTLRParser.tokensSpec(), antlr.ANTLRParser.tree(), and antlr.ANTLRParser.treeParserSpec().
void antlr.LLkParser.traceIn | ( | String | rname | ) | throws TokenStreamException |
Reimplemented from antlr.Parser.
Reimplemented in antlr.debug.ParseTreeDebugParser.
References antlr.Parser.traceDepth.
void antlr.LLkParser.traceOut | ( | String | rname | ) | throws TokenStreamException |
Reimplemented from antlr.Parser.
Reimplemented in antlr.debug.ParseTreeDebugParser.
References antlr.Parser.traceDepth.
int antlr.LLkParser.k [package] |
Referenced by antlr.LLkParser.LLkParser().