antlr.actions.cpp
Class ActionLexer
java.lang.Object
antlr.CharScanner
antlr.actions.cpp.ActionLexer
- All Implemented Interfaces:
- ActionLexerTokenTypes, TokenStream
- public class ActionLexer
- extends CharScanner
- implements 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)
Fields inherited from interface antlr.actions.cpp.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 |
Methods inherited from class antlr.CharScanner |
append, append, commit, consume, consumeUntil, consumeUntil, getCaseSensitive, getCaseSensitiveLiterals, getColumn, getCommitToPath, getFilename, getInputBuffer, getInputState, getLine, getTabSize, getText, getTokenObject, LA, 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 |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_tokenSet_0
public static final BitSet _tokenSet_0
_tokenSet_1
public static final BitSet _tokenSet_1
_tokenSet_2
public static final BitSet _tokenSet_2
_tokenSet_3
public static final BitSet _tokenSet_3
_tokenSet_4
public static final BitSet _tokenSet_4
_tokenSet_5
public static final BitSet _tokenSet_5
_tokenSet_6
public static final BitSet _tokenSet_6
_tokenSet_7
public static final BitSet _tokenSet_7
_tokenSet_8
public static final BitSet _tokenSet_8
_tokenSet_9
public static final BitSet _tokenSet_9
_tokenSet_10
public static final BitSet _tokenSet_10
_tokenSet_11
public static final BitSet _tokenSet_11
_tokenSet_12
public static final BitSet _tokenSet_12
_tokenSet_13
public static final BitSet _tokenSet_13
_tokenSet_14
public static final BitSet _tokenSet_14
_tokenSet_15
public static final BitSet _tokenSet_15
_tokenSet_16
public static final BitSet _tokenSet_16
_tokenSet_17
public static final BitSet _tokenSet_17
_tokenSet_18
public static final BitSet _tokenSet_18
_tokenSet_19
public static final BitSet _tokenSet_19
_tokenSet_20
public static final BitSet _tokenSet_20
_tokenSet_21
public static final BitSet _tokenSet_21
_tokenSet_22
public static final BitSet _tokenSet_22
_tokenSet_23
public static final BitSet _tokenSet_23
_tokenSet_24
public static final BitSet _tokenSet_24
_tokenSet_25
public static final BitSet _tokenSet_25
_tokenSet_26
public static final BitSet _tokenSet_26
ActionLexer
public ActionLexer(java.lang.String s,
RuleBlock currentRule,
CodeGenerator generator,
ActionTransInfo transInfo)
ActionLexer
public ActionLexer(java.io.InputStream in)
ActionLexer
public ActionLexer(java.io.Reader in)
ActionLexer
public ActionLexer(InputBuffer ib)
ActionLexer
public ActionLexer(LexerSharedInputState state)
setLineOffset
public void setLineOffset(int lineOffset)
setTool
public void setTool(Tool tool)
reportError
public void reportError(RecognitionException e)
- Description copied from class:
CharScanner
- Parser error-reporting function can be overridden in subclass
- Overrides:
reportError
in class CharScanner
reportError
public void reportError(java.lang.String s)
- Description copied from class:
CharScanner
- Parser error-reporting function can be overridden in subclass
- Overrides:
reportError
in class CharScanner
reportWarning
public void reportWarning(java.lang.String s)
- Description copied from class:
CharScanner
- Parser warning-reporting function can be overridden in subclass
- Overrides:
reportWarning
in class CharScanner
nextToken
public Token nextToken()
throws TokenStreamException
- Specified by:
nextToken
in interface TokenStream
- Throws:
TokenStreamException
mACTION
public final void mACTION(boolean _createToken)
throws RecognitionException,
CharStreamException,
TokenStreamException
- Throws:
RecognitionException
CharStreamException
TokenStreamException