类 ActionAnalysis
- java.lang.Object
-
- org.antlr.runtime.BaseRecognizer
-
- org.antlr.runtime.Lexer
-
- org.antlr.grammar.v3.ActionAnalysis
-
- 所有已实现的接口:
TokenSource
public class ActionAnalysis extends 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.
-
-
字段概要
字段 修饰符和类型 字段 说明 static intEOFstatic intIDstatic intXstatic intX_Ystatic intY-
从类继承的字段 org.antlr.runtime.BaseRecognizer
DEFAULT_TOKEN_CHANNEL, HIDDEN, INITIAL_FOLLOW_STACK_SIZE, MEMO_RULE_FAILED, MEMO_RULE_UNKNOWN, NEXT_TOKEN_RULE_NAME, state
-
-
构造器概要
构造器 构造器 说明 ActionAnalysis()ActionAnalysis(CharStream input)ActionAnalysis(CharStream input, RecognizerSharedState state)ActionAnalysis(Grammar grammar, java.lang.String ruleName, GrammarAST actionAST)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanalreadyParsedRule(IntStream input, int ruleIndex)Has this rule already parsed input at the current index in the input stream? Return the stop token index or MEMO_RULE_UNKNOWN.voidanalyze()Lexer[]getDelegates()java.lang.StringgetGrammarFileName()For debugging and other purposes, might want the grammar name.voidmemoize(IntStream input, int ruleIndex, int ruleStartIndex)Record whether or not this rule parsed the input at this position successfully.voidmID()voidmTokens()This is the lexer entry point that sets instance var 'token'voidmX()voidmX_Y()voidmY()TokennextToken()Return a token from this source; i.e., match a token on the char stream.booleansynpred1_ActionAnalysis()voidsynpred1_ActionAnalysis_fragment()booleansynpred2_ActionAnalysis()voidsynpred2_ActionAnalysis_fragment()-
从类继承的方法 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
-
从类继承的方法 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
-
-
-
-
构造器详细资料
-
ActionAnalysis
public ActionAnalysis(Grammar grammar, java.lang.String ruleName, GrammarAST actionAST)
-
ActionAnalysis
public ActionAnalysis()
-
ActionAnalysis
public ActionAnalysis(CharStream input)
-
ActionAnalysis
public ActionAnalysis(CharStream input, RecognizerSharedState state)
-
-
方法详细资料
-
analyze
public void analyze()
-
getDelegates
public Lexer[] getDelegates()
-
getGrammarFileName
public java.lang.String getGrammarFileName()
从类复制的说明:BaseRecognizerFor debugging and other purposes, might want the grammar name. Have ANTLR generate an implementation for this method.- 覆盖:
getGrammarFileName在类中BaseRecognizer
-
nextToken
public Token nextToken()
从类复制的说明:LexerReturn a token from this source; i.e., match a token on the char stream.- 指定者:
nextToken在接口中TokenSource- 覆盖:
nextToken在类中Lexer
-
memoize
public void memoize(IntStream input, int ruleIndex, int ruleStartIndex)
从类复制的说明:BaseRecognizerRecord whether or not this rule parsed the input at this position successfully. Use a standard java hashtable for now.- 覆盖:
memoize在类中BaseRecognizer
-
alreadyParsedRule
public boolean alreadyParsedRule(IntStream input, int ruleIndex)
从类复制的说明:BaseRecognizerHas 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.- 覆盖:
alreadyParsedRule在类中BaseRecognizer
-
mX_Y
public final void mX_Y() throws RecognitionException
-
mX
public final void mX() throws RecognitionException
-
mY
public final void mY() throws RecognitionException
-
mID
public final void mID() throws RecognitionException
-
mTokens
public void mTokens() throws RecognitionException从类复制的说明:LexerThis is the lexer entry point that sets instance var 'token'- 指定者:
mTokens在类中Lexer- 抛出:
RecognitionException
-
synpred1_ActionAnalysis_fragment
public final void synpred1_ActionAnalysis_fragment() throws RecognitionException
-
synpred2_ActionAnalysis_fragment
public final void synpred2_ActionAnalysis_fragment() throws RecognitionException
-
synpred2_ActionAnalysis
public final boolean synpred2_ActionAnalysis()
-
synpred1_ActionAnalysis
public final boolean synpred1_ActionAnalysis()
-
-