类 ActionTranslator
- java.lang.Object
-
- org.antlr.runtime.BaseRecognizer
-
- org.antlr.runtime.Lexer
-
- org.antlr.grammar.v3.ActionTranslator
-
- 所有已实现的接口:
TokenSource
public class ActionTranslator extends Lexer
-
-
字段概要
字段 修饰符和类型 字段 说明 static int
ACTION
static int
ARG
static int
ATTR_VALUE_EXPR
java.util.List<java.lang.Object>
chunks
static int
DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
static int
DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
static int
DYNAMIC_SCOPE_ATTR
static int
ENCLOSING_RULE_SCOPE_ATTR
static int
EOF
static int
ERROR_SCOPED_XY
static int
ERROR_X
static int
ERROR_XY
static int
ESC
static int
ID
static int
INDIRECT_TEMPLATE_INSTANCE
static int
INT
static int
ISOLATED_DYNAMIC_SCOPE
static int
ISOLATED_LEXER_RULE_REF
static int
ISOLATED_TOKEN_REF
static int
LABEL_REF
static int
LOCAL_ATTR
static int
RULE_SCOPE_ATTR
static int
SCOPE_INDEX_EXPR
static int
SET_ATTRIBUTE
static int
SET_DYNAMIC_SCOPE_ATTR
static int
SET_ENCLOSING_RULE_SCOPE_ATTR
static int
SET_EXPR_ATTRIBUTE
static int
SET_LOCAL_ATTR
static int
SET_RULE_SCOPE_ATTR
static int
SET_TOKEN_SCOPE_ATTR
static int
TEMPLATE_EXPR
static int
TEMPLATE_INSTANCE
static int
TEXT
static int
TOKEN_SCOPE_ATTR
static int
UNKNOWN_SYNTAX
static int
WS
-
从类继承的字段 org.antlr.runtime.BaseRecognizer
DEFAULT_TOKEN_CHANNEL, HIDDEN, INITIAL_FOLLOW_STACK_SIZE, MEMO_RULE_FAILED, MEMO_RULE_UNKNOWN, NEXT_TOKEN_RULE_NAME, state
-
-
构造器概要
构造器 构造器 说明 ActionTranslator()
ActionTranslator(CodeGenerator generator, java.lang.String ruleName, Token actionToken, int outerAltNum)
ActionTranslator(CodeGenerator generator, java.lang.String ruleName, GrammarAST actionAST)
ActionTranslator(CharStream input)
ActionTranslator(CharStream input, RecognizerSharedState state)
-
方法概要
-
从类继承的方法 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
-
-
-
-
字段详细资料
-
EOF
public static final int EOF
- 另请参阅:
- 常量字段值
-
ACTION
public static final int ACTION
- 另请参阅:
- 常量字段值
-
ARG
public static final int ARG
- 另请参阅:
- 常量字段值
-
ATTR_VALUE_EXPR
public static final int ATTR_VALUE_EXPR
- 另请参阅:
- 常量字段值
-
DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
public static final int DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
- 另请参阅:
- 常量字段值
-
DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
public static final int DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
- 另请参阅:
- 常量字段值
-
DYNAMIC_SCOPE_ATTR
public static final int DYNAMIC_SCOPE_ATTR
- 另请参阅:
- 常量字段值
-
ENCLOSING_RULE_SCOPE_ATTR
public static final int ENCLOSING_RULE_SCOPE_ATTR
- 另请参阅:
- 常量字段值
-
ERROR_SCOPED_XY
public static final int ERROR_SCOPED_XY
- 另请参阅:
- 常量字段值
-
ERROR_X
public static final int ERROR_X
- 另请参阅:
- 常量字段值
-
ERROR_XY
public static final int ERROR_XY
- 另请参阅:
- 常量字段值
-
ESC
public static final int ESC
- 另请参阅:
- 常量字段值
-
ID
public static final int ID
- 另请参阅:
- 常量字段值
-
INDIRECT_TEMPLATE_INSTANCE
public static final int INDIRECT_TEMPLATE_INSTANCE
- 另请参阅:
- 常量字段值
-
INT
public static final int INT
- 另请参阅:
- 常量字段值
-
ISOLATED_DYNAMIC_SCOPE
public static final int ISOLATED_DYNAMIC_SCOPE
- 另请参阅:
- 常量字段值
-
ISOLATED_LEXER_RULE_REF
public static final int ISOLATED_LEXER_RULE_REF
- 另请参阅:
- 常量字段值
-
ISOLATED_TOKEN_REF
public static final int ISOLATED_TOKEN_REF
- 另请参阅:
- 常量字段值
-
LABEL_REF
public static final int LABEL_REF
- 另请参阅:
- 常量字段值
-
LOCAL_ATTR
public static final int LOCAL_ATTR
- 另请参阅:
- 常量字段值
-
RULE_SCOPE_ATTR
public static final int RULE_SCOPE_ATTR
- 另请参阅:
- 常量字段值
-
SCOPE_INDEX_EXPR
public static final int SCOPE_INDEX_EXPR
- 另请参阅:
- 常量字段值
-
SET_ATTRIBUTE
public static final int SET_ATTRIBUTE
- 另请参阅:
- 常量字段值
-
SET_DYNAMIC_SCOPE_ATTR
public static final int SET_DYNAMIC_SCOPE_ATTR
- 另请参阅:
- 常量字段值
-
SET_ENCLOSING_RULE_SCOPE_ATTR
public static final int SET_ENCLOSING_RULE_SCOPE_ATTR
- 另请参阅:
- 常量字段值
-
SET_EXPR_ATTRIBUTE
public static final int SET_EXPR_ATTRIBUTE
- 另请参阅:
- 常量字段值
-
SET_LOCAL_ATTR
public static final int SET_LOCAL_ATTR
- 另请参阅:
- 常量字段值
-
SET_RULE_SCOPE_ATTR
public static final int SET_RULE_SCOPE_ATTR
- 另请参阅:
- 常量字段值
-
SET_TOKEN_SCOPE_ATTR
public static final int SET_TOKEN_SCOPE_ATTR
- 另请参阅:
- 常量字段值
-
TEMPLATE_EXPR
public static final int TEMPLATE_EXPR
- 另请参阅:
- 常量字段值
-
TEMPLATE_INSTANCE
public static final int TEMPLATE_INSTANCE
- 另请参阅:
- 常量字段值
-
TEXT
public static final int TEXT
- 另请参阅:
- 常量字段值
-
TOKEN_SCOPE_ATTR
public static final int TOKEN_SCOPE_ATTR
- 另请参阅:
- 常量字段值
-
UNKNOWN_SYNTAX
public static final int UNKNOWN_SYNTAX
- 另请参阅:
- 常量字段值
-
WS
public static final int WS
- 另请参阅:
- 常量字段值
-
chunks
public java.util.List<java.lang.Object> chunks
-
-
构造器详细资料
-
ActionTranslator
public ActionTranslator(CodeGenerator generator, java.lang.String ruleName, GrammarAST actionAST)
-
ActionTranslator
public ActionTranslator(CodeGenerator generator, java.lang.String ruleName, Token actionToken, int outerAltNum)
-
ActionTranslator
public ActionTranslator()
-
ActionTranslator
public ActionTranslator(CharStream input)
-
ActionTranslator
public ActionTranslator(CharStream input, RecognizerSharedState state)
-
-
方法详细资料
-
translateToChunks
public java.util.List<java.lang.Object> translateToChunks()
Return a list of strings and ST objects that represent the translated action.
-
translate
public java.lang.String translate()
-
translateAction
public java.util.List<java.lang.Object> translateAction(java.lang.String action)
-
isTokenRefInAlt
public boolean isTokenRefInAlt(java.lang.String id)
-
isRuleRefInAlt
public boolean isRuleRefInAlt(java.lang.String id)
-
getElementLabel
public Grammar.LabelElementPair getElementLabel(java.lang.String id)
-
checkElementRefUniqueness
public void checkElementRefUniqueness(java.lang.String ref, boolean isToken)
-
getRuleLabelAttribute
public Attribute getRuleLabelAttribute(java.lang.String ruleName, java.lang.String attrName)
For $rulelabel.name, return the Attribute found for name. It will be a predefined property or a return value.
-
template
protected org.stringtemplate.v4.ST template(java.lang.String name)
-
getDelegates
public Lexer[] getDelegates()
-
getGrammarFileName
public java.lang.String getGrammarFileName()
从类复制的说明:BaseRecognizer
For debugging and other purposes, might want the grammar name. Have ANTLR generate an implementation for this method.- 覆盖:
getGrammarFileName
在类中BaseRecognizer
-
nextToken
public Token nextToken()
从类复制的说明:Lexer
Return 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)
从类复制的说明:BaseRecognizer
Record 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)
从类复制的说明:BaseRecognizer
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.- 覆盖:
alreadyParsedRule
在类中BaseRecognizer
-
mSET_ENCLOSING_RULE_SCOPE_ATTR
public final void mSET_ENCLOSING_RULE_SCOPE_ATTR() throws RecognitionException
-
mENCLOSING_RULE_SCOPE_ATTR
public final void mENCLOSING_RULE_SCOPE_ATTR() throws RecognitionException
-
mSET_TOKEN_SCOPE_ATTR
public final void mSET_TOKEN_SCOPE_ATTR() throws RecognitionException
-
mTOKEN_SCOPE_ATTR
public final void mTOKEN_SCOPE_ATTR() throws RecognitionException
-
mSET_RULE_SCOPE_ATTR
public final void mSET_RULE_SCOPE_ATTR() throws RecognitionException
-
mRULE_SCOPE_ATTR
public final void mRULE_SCOPE_ATTR() throws RecognitionException
-
mLABEL_REF
public final void mLABEL_REF() throws RecognitionException
-
mISOLATED_TOKEN_REF
public final void mISOLATED_TOKEN_REF() throws RecognitionException
-
mISOLATED_LEXER_RULE_REF
public final void mISOLATED_LEXER_RULE_REF() throws RecognitionException
-
mSET_LOCAL_ATTR
public final void mSET_LOCAL_ATTR() throws RecognitionException
-
mLOCAL_ATTR
public final void mLOCAL_ATTR() throws RecognitionException
-
mSET_DYNAMIC_SCOPE_ATTR
public final void mSET_DYNAMIC_SCOPE_ATTR() throws RecognitionException
-
mDYNAMIC_SCOPE_ATTR
public final void mDYNAMIC_SCOPE_ATTR() throws RecognitionException
-
mERROR_SCOPED_XY
public final void mERROR_SCOPED_XY() throws RecognitionException
-
mDYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
public final void mDYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR() throws RecognitionException
-
mDYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
public final void mDYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR() throws RecognitionException
-
mSCOPE_INDEX_EXPR
public final void mSCOPE_INDEX_EXPR() throws RecognitionException
-
mISOLATED_DYNAMIC_SCOPE
public final void mISOLATED_DYNAMIC_SCOPE() throws RecognitionException
-
mTEMPLATE_INSTANCE
public final void mTEMPLATE_INSTANCE() throws RecognitionException
-
mINDIRECT_TEMPLATE_INSTANCE
public final void mINDIRECT_TEMPLATE_INSTANCE() throws RecognitionException
-
mARG
public final void mARG() throws RecognitionException
-
mSET_EXPR_ATTRIBUTE
public final void mSET_EXPR_ATTRIBUTE() throws RecognitionException
-
mSET_ATTRIBUTE
public final void mSET_ATTRIBUTE() throws RecognitionException
-
mATTR_VALUE_EXPR
public final void mATTR_VALUE_EXPR() throws RecognitionException
-
mTEMPLATE_EXPR
public final void mTEMPLATE_EXPR() throws RecognitionException
-
mACTION
public final void mACTION() throws RecognitionException
-
mESC
public final void mESC() throws RecognitionException
-
mERROR_XY
public final void mERROR_XY() throws RecognitionException
-
mERROR_X
public final void mERROR_X() throws RecognitionException
-
mUNKNOWN_SYNTAX
public final void mUNKNOWN_SYNTAX() throws RecognitionException
-
mTEXT
public final void mTEXT() throws RecognitionException
-
mID
public final void mID() throws RecognitionException
-
mINT
public final void mINT() throws RecognitionException
-
mWS
public final void mWS() throws RecognitionException
-
mTokens
public void mTokens() throws RecognitionException
从类复制的说明:Lexer
This is the lexer entry point that sets instance var 'token'- 指定者:
mTokens
在类中Lexer
- 抛出:
RecognitionException
-
synpred1_ActionTranslator_fragment
public final void synpred1_ActionTranslator_fragment() throws RecognitionException
-
synpred2_ActionTranslator_fragment
public final void synpred2_ActionTranslator_fragment() throws RecognitionException
-
synpred3_ActionTranslator_fragment
public final void synpred3_ActionTranslator_fragment() throws RecognitionException
-
synpred4_ActionTranslator_fragment
public final void synpred4_ActionTranslator_fragment() throws RecognitionException
-
synpred5_ActionTranslator_fragment
public final void synpred5_ActionTranslator_fragment() throws RecognitionException
-
synpred6_ActionTranslator_fragment
public final void synpred6_ActionTranslator_fragment() throws RecognitionException
-
synpred7_ActionTranslator_fragment
public final void synpred7_ActionTranslator_fragment() throws RecognitionException
-
synpred8_ActionTranslator_fragment
public final void synpred8_ActionTranslator_fragment() throws RecognitionException
-
synpred9_ActionTranslator_fragment
public final void synpred9_ActionTranslator_fragment() throws RecognitionException
-
synpred10_ActionTranslator_fragment
public final void synpred10_ActionTranslator_fragment() throws RecognitionException
-
synpred11_ActionTranslator_fragment
public final void synpred11_ActionTranslator_fragment() throws RecognitionException
-
synpred12_ActionTranslator_fragment
public final void synpred12_ActionTranslator_fragment() throws RecognitionException
-
synpred13_ActionTranslator_fragment
public final void synpred13_ActionTranslator_fragment() throws RecognitionException
-
synpred14_ActionTranslator_fragment
public final void synpred14_ActionTranslator_fragment() throws RecognitionException
-
synpred15_ActionTranslator_fragment
public final void synpred15_ActionTranslator_fragment() throws RecognitionException
-
synpred16_ActionTranslator_fragment
public final void synpred16_ActionTranslator_fragment() throws RecognitionException
-
synpred17_ActionTranslator_fragment
public final void synpred17_ActionTranslator_fragment() throws RecognitionException
-
synpred18_ActionTranslator_fragment
public final void synpred18_ActionTranslator_fragment() throws RecognitionException
-
synpred19_ActionTranslator_fragment
public final void synpred19_ActionTranslator_fragment() throws RecognitionException
-
synpred20_ActionTranslator_fragment
public final void synpred20_ActionTranslator_fragment() throws RecognitionException
-
synpred21_ActionTranslator_fragment
public final void synpred21_ActionTranslator_fragment() throws RecognitionException
-
synpred22_ActionTranslator_fragment
public final void synpred22_ActionTranslator_fragment() throws RecognitionException
-
synpred24_ActionTranslator_fragment
public final void synpred24_ActionTranslator_fragment() throws RecognitionException
-
synpred25_ActionTranslator_fragment
public final void synpred25_ActionTranslator_fragment() throws RecognitionException
-
synpred26_ActionTranslator_fragment
public final void synpred26_ActionTranslator_fragment() throws RecognitionException
-
synpred7_ActionTranslator
public final boolean synpred7_ActionTranslator()
-
synpred26_ActionTranslator
public final boolean synpred26_ActionTranslator()
-
synpred18_ActionTranslator
public final boolean synpred18_ActionTranslator()
-
synpred13_ActionTranslator
public final boolean synpred13_ActionTranslator()
-
synpred17_ActionTranslator
public final boolean synpred17_ActionTranslator()
-
synpred6_ActionTranslator
public final boolean synpred6_ActionTranslator()
-
synpred2_ActionTranslator
public final boolean synpred2_ActionTranslator()
-
synpred21_ActionTranslator
public final boolean synpred21_ActionTranslator()
-
synpred1_ActionTranslator
public final boolean synpred1_ActionTranslator()
-
synpred25_ActionTranslator
public final boolean synpred25_ActionTranslator()
-
synpred19_ActionTranslator
public final boolean synpred19_ActionTranslator()
-
synpred12_ActionTranslator
public final boolean synpred12_ActionTranslator()
-
synpred16_ActionTranslator
public final boolean synpred16_ActionTranslator()
-
synpred11_ActionTranslator
public final boolean synpred11_ActionTranslator()
-
synpred9_ActionTranslator
public final boolean synpred9_ActionTranslator()
-
synpred24_ActionTranslator
public final boolean synpred24_ActionTranslator()
-
synpred5_ActionTranslator
public final boolean synpred5_ActionTranslator()
-
synpred20_ActionTranslator
public final boolean synpred20_ActionTranslator()
-
synpred15_ActionTranslator
public final boolean synpred15_ActionTranslator()
-
synpred4_ActionTranslator
public final boolean synpred4_ActionTranslator()
-
synpred10_ActionTranslator
public final boolean synpred10_ActionTranslator()
-
synpred14_ActionTranslator
public final boolean synpred14_ActionTranslator()
-
synpred8_ActionTranslator
public final boolean synpred8_ActionTranslator()
-
synpred22_ActionTranslator
public final boolean synpred22_ActionTranslator()
-
synpred3_ActionTranslator
public final boolean synpred3_ActionTranslator()
-
-