org.antlr.codegen
Class ActionTranslatorLexer
java.lang.Object
Lexer
org.antlr.codegen.ActionTranslatorLexer
public class ActionTranslatorLexer
- extends Lexer
Method Summary |
boolean |
alreadyParsedRule(IntStream input,
int ruleIndex)
|
void |
checkElementRefUniqueness(java.lang.String ref,
boolean isToken)
|
Token |
emit(int tokenType,
int line,
int charPosition,
int channel,
int start,
int stop)
|
Grammar.LabelElementPair |
getElementLabel(java.lang.String id)
|
java.lang.String |
getGrammarFileName()
|
Attribute |
getRuleLabelAttribute(java.lang.String ruleName,
java.lang.String attrName)
For $rulelabel.name, return the Attribute found for name. |
boolean |
isRuleRefInAlt(java.lang.String id)
|
boolean |
isTokenRefInAlt(java.lang.String id)
|
void |
mACTION()
|
void |
mARG()
|
void |
mATTR_VALUE_EXPR()
|
void |
mDYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR()
|
void |
mDYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR()
|
void |
mDYNAMIC_SCOPE_ATTR()
|
void |
memoize(IntStream input,
int ruleIndex,
int ruleStartIndex)
|
void |
mENCLOSING_RULE_SCOPE_ATTR()
|
void |
mERROR_SCOPED_XY()
|
void |
mERROR_X()
|
void |
mERROR_XY()
|
void |
mESC()
|
void |
mID()
|
void |
mINDIRECT_TEMPLATE_INSTANCE()
|
void |
mINT()
|
void |
mISOLATED_DYNAMIC_SCOPE()
|
void |
mISOLATED_LEXER_RULE_REF()
|
void |
mISOLATED_TOKEN_REF()
|
void |
mLABEL_REF()
|
void |
mLOCAL_ATTR()
|
void |
mRULE_SCOPE_ATTR()
|
void |
mSCOPE_INDEX_EXPR()
|
void |
mSET_ATTRIBUTE()
|
void |
mSET_DYNAMIC_SCOPE_ATTR()
|
void |
mSET_ENCLOSING_RULE_SCOPE_ATTR()
|
void |
mSET_EXPR_ATTRIBUTE()
|
void |
mSET_LOCAL_ATTR()
|
void |
mSET_RULE_SCOPE_ATTR()
|
void |
mSET_TOKEN_SCOPE_ATTR()
|
void |
mTEMPLATE_EXPR()
|
void |
mTEMPLATE_INSTANCE()
|
void |
mTEXT()
|
void |
mTOKEN_SCOPE_ATTR()
|
void |
mTokens()
|
void |
mUNKNOWN_SYNTAX()
|
void |
mWS()
|
Token |
nextToken()
|
void |
synpred1_fragment()
|
boolean |
synpred1()
|
void |
synpred10_fragment()
|
boolean |
synpred10()
|
void |
synpred11_fragment()
|
boolean |
synpred11()
|
void |
synpred12_fragment()
|
boolean |
synpred12()
|
void |
synpred13_fragment()
|
boolean |
synpred13()
|
void |
synpred14_fragment()
|
boolean |
synpred14()
|
void |
synpred15_fragment()
|
boolean |
synpred15()
|
void |
synpred16_fragment()
|
boolean |
synpred16()
|
void |
synpred17_fragment()
|
boolean |
synpred17()
|
void |
synpred18_fragment()
|
boolean |
synpred18()
|
void |
synpred19_fragment()
|
boolean |
synpred19()
|
void |
synpred2_fragment()
|
boolean |
synpred2()
|
void |
synpred20_fragment()
|
boolean |
synpred20()
|
void |
synpred21_fragment()
|
boolean |
synpred21()
|
void |
synpred22_fragment()
|
boolean |
synpred22()
|
void |
synpred24_fragment()
|
boolean |
synpred24()
|
void |
synpred25_fragment()
|
boolean |
synpred25()
|
void |
synpred26_fragment()
|
boolean |
synpred26()
|
void |
synpred3_fragment()
|
boolean |
synpred3()
|
void |
synpred4_fragment()
|
boolean |
synpred4()
|
void |
synpred5_fragment()
|
boolean |
synpred5()
|
void |
synpred6_fragment()
|
boolean |
synpred6()
|
void |
synpred7_fragment()
|
boolean |
synpred7()
|
void |
synpred8_fragment()
|
boolean |
synpred8()
|
void |
synpred9_fragment()
|
boolean |
synpred9()
|
protected StringTemplate |
template(java.lang.String name)
|
java.lang.String |
translate()
|
java.util.List |
translateAction(java.lang.String action)
|
java.util.List |
translateToChunks()
Return a list of strings and StringTemplate objects that
represent the translated action. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOCAL_ATTR
public static final int LOCAL_ATTR
- See Also:
- Constant Field Values
SET_DYNAMIC_SCOPE_ATTR
public static final int SET_DYNAMIC_SCOPE_ATTR
- See Also:
- Constant Field Values
ISOLATED_DYNAMIC_SCOPE
public static final int ISOLATED_DYNAMIC_SCOPE
- See Also:
- Constant Field Values
WS
public static final int WS
- See Also:
- Constant Field Values
UNKNOWN_SYNTAX
public static final int UNKNOWN_SYNTAX
- See Also:
- Constant Field Values
DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
public static final int DYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
- See Also:
- Constant Field Values
SCOPE_INDEX_EXPR
public static final int SCOPE_INDEX_EXPR
- See Also:
- Constant Field Values
DYNAMIC_SCOPE_ATTR
public static final int DYNAMIC_SCOPE_ATTR
- See Also:
- Constant Field Values
ISOLATED_TOKEN_REF
public static final int ISOLATED_TOKEN_REF
- See Also:
- Constant Field Values
SET_ATTRIBUTE
public static final int SET_ATTRIBUTE
- See Also:
- Constant Field Values
SET_EXPR_ATTRIBUTE
public static final int SET_EXPR_ATTRIBUTE
- See Also:
- Constant Field Values
ACTION
public static final int ACTION
- See Also:
- Constant Field Values
ERROR_X
public static final int ERROR_X
- See Also:
- Constant Field Values
TEMPLATE_INSTANCE
public static final int TEMPLATE_INSTANCE
- See Also:
- Constant Field Values
TOKEN_SCOPE_ATTR
public static final int TOKEN_SCOPE_ATTR
- See Also:
- Constant Field Values
ISOLATED_LEXER_RULE_REF
public static final int ISOLATED_LEXER_RULE_REF
- See Also:
- Constant Field Values
ESC
public static final int ESC
- See Also:
- Constant Field Values
SET_ENCLOSING_RULE_SCOPE_ATTR
public static final int SET_ENCLOSING_RULE_SCOPE_ATTR
- See Also:
- Constant Field Values
ATTR_VALUE_EXPR
public static final int ATTR_VALUE_EXPR
- See Also:
- Constant Field Values
RULE_SCOPE_ATTR
public static final int RULE_SCOPE_ATTR
- See Also:
- Constant Field Values
LABEL_REF
public static final int LABEL_REF
- See Also:
- Constant Field Values
INT
public static final int INT
- See Also:
- Constant Field Values
ARG
public static final int ARG
- See Also:
- Constant Field Values
EOF
public static final int EOF
- See Also:
- Constant Field Values
SET_LOCAL_ATTR
public static final int SET_LOCAL_ATTR
- See Also:
- Constant Field Values
TEXT
public static final int TEXT
- See Also:
- Constant Field Values
Tokens
public static final int Tokens
- See Also:
- Constant Field Values
DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
public static final int DYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
- See Also:
- Constant Field Values
SET_TOKEN_SCOPE_ATTR
public static final int SET_TOKEN_SCOPE_ATTR
- See Also:
- Constant Field Values
ERROR_SCOPED_XY
public static final int ERROR_SCOPED_XY
- See Also:
- Constant Field Values
SET_RULE_SCOPE_ATTR
public static final int SET_RULE_SCOPE_ATTR
- See Also:
- Constant Field Values
ENCLOSING_RULE_SCOPE_ATTR
public static final int ENCLOSING_RULE_SCOPE_ATTR
- See Also:
- Constant Field Values
ERROR_XY
public static final int ERROR_XY
- See Also:
- Constant Field Values
TEMPLATE_EXPR
public static final int TEMPLATE_EXPR
- See Also:
- Constant Field Values
INDIRECT_TEMPLATE_INSTANCE
public static final int INDIRECT_TEMPLATE_INSTANCE
- See Also:
- Constant Field Values
ID
public static final int ID
- See Also:
- Constant Field Values
chunks
public java.util.List chunks
ActionTranslatorLexer
public ActionTranslatorLexer(CodeGenerator generator,
java.lang.String ruleName,
GrammarAST actionAST)
ActionTranslatorLexer
public ActionTranslatorLexer(CodeGenerator generator,
java.lang.String ruleName,
antlr.Token actionToken,
int outerAltNum)
ActionTranslatorLexer
public ActionTranslatorLexer()
ActionTranslatorLexer
public ActionTranslatorLexer(CharStream input)
emit
public Token emit(int tokenType,
int line,
int charPosition,
int channel,
int start,
int stop)
translateToChunks
public java.util.List translateToChunks()
- Return a list of strings and StringTemplate objects that
represent the translated action.
translate
public java.lang.String translate()
translateAction
public java.util.List 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 StringTemplate template(java.lang.String name)
getGrammarFileName
public java.lang.String getGrammarFileName()
nextToken
public Token nextToken()
memoize
public void memoize(IntStream input,
int ruleIndex,
int ruleStartIndex)
alreadyParsedRule
public boolean alreadyParsedRule(IntStream input,
int ruleIndex)
mSET_ENCLOSING_RULE_SCOPE_ATTR
public void mSET_ENCLOSING_RULE_SCOPE_ATTR()
throws RecognitionException
- Throws:
RecognitionException
mENCLOSING_RULE_SCOPE_ATTR
public void mENCLOSING_RULE_SCOPE_ATTR()
throws RecognitionException
- Throws:
RecognitionException
mSET_TOKEN_SCOPE_ATTR
public void mSET_TOKEN_SCOPE_ATTR()
throws RecognitionException
- Throws:
RecognitionException
mTOKEN_SCOPE_ATTR
public void mTOKEN_SCOPE_ATTR()
throws RecognitionException
- Throws:
RecognitionException
mSET_RULE_SCOPE_ATTR
public void mSET_RULE_SCOPE_ATTR()
throws RecognitionException
- Throws:
RecognitionException
mRULE_SCOPE_ATTR
public void mRULE_SCOPE_ATTR()
throws RecognitionException
- Throws:
RecognitionException
mLABEL_REF
public void mLABEL_REF()
throws RecognitionException
- Throws:
RecognitionException
mISOLATED_TOKEN_REF
public void mISOLATED_TOKEN_REF()
throws RecognitionException
- Throws:
RecognitionException
mISOLATED_LEXER_RULE_REF
public void mISOLATED_LEXER_RULE_REF()
throws RecognitionException
- Throws:
RecognitionException
mSET_LOCAL_ATTR
public void mSET_LOCAL_ATTR()
throws RecognitionException
- Throws:
RecognitionException
mLOCAL_ATTR
public void mLOCAL_ATTR()
throws RecognitionException
- Throws:
RecognitionException
mSET_DYNAMIC_SCOPE_ATTR
public void mSET_DYNAMIC_SCOPE_ATTR()
throws RecognitionException
- Throws:
RecognitionException
mDYNAMIC_SCOPE_ATTR
public void mDYNAMIC_SCOPE_ATTR()
throws RecognitionException
- Throws:
RecognitionException
mERROR_SCOPED_XY
public void mERROR_SCOPED_XY()
throws RecognitionException
- Throws:
RecognitionException
mDYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR
public void mDYNAMIC_NEGATIVE_INDEXED_SCOPE_ATTR()
throws RecognitionException
- Throws:
RecognitionException
mDYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR
public void mDYNAMIC_ABSOLUTE_INDEXED_SCOPE_ATTR()
throws RecognitionException
- Throws:
RecognitionException
mSCOPE_INDEX_EXPR
public void mSCOPE_INDEX_EXPR()
throws RecognitionException
- Throws:
RecognitionException
mISOLATED_DYNAMIC_SCOPE
public void mISOLATED_DYNAMIC_SCOPE()
throws RecognitionException
- Throws:
RecognitionException
mTEMPLATE_INSTANCE
public void mTEMPLATE_INSTANCE()
throws RecognitionException
- Throws:
RecognitionException
mINDIRECT_TEMPLATE_INSTANCE
public void mINDIRECT_TEMPLATE_INSTANCE()
throws RecognitionException
- Throws:
RecognitionException
mARG
public void mARG()
throws RecognitionException
- Throws:
RecognitionException
mSET_EXPR_ATTRIBUTE
public void mSET_EXPR_ATTRIBUTE()
throws RecognitionException
- Throws:
RecognitionException
mSET_ATTRIBUTE
public void mSET_ATTRIBUTE()
throws RecognitionException
- Throws:
RecognitionException
mATTR_VALUE_EXPR
public void mATTR_VALUE_EXPR()
throws RecognitionException
- Throws:
RecognitionException
mTEMPLATE_EXPR
public void mTEMPLATE_EXPR()
throws RecognitionException
- Throws:
RecognitionException
mACTION
public void mACTION()
throws RecognitionException
- Throws:
RecognitionException
mESC
public void mESC()
throws RecognitionException
- Throws:
RecognitionException
mERROR_XY
public void mERROR_XY()
throws RecognitionException
- Throws:
RecognitionException
mERROR_X
public void mERROR_X()
throws RecognitionException
- Throws:
RecognitionException
mUNKNOWN_SYNTAX
public void mUNKNOWN_SYNTAX()
throws RecognitionException
- Throws:
RecognitionException
mTEXT
public void mTEXT()
throws RecognitionException
- Throws:
RecognitionException
mID
public void mID()
throws RecognitionException
- Throws:
RecognitionException
mINT
public void mINT()
throws RecognitionException
- Throws:
RecognitionException
mWS
public void mWS()
throws RecognitionException
- Throws:
RecognitionException
mTokens
public void mTokens()
throws RecognitionException
- Throws:
RecognitionException
synpred1_fragment
public void synpred1_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred2_fragment
public void synpred2_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred3_fragment
public void synpred3_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred4_fragment
public void synpred4_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred5_fragment
public void synpred5_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred6_fragment
public void synpred6_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred7_fragment
public void synpred7_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred8_fragment
public void synpred8_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred9_fragment
public void synpred9_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred10_fragment
public void synpred10_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred11_fragment
public void synpred11_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred12_fragment
public void synpred12_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred13_fragment
public void synpred13_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred14_fragment
public void synpred14_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred15_fragment
public void synpred15_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred16_fragment
public void synpred16_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred17_fragment
public void synpred17_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred18_fragment
public void synpred18_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred19_fragment
public void synpred19_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred20_fragment
public void synpred20_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred21_fragment
public void synpred21_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred22_fragment
public void synpred22_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred24_fragment
public void synpred24_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred25_fragment
public void synpred25_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred26_fragment
public void synpred26_fragment()
throws RecognitionException
- Throws:
RecognitionException
synpred25
public boolean synpred25()
synpred7
public boolean synpred7()
synpred14
public boolean synpred14()
synpred15
public boolean synpred15()
synpred22
public boolean synpred22()
synpred12
public boolean synpred12()
synpred4
public boolean synpred4()
synpred9
public boolean synpred9()
synpred1
public boolean synpred1()
synpred20
public boolean synpred20()
synpred17
public boolean synpred17()
synpred2
public boolean synpred2()
synpred18
public boolean synpred18()
synpred3
public boolean synpred3()
synpred11
public boolean synpred11()
synpred26
public boolean synpred26()
synpred8
public boolean synpred8()
synpred10
public boolean synpred10()
synpred21
public boolean synpred21()
synpred16
public boolean synpred16()
synpred19
public boolean synpred19()
synpred24
public boolean synpred24()
synpred5
public boolean synpred5()
synpred6
public boolean synpred6()
synpred13
public boolean synpred13()