Package antlr.actions.csharp
Class ActionLexer
java.lang.Object
antlr.CharScanner
antlr.actions.csharp.ActionLexer
- All Implemented Interfaces:
ActionLexerTokenTypes,TokenStream
Perform the following translations:
AST related translations
## -> currentRule_AST
#(x,y,z) -> codeGenerator.getASTCreateString(vector-of(x,y,z))
#[x] -> codeGenerator.getASTCreateString(x)
#x -> codeGenerator.mapTreeId(x)
Inside context of #(...), you can ref (x,y,z), [x], and x as shortcuts.
Text related translations
$append(x) -> text.append(x)
$setText(x) -> text.setLength(_begin); text.append(x)
$getText -> new String(text.getBuffer(),_begin,text.length()-_begin)
$setToken(x) -> _token = x
$setType(x) -> _ttype = x
$FOLLOW(r) -> FOLLOW set name for rule r (optional arg)
$FIRST(r) -> FIRST set name for rule r (optional arg)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetstatic final BitSetprotected RuleBlockprotected CodeGeneratorprotected int(package private) ActionTransInfoFields inherited from class antlr.CharScanner
_returnToken, caseSensitive, caseSensitiveLiterals, commitToPath, EOF_CHAR, hashString, inputState, literals, saveConsumedInput, tabsize, text, tokenObjectClass, traceDepthFields inherited from interface antlr.actions.csharp.ActionLexerTokenTypes
ACTION, ARG, AST_CONSTRUCTOR, AST_CTOR_ELEMENT, AST_ITEM, CHAR, COMMENT, DIGIT, EOF, ESC, ID, ID_ELEMENT, INT, INT_OR_FLOAT, ML_COMMENT, NULL_TREE_LOOKAHEAD, SL_COMMENT, STRING, STUFF, TEXT_ARG, TEXT_ARG_ELEMENT, TEXT_ARG_ID_ELEMENT, TEXT_ITEM, TREE, TREE_ELEMENT, VAR_ASSIGN, WS -
Constructor Summary
ConstructorsConstructorDescriptionActionLexer(LexerSharedInputState state) ActionLexer(Reader in) ActionLexer(String s, RuleBlock currentRule, CodeGenerator generator, ActionTransInfo transInfo) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidmACTION(boolean _createToken) protected final voidmARG(boolean _createToken) protected final voidmAST_CONSTRUCTOR(boolean _createToken) protected final voidmAST_CTOR_ELEMENT(boolean _createToken) The arguments of a #[...] constructor are text, token type, or a tree.protected final voidmAST_ITEM(boolean _createToken) protected final voidmCHAR(boolean _createToken) protected final voidmCOMMENT(boolean _createToken) protected final voidmDIGIT(boolean _createToken) protected final voidmESC(boolean _createToken) protected final voidmID(boolean _createToken) protected final booleanmID_ELEMENT(boolean _createToken) An ID_ELEMENT can be a func call, array ref, simple var, or AST label ref.protected final voidmINT(boolean _createToken) protected final voidmINT_OR_FLOAT(boolean _createToken) protected final voidmML_COMMENT(boolean _createToken) protected final voidmSL_COMMENT(boolean _createToken) protected final voidmSTRING(boolean _createToken) protected final voidmSTUFF(boolean _createToken) stuff in between #(...) and #id items Allow the escaping of the # for C# preprocessor stuff.protected final voidmTEXT_ARG(boolean _createToken) protected final voidmTEXT_ARG_ELEMENT(boolean _createToken) protected final voidmTEXT_ARG_ID_ELEMENT(boolean _createToken) protected final voidmTEXT_ITEM(boolean _createToken) protected final voidmTREE(boolean _createToken) protected final voidmTREE_ELEMENT(boolean _createToken) protected final voidmVAR_ASSIGN(boolean _createToken) protected final voidmWS(boolean _createToken) voidParser error-reporting function can be overridden in subclassvoidParser error-reporting function can be overridden in subclassvoidParser warning-reporting function can be overridden in subclassvoidsetLineOffset(int lineOffset) voidMethods inherited from class antlr.CharScanner
append, append, commit, consume, consumeUntil, consumeUntil, getCaseSensitive, getCaseSensitiveLiterals, getColumn, getCommitToPath, getFilename, getInputBuffer, getInputState, getLine, getTabSize, getText, getTokenObject, LA, makeToken, mark, match, match, match, matchNot, matchRange, newline, panic, panic, resetText, rewind, setCaseSensitive, setColumn, setCommitToPath, setFilename, setInputState, setLine, setTabSize, setText, setTokenObjectClass, tab, testLiteralsTable, testLiteralsTable, toLower, traceIn, traceIndent, traceOut, uponEOF
-
Field Details
-
currentRule
-
generator
-
lineOffset
protected int lineOffset -
transInfo
ActionTransInfo transInfo -
_tokenSet_0
-
_tokenSet_1
-
_tokenSet_2
-
_tokenSet_3
-
_tokenSet_4
-
_tokenSet_5
-
_tokenSet_6
-
_tokenSet_7
-
_tokenSet_8
-
_tokenSet_9
-
_tokenSet_10
-
_tokenSet_11
-
_tokenSet_12
-
_tokenSet_13
-
_tokenSet_14
-
_tokenSet_15
-
_tokenSet_16
-
_tokenSet_17
-
_tokenSet_18
-
_tokenSet_19
-
_tokenSet_20
-
_tokenSet_21
-
_tokenSet_22
-
_tokenSet_23
-
_tokenSet_24
-
_tokenSet_25
-
_tokenSet_26
-
-
Constructor Details
-
ActionLexer
public ActionLexer(String s, RuleBlock currentRule, CodeGenerator generator, ActionTransInfo transInfo) -
ActionLexer
-
ActionLexer
-
ActionLexer
-
-
Method Details
-
setLineOffset
public void setLineOffset(int lineOffset) -
setTool
-
reportError
Description copied from class:CharScannerParser error-reporting function can be overridden in subclass- Overrides:
reportErrorin classCharScanner
-
reportError
Description copied from class:CharScannerParser error-reporting function can be overridden in subclass- Overrides:
reportErrorin classCharScanner
-
reportWarning
Description copied from class:CharScannerParser warning-reporting function can be overridden in subclass- Overrides:
reportWarningin classCharScanner
-
nextToken
- Specified by:
nextTokenin interfaceTokenStream- Throws:
TokenStreamException
-
mACTION
public final void mACTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mSTUFF
protected final void mSTUFF(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException stuff in between #(...) and #id items Allow the escaping of the # for C# preprocessor stuff. -
mAST_ITEM
protected final void mAST_ITEM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mTEXT_ITEM
protected final void mTEXT_ITEM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mCOMMENT
protected final void mCOMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mSTRING
protected final void mSTRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mCHAR
protected final void mCHAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mTREE
protected final void mTREE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mWS
protected final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mID
protected final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mVAR_ASSIGN
protected final void mVAR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mAST_CONSTRUCTOR
protected final void mAST_CONSTRUCTOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mTEXT_ARG
protected final void mTEXT_ARG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mTREE_ELEMENT
protected final void mTREE_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mID_ELEMENT
protected final boolean mID_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException An ID_ELEMENT can be a func call, array ref, simple var, or AST label ref. -
mAST_CTOR_ELEMENT
protected final void mAST_CTOR_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException The arguments of a #[...] constructor are text, token type, or a tree. -
mINT
protected final void mINT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mARG
protected final void mARG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mTEXT_ARG_ELEMENT
protected final void mTEXT_ARG_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mTEXT_ARG_ID_ELEMENT
protected final void mTEXT_ARG_ID_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mINT_OR_FLOAT
protected final void mINT_OR_FLOAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mSL_COMMENT
protected final void mSL_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mML_COMMENT
protected final void mML_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mESC
protected final void mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException -
mDIGIT
protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException
-