Package org.antlr.grammar.v3
Class ActionAnalysis
java.lang.Object
org.antlr.runtime.BaseRecognizer
org.antlr.runtime.Lexer
org.antlr.grammar.v3.ActionAnalysis
- All Implemented Interfaces:
org.antlr.runtime.TokenSource
public class ActionAnalysis
extends org.antlr.runtime.Lexer
We need to set Rule.referencedPredefinedRuleAttributes before
code generation. This filter looks at an action in context of
its rule and outer alternative number and figures out which
rules have predefined prefs referenced. I need this so I can
remove unusued labels. This also tracks, for labeled rules,
which are referenced by actions.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) org.antlr.runtime.Token
(package private) Rule
static final int
(package private) Grammar
static final int
(package private) int
static final int
static final int
static final int
Fields inherited from class org.antlr.runtime.Lexer
input
Fields inherited from class org.antlr.runtime.BaseRecognizer
DEFAULT_TOKEN_CHANNEL, HIDDEN, INITIAL_FOLLOW_STACK_SIZE, MEMO_RULE_FAILED, MEMO_RULE_UNKNOWN, NEXT_TOKEN_RULE_NAME, state
-
Constructor Summary
ConstructorsConstructorDescriptionActionAnalysis
(org.antlr.runtime.CharStream input) ActionAnalysis
(org.antlr.runtime.CharStream input, org.antlr.runtime.RecognizerSharedState state) ActionAnalysis
(Grammar grammar, String ruleName, GrammarAST actionAST) -
Method Summary
Modifier and TypeMethodDescriptionboolean
alreadyParsedRule
(org.antlr.runtime.IntStream input, int ruleIndex) void
analyze()
org.antlr.runtime.Lexer[]
void
memoize
(org.antlr.runtime.IntStream input, int ruleIndex, int ruleStartIndex) final void
mID()
void
mTokens()
final void
mX()
final void
mX_Y()
final void
mY()
org.antlr.runtime.Token
final boolean
final void
final boolean
final void
Methods inherited from class org.antlr.runtime.Lexer
emit, emit, getCharErrorDisplay, getCharIndex, getCharPositionInLine, getCharStream, getEOFToken, getErrorMessage, getLine, getSourceName, getText, match, match, matchAny, matchRange, recover, reportError, reset, setCharStream, setText, skip, traceIn, traceOut
Methods inherited from class org.antlr.runtime.BaseRecognizer
beginResync, combineFollows, computeContextSensitiveRuleFOLLOW, computeErrorRecoverySet, consumeUntil, consumeUntil, displayRecognitionError, emitErrorMessage, endResync, failed, getBacktrackingLevel, getCurrentInputSymbol, getErrorHeader, getMissingSymbol, getNumberOfSyntaxErrors, getRuleInvocationStack, getRuleInvocationStack, getRuleMemoization, getRuleMemoizationCacheSize, getTokenErrorDisplay, getTokenNames, match, matchAny, mismatchIsMissingToken, mismatchIsUnwantedToken, pushFollow, recover, recoverFromMismatchedSet, recoverFromMismatchedToken, setBacktrackingLevel, toStrings, traceIn, traceOut
-
Field Details
-
EOF
public static final int EOF- See Also:
-
ID
public static final int ID- See Also:
-
X
public static final int X- See Also:
-
X_Y
public static final int X_Y- See Also:
-
Y
public static final int Y- See Also:
-
enclosingRule
Rule enclosingRule -
grammar
Grammar grammar -
actionToken
org.antlr.runtime.Token actionToken -
outerAltNum
int outerAltNum
-
-
Constructor Details
-
ActionAnalysis
-
ActionAnalysis
public ActionAnalysis() -
ActionAnalysis
public ActionAnalysis(org.antlr.runtime.CharStream input)
-
-
Method Details
-
analyze
public void analyze() -
getDelegates
public org.antlr.runtime.Lexer[] getDelegates() -
getGrammarFileName
- Overrides:
getGrammarFileName
in classorg.antlr.runtime.BaseRecognizer
-
nextToken
public org.antlr.runtime.Token nextToken()- Specified by:
nextToken
in interfaceorg.antlr.runtime.TokenSource
- Overrides:
nextToken
in classorg.antlr.runtime.Lexer
-
memoize
public void memoize(org.antlr.runtime.IntStream input, int ruleIndex, int ruleStartIndex) - Overrides:
memoize
in classorg.antlr.runtime.BaseRecognizer
-
alreadyParsedRule
public boolean alreadyParsedRule(org.antlr.runtime.IntStream input, int ruleIndex) - Overrides:
alreadyParsedRule
in classorg.antlr.runtime.BaseRecognizer
-
mX_Y
public final void mX_Y() throws org.antlr.runtime.RecognitionException- Throws:
org.antlr.runtime.RecognitionException
-
mX
public final void mX() throws org.antlr.runtime.RecognitionException- Throws:
org.antlr.runtime.RecognitionException
-
mY
public final void mY() throws org.antlr.runtime.RecognitionException- Throws:
org.antlr.runtime.RecognitionException
-
mID
public final void mID() throws org.antlr.runtime.RecognitionException- Throws:
org.antlr.runtime.RecognitionException
-
mTokens
public void mTokens() throws org.antlr.runtime.RecognitionException- Specified by:
mTokens
in classorg.antlr.runtime.Lexer
- Throws:
org.antlr.runtime.RecognitionException
-
synpred1_ActionAnalysis_fragment
public final void synpred1_ActionAnalysis_fragment() throws org.antlr.runtime.RecognitionException- Throws:
org.antlr.runtime.RecognitionException
-
synpred2_ActionAnalysis_fragment
public final void synpred2_ActionAnalysis_fragment() throws org.antlr.runtime.RecognitionException- Throws:
org.antlr.runtime.RecognitionException
-
synpred2_ActionAnalysis
public final boolean synpred2_ActionAnalysis() -
synpred1_ActionAnalysis
public final boolean synpred1_ActionAnalysis()
-