Top Description Fields Constructors Methods
org.antlr.grammar.v3

public Class ActionAnalysis

extends Lexer
Class Inheritance
Annotations
@SuppressWarnings:all
Imports
org.antlr.runtime.*, org.antlr.runtime.*, org.antlr.tool.*, java.util.Stack, .List, .ArrayList, .Map, .HashMap

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

Modifier and TypeField and Description
pack-priv Token
pack-priv Rule
public static final int
pack-priv Grammar
public static final int
pack-priv int
public static final int
X

public static final int
public static final int
Y

Inherited from org.antlr.runtime.Lexer:
input

Constructor Summary

AccessConstructor and Description
public
ActionAnalysis(Grammar grammar, String ruleName, GrammarAST actionAST)

public
public
public

Method Summary

Modifier and TypeMethod and Description
public boolean
alreadyParsedRule(IntStream input, int ruleIndex)

Overrides org.antlr.runtime.BaseRecognizer.alreadyParsedRule.

Has this rule already parsed input at the current index in the input stream?
public void
public Lexer[]
public String
getGrammarFileName()

Overrides org.antlr.runtime.BaseRecognizer.getGrammarFileName.

For debugging and other purposes, might want the grammar name.
public void
memoize(IntStream input, int ruleIndex, int ruleStartIndex)

Overrides org.antlr.runtime.BaseRecognizer.memoize.

Record whether or not this rule parsed the input at this position successfully.
public final void
mID()

public void
mTokens()

Implements abstract org.antlr.runtime.Lexer.mTokens.

This is the lexer entry point that sets instance var 'token'
public final void
mX()

public final void
mX_Y()

public final void
mY()

public Token
nextToken()

Overrides org.antlr.runtime.Lexer.nextToken.

Implements org.antlr.runtime.TokenSource.nextToken.

Return a token from this source; i.e., match a token on the char stream.
public final boolean
public final void
public final boolean
public final void
Inherited from org.antlr.runtime.Lexer:
emitemitgetCharErrorDisplaygetCharIndexgetCharPositionInLinegetCharStreamgetEOFTokengetErrorMessagegetLinegetSourceNamegetTextmatchmatchmatchAnymatchRangerecoverreportErrorresetsetCharStreamsetTextskiptraceIntraceOut

Field Detail

actionTokenback to summary
pack-priv Token actionToken
enclosingRuleback to summary
pack-priv Rule enclosingRule
EOFback to summary
public static final int EOF
grammarback to summary
pack-priv Grammar grammar
IDback to summary
public static final int ID
outerAltNumback to summary
pack-priv int outerAltNum
Xback to summary
public static final int X
X_Yback to summary
public static final int X_Y
Yback to summary
public static final int Y

Constructor Detail

ActionAnalysisback to summary
public ActionAnalysis(Grammar grammar, String ruleName, GrammarAST actionAST)
ActionAnalysisback to summary
public ActionAnalysis()
ActionAnalysisback to summary
public ActionAnalysis(CharStream input)
ActionAnalysisback to summary
public ActionAnalysis(CharStream input, RecognizerSharedState state)

Method Detail

alreadyParsedRuleback to summary
public boolean alreadyParsedRule(IntStream input, int ruleIndex)

Overrides org.antlr.runtime.BaseRecognizer.alreadyParsedRule.

Doc from org.antlr.runtime.BaseRecognizer.alreadyParsedRule.

Has this rule already parsed input at the current index in the input stream? Return the stop token index or MEMO_RULE_UNKNOWN. If we attempted but failed to parse properly before, return MEMO_RULE_FAILED. This method has a side-effect: if we have seen this input for this rule and successfully parsed before, then seek ahead to 1 past the stop token matched for this rule last time.

Annotations
@Override
analyzeback to summary
public void analyze()
getDelegatesback to summary
public Lexer[] getDelegates()
getGrammarFileNameback to summary
public String getGrammarFileName()

Overrides org.antlr.runtime.BaseRecognizer.getGrammarFileName.

Doc from org.antlr.runtime.BaseRecognizer.getGrammarFileName.

For debugging and other purposes, might want the grammar name. Have ANTLR generate an implementation for this method.

Annotations
@Override
memoizeback to summary
public void memoize(IntStream input, int ruleIndex, int ruleStartIndex)

Overrides org.antlr.runtime.BaseRecognizer.memoize.

Doc from org.antlr.runtime.BaseRecognizer.memoize.

Record whether or not this rule parsed the input at this position successfully. Use a standard java hashtable for now.

Annotations
@Override
mIDback to summary
public final void mID() throws RecognitionException
mTokensback to summary
public void mTokens() throws RecognitionException

Implements abstract org.antlr.runtime.Lexer.mTokens.

Doc from org.antlr.runtime.Lexer.mTokens.

This is the lexer entry point that sets instance var 'token'

Annotations
@Override
mXback to summary
public final void mX() throws RecognitionException
mX_Yback to summary
public final void mX_Y() throws RecognitionException
mYback to summary
public final void mY() throws RecognitionException
nextTokenback to summary
public Token nextToken()

Overrides org.antlr.runtime.Lexer.nextToken.

Implements org.antlr.runtime.TokenSource.nextToken.

Doc from org.antlr.runtime.Lexer.nextToken.

Return a token from this source; i.e., match a token on the char stream.

Annotations
@Override
synpred1_ActionAnalysisback to summary
public final boolean synpred1_ActionAnalysis()
synpred1_ActionAnalysis_fragmentback to summary
public final void synpred1_ActionAnalysis_fragment() throws RecognitionException
synpred2_ActionAnalysisback to summary
public final boolean synpred2_ActionAnalysis()
synpred2_ActionAnalysis_fragmentback to summary
public final void synpred2_ActionAnalysis_fragment() throws RecognitionException