|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norecess.antlr.PostScan
public class PostScan
Handles the post-processing of a successful scan by your lexer. Read the
documentation for Assert for description of how to use this class.
For those who would like to know more...
getSingleToken() returns a single token from the lexer and
asserts that the second token is the end-of-file marker.parseAs(String) uses your parser to parse the tokens from the
lexer using a production that you specify.
| Field Summary | |
|---|---|
private IANTLRFrontEnd |
myFrontEnd
|
private LexerWrapper |
myLexerWrapper
|
| Constructor Summary | |
|---|---|
PostScan(org.antlr.runtime.Lexer lexer,
IANTLRFrontEnd frontEnd)
Constructs a post-scan object. |
|
PostScan(LexerWrapper lexer,
IANTLRFrontEnd frontEnd)
|
|
| Method Summary | |
|---|---|
private void |
assertNoMoreTokens(org.antlr.runtime.Parser parser,
org.antlr.runtime.RuleReturnScope result)
|
private org.antlr.runtime.Parser |
createParser()
|
org.antlr.runtime.Token |
getSingleToken()
Returns a single token from the lexer's token stream, and asserts that the second token is an end-of-file. |
org.antlr.runtime.TokenSource |
getTokenSource()
Returns a token source for the lexer. |
private org.antlr.runtime.RuleReturnScope |
invokeRuleMethod(org.antlr.runtime.Parser parser,
String production)
|
PostParse |
parseAs(String production)
Parses the lexer's token stream using the specified production. |
private org.antlr.runtime.tree.Tree |
parseForAst(org.antlr.runtime.Parser parser,
String production)
|
private Method |
ruleMethod(org.antlr.runtime.Parser parser,
String production)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final IANTLRFrontEnd myFrontEnd
private final LexerWrapper myLexerWrapper
| Constructor Detail |
|---|
public PostScan(org.antlr.runtime.Lexer lexer,
IANTLRFrontEnd frontEnd)
ANTLRTester.scanInput(String), and typically you will not need to
create one yourself.
lexer - the lexer ready to provide a token stream.frontEnd - factory to create a parser.
public PostScan(LexerWrapper lexer,
IANTLRFrontEnd frontEnd)
| Method Detail |
|---|
public org.antlr.runtime.Token getSingleToken()
public org.antlr.runtime.TokenSource getTokenSource()
public PostParse parseAs(String production)
production - the name of the production from the parser.
private void assertNoMoreTokens(org.antlr.runtime.Parser parser,
org.antlr.runtime.RuleReturnScope result)
private org.antlr.runtime.Parser createParser()
private org.antlr.runtime.RuleReturnScope invokeRuleMethod(org.antlr.runtime.Parser parser,
String production)
private org.antlr.runtime.tree.Tree parseForAst(org.antlr.runtime.Parser parser,
String production)
private Method ruleMethod(org.antlr.runtime.Parser parser,
String production)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||