Class ActionTranslator
java.lang.Object
org.antlr.runtime.BaseRecognizer
org.antlr.runtime.Lexer
org.antlr.grammar.v3.ActionTranslator
- All Implemented Interfaces:
TokenSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int(package private) Tokenstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int(package private) Rulestatic final intstatic final intstatic final intstatic final intstatic final int(package private) CodeGenerator(package private) Grammarstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int(package private) intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class BaseRecognizer
DEFAULT_TOKEN_CHANNEL, HIDDEN, INITIAL_FOLLOW_STACK_SIZE, MEMO_RULE_FAILED, MEMO_RULE_UNKNOWN, NEXT_TOKEN_RULE_NAME, state -
Constructor Summary
ConstructorsConstructorDescriptionActionTranslator(CodeGenerator generator, String ruleName, Token actionToken, int outerAltNum) ActionTranslator(CodeGenerator generator, String ruleName, GrammarAST actionAST) ActionTranslator(CharStream input) ActionTranslator(CharStream input, RecognizerSharedState state) -
Method Summary
Modifier and TypeMethodDescriptionbooleanalreadyParsedRule(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.voidcheckElementRefUniqueness(String ref, boolean isToken) Lexer[]For debugging and other purposes, might want the grammar name.getRuleLabelAttribute(String ruleName, String attrName) For $rulelabel.name, return the Attribute found for name.booleanisRuleRefInAlt(String id) booleanfinal voidmACTION()final voidmARG()final voidfinal voidfinal voidfinal voidvoidRecord whether or not this rule parsed the input at this position successfully.final voidfinal voidfinal voidmERROR_X()final voidfinal voidmESC()final voidmID()final voidfinal voidmINT()final voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidmTEXT()final voidvoidmTokens()This is the lexer entry point that sets instance var 'token'final voidfinal voidmWS()Return a token from this source; i.e., match a token on the char stream.(package private) AttributeScoperesolveDynamicScope(String scopeName) final booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidfinal booleanfinal voidprotected org.stringtemplate.v4.STtranslateAction(String action) Return a list of strings and ST objects that represent the translated action.Methods inherited from class Lexer
emit, emit, getCharErrorDisplay, getCharIndex, getCharPositionInLine, getCharStream, getEOFToken, getErrorMessage, getLine, getSourceName, getText, match, match, matchAny, matchRange, recover, reportError, reset, setCharStream, setText, skip, traceIn, traceOutMethods inherited from class 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:
-
ACTION
public static final int ACTION- See Also:
-
ARG
public static final int ARG- See Also:
-
ATTR_VALUE_EXPR
public static final int ATTR_VALUE_EXPR- See Also:
-
DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
public static final int DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR- See Also:
-
DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
public static final int DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR- See Also:
-
DYNAMIC_SCOPE_ATTR
public static final int DYNAMIC_SCOPE_ATTR- See Also:
-
ENCLOSING_RULE_SCOPE_ATTR
public static final int ENCLOSING_RULE_SCOPE_ATTR- See Also:
-
ERROR_SCOPED_XY
public static final int ERROR_SCOPED_XY- See Also:
-
ERROR_X
public static final int ERROR_X- See Also:
-
ERROR_XY
public static final int ERROR_XY- See Also:
-
ESC
public static final int ESC- See Also:
-
ID
public static final int ID- See Also:
-
INDIRECT_TEMPLATE_INSTANCE
public static final int INDIRECT_TEMPLATE_INSTANCE- See Also:
-
INT
public static final int INT- See Also:
-
ISOLATED_DYNAMIC_SCOPE
public static final int ISOLATED_DYNAMIC_SCOPE- See Also:
-
ISOLATED_LEXER_RULE_REF
public static final int ISOLATED_LEXER_RULE_REF- See Also:
-
ISOLATED_TOKEN_REF
public static final int ISOLATED_TOKEN_REF- See Also:
-
LABEL_REF
public static final int LABEL_REF- See Also:
-
LOCAL_ATTR
public static final int LOCAL_ATTR- See Also:
-
RULE_SCOPE_ATTR
public static final int RULE_SCOPE_ATTR- See Also:
-
SCOPE_INDEX_EXPR
public static final int SCOPE_INDEX_EXPR- See Also:
-
SET_ATTRIBUTE
public static final int SET_ATTRIBUTE- See Also:
-
SET_DYNAMIC_SCOPE_ATTR
public static final int SET_DYNAMIC_SCOPE_ATTR- See Also:
-
SET_ENCLOSING_RULE_SCOPE_ATTR
public static final int SET_ENCLOSING_RULE_SCOPE_ATTR- See Also:
-
SET_EXPR_ATTRIBUTE
public static final int SET_EXPR_ATTRIBUTE- See Also:
-
SET_LOCAL_ATTR
public static final int SET_LOCAL_ATTR- See Also:
-
SET_RULE_SCOPE_ATTR
public static final int SET_RULE_SCOPE_ATTR- See Also:
-
SET_TOKEN_SCOPE_ATTR
public static final int SET_TOKEN_SCOPE_ATTR- See Also:
-
TEMPLATE_EXPR
public static final int TEMPLATE_EXPR- See Also:
-
TEMPLATE_INSTANCE
public static final int TEMPLATE_INSTANCE- See Also:
-
TEXT
public static final int TEXT- See Also:
-
TOKEN_SCOPE_ATTR
public static final int TOKEN_SCOPE_ATTR- See Also:
-
UNKNOWN_SYNTAX
public static final int UNKNOWN_SYNTAX- See Also:
-
WS
public static final int WS- See Also:
-
chunks
-
enclosingRule
Rule enclosingRule -
outerAltNum
int outerAltNum -
grammar
Grammar grammar -
generator
CodeGenerator generator -
actionToken
Token actionToken
-
-
Constructor Details
-
ActionTranslator
-
ActionTranslator
public ActionTranslator(CodeGenerator generator, String ruleName, Token actionToken, int outerAltNum) -
ActionTranslator
public ActionTranslator() -
ActionTranslator
-
-
Method Details
-
translateToChunks
-
translate
-
translateAction
-
isTokenRefInAlt
-
isRuleRefInAlt
-
getElementLabel
-
checkElementRefUniqueness
-
getRuleLabelAttribute
-
resolveDynamicScope
-
template
-
getDelegates
-
getGrammarFileName
Description copied from class:BaseRecognizerFor debugging and other purposes, might want the grammar name. Have ANTLR generate an implementation for this method.- Overrides:
getGrammarFileNamein classBaseRecognizer
-
nextToken
-
memoize
Description copied from class:BaseRecognizerRecord whether or not this rule parsed the input at this position successfully. Use a standard java hashtable for now.- Overrides:
memoizein classBaseRecognizer
-
alreadyParsedRule
Description copied from class: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.- Overrides:
alreadyParsedRulein classBaseRecognizer
-
mSET_ENCLOSING_RULE_SCOPE_ATTR
- Throws:
RecognitionException
-
mENCLOSING_RULE_SCOPE_ATTR
- Throws:
RecognitionException
-
mSET_TOKEN_SCOPE_ATTR
- Throws:
RecognitionException
-
mTOKEN_SCOPE_ATTR
- Throws:
RecognitionException
-
mSET_RULE_SCOPE_ATTR
- Throws:
RecognitionException
-
mRULE_SCOPE_ATTR
- Throws:
RecognitionException
-
mLABEL_REF
- Throws:
RecognitionException
-
mISOLATED_TOKEN_REF
- Throws:
RecognitionException
-
mISOLATED_LEXER_RULE_REF
- Throws:
RecognitionException
-
mSET_LOCAL_ATTR
- Throws:
RecognitionException
-
mLOCAL_ATTR
- Throws:
RecognitionException
-
mSET_DYNAMIC_SCOPE_ATTR
- Throws:
RecognitionException
-
mDYNAMIC_SCOPE_ATTR
- Throws:
RecognitionException
-
mERROR_SCOPED_XY
- Throws:
RecognitionException
-
mDYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
- Throws:
RecognitionException
-
mDYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
- Throws:
RecognitionException
-
mSCOPE_INDEX_EXPR
- Throws:
RecognitionException
-
mISOLATED_DYNAMIC_SCOPE
- Throws:
RecognitionException
-
mTEMPLATE_INSTANCE
- Throws:
RecognitionException
-
mINDIRECT_TEMPLATE_INSTANCE
- Throws:
RecognitionException
-
mARG
- Throws:
RecognitionException
-
mSET_EXPR_ATTRIBUTE
- Throws:
RecognitionException
-
mSET_ATTRIBUTE
- Throws:
RecognitionException
-
mATTR_VALUE_EXPR
- Throws:
RecognitionException
-
mTEMPLATE_EXPR
- Throws:
RecognitionException
-
mACTION
- Throws:
RecognitionException
-
mESC
- Throws:
RecognitionException
-
mERROR_XY
- Throws:
RecognitionException
-
mERROR_X
- Throws:
RecognitionException
-
mUNKNOWN_SYNTAX
- Throws:
RecognitionException
-
mTEXT
- Throws:
RecognitionException
-
mID
- Throws:
RecognitionException
-
mINT
- Throws:
RecognitionException
-
mWS
- Throws:
RecognitionException
-
mTokens
Description copied from class:LexerThis is the lexer entry point that sets instance var 'token'- Specified by:
mTokensin classLexer- Throws:
RecognitionException
-
synpred1_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred2_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred3_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred4_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred5_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred6_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred7_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred8_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred9_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred10_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred11_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred12_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred13_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred14_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred15_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred16_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred17_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred18_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred19_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred20_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred21_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred22_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred24_ActionTranslator_fragment
- Throws:
RecognitionException
-
synpred25_ActionTranslator_fragment
- Throws:
RecognitionException
-
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()
-