| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | Interpreter.
A lexer listener that just creates token objects as they are matched. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | getSourceName()
Implements org. |
| public Token | nextToken()
Implements org. |
| public void | |
| public ParseTree | |
| public ParseTree | |
| protected void | parseEngine(String startRule, NFAState start, NFAState stop, IntStream input, Stack<NFAState> ruleInvocationStack, DebugEventListener actions, List<NFAState> visitedStates)
Fill a list of all NFA states visited during the parse |
| public int | |
| public void | |
| public void | scan(String startRule, DebugEventListener actions, List<NFAState> visitedStates)
For a given input char stream, try to match against the NFA starting at startRule. |
| public CommonToken | |
| public CommonToken |
| grammar | back to summary |
|---|---|
| protected Grammar grammar | |
| input | back to summary |
|---|---|
| protected IntStream input | |
| Interpreter | back to summary |
|---|---|
| public Interpreter(Grammar grammar, IntStream input) | |
| getSourceName | back to summary |
|---|---|
| public String getSourceName() Implements org. Doc from org. Where are you getting tokens from? normally the implication will simply ask lexers input stream.
| |
| nextToken | back to summary |
|---|---|
| public Token nextToken() Implements org. Doc from org. Return a Token object from your input stream (usually a CharStream). Do not fail/return upon lexing error; keep chewing on the characters until you get a good one; errors are not passed through to the parser.
| |
| parse | back to summary |
|---|---|
| public void parse(String startRule, DebugEventListener actions, List<NFAState> visitedStates) throws RecognitionException | |
| parse | back to summary |
|---|---|
| public ParseTree parse(String startRule) throws RecognitionException | |
| parse | back to summary |
|---|---|
| public ParseTree parse(String startRule, List<NFAState> visitedStates) throws RecognitionException | |
| parseEngine | back to summary |
|---|---|
| protected void parseEngine(String startRule, NFAState start, NFAState stop, IntStream input, Stack<NFAState> ruleInvocationStack, DebugEventListener actions, List<NFAState> visitedStates) throws RecognitionException Fill a list of all NFA states visited during the parse | |
| predict | back to summary |
|---|---|
| public int predict(DFA dfa) Given an input stream, return the unique alternative predicted by matching the input. Upon error, return NFA.INVALID_ALT_NUMBER The first symbol of lookahead is presumed to be primed; that is, input.lookahead(1) must point at the input symbol you want to start predicting with. | |
| reportScanError | back to summary |
|---|---|
| public void reportScanError(RecognitionException re) | |
| scan | back to summary |
|---|---|
| public void scan(String startRule, DebugEventListener actions, List<NFAState> visitedStates) throws RecognitionException For a given input char stream, try to match against the NFA starting at startRule. This is a deterministic parse even though it is using an NFA because it uses DFAs at each decision point to predict which alternative will succeed. This is exactly what the generated parser will do. This only does lexer grammars. Return the token type associated with the final rule end state. | |
| scan | back to summary |
|---|---|
| public CommonToken scan(String startRule) throws RecognitionException | |
| scan | back to summary |
|---|---|
| public CommonToken scan(String startRule, List<NFAState> visitedStates) throws RecognitionException | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Grammar | |
| public CommonToken |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | exitRule(String grammarFileName, String ruleName)
Overrides org. Implements org. |
| LexerActionGetTokenType | back to summary |
|---|---|
| public LexerActionGetTokenType(Grammar g) | |
| exitRule | back to summary |
|---|---|
| public void exitRule(String grammarFileName, String ruleName) Overrides org. Implements org. Doc from org. This is the last thing executed before leaving a rule. It is executed even if an exception is thrown. This is triggered after error reporting and recovery have occurred (unless the exception is not caught in this rule). This implies an "exitAlt" event. The grammarFileName allows composite grammars to jump around among multiple grammar files.
| |