antlr.actions.cpp

Class ActionLexer

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)
Field Summary
protected RuleBlockcurrentRule
protected CodeGeneratorgenerator
protected intlineOffset
ActionTransInfotransInfo
static BitSet_tokenSet_0
static BitSet_tokenSet_1
static BitSet_tokenSet_10
static BitSet_tokenSet_11
static BitSet_tokenSet_12
static BitSet_tokenSet_13
static BitSet_tokenSet_14
static BitSet_tokenSet_15
static BitSet_tokenSet_16
static BitSet_tokenSet_17
static BitSet_tokenSet_18
static BitSet_tokenSet_19
static BitSet_tokenSet_2
static BitSet_tokenSet_20
static BitSet_tokenSet_21
static BitSet_tokenSet_22
static BitSet_tokenSet_23
static BitSet_tokenSet_24
static BitSet_tokenSet_25
static BitSet_tokenSet_26
static BitSet_tokenSet_3
static BitSet_tokenSet_4
static BitSet_tokenSet_5
static BitSet_tokenSet_6
static BitSet_tokenSet_7
static BitSet_tokenSet_8
static BitSet_tokenSet_9
Constructor Summary
ActionLexer(String s, RuleBlock currentRule, CodeGenerator generator, ActionTransInfo transInfo)
ActionLexer(InputStream in)
ActionLexer(Reader in)
ActionLexer(InputBuffer ib)
ActionLexer(LexerSharedInputState state)
Method Summary
voidmACTION(boolean _createToken)
protected voidmARG(boolean _createToken)
protected voidmAST_CONSTRUCTOR(boolean _createToken)
protected voidmAST_CTOR_ELEMENT(boolean _createToken)
The arguments of a #[...] constructor are text, token type, or a tree.
protected voidmAST_ITEM(boolean _createToken)
protected voidmCHAR(boolean _createToken)
protected voidmCOMMENT(boolean _createToken)
protected voidmDIGIT(boolean _createToken)
protected voidmESC(boolean _createToken)
protected voidmID(boolean _createToken)
protected booleanmID_ELEMENT(boolean _createToken)
An ID_ELEMENT can be a func call, array ref, simple var, or AST label ref.
protected voidmINT(boolean _createToken)
protected voidmINT_OR_FLOAT(boolean _createToken)
protected voidmML_COMMENT(boolean _createToken)
protected voidmSL_COMMENT(boolean _createToken)
protected voidmSTRING(boolean _createToken)
protected voidmSTUFF(boolean _createToken)
stuff in between #(...) and #id items Allow the escaping of the # for C preprocessor stuff.
protected voidmTEXT_ARG(boolean _createToken)
protected voidmTEXT_ARG_ELEMENT(boolean _createToken)
protected voidmTEXT_ARG_ID_ELEMENT(boolean _createToken)
protected voidmTEXT_ITEM(boolean _createToken)
protected voidmTREE(boolean _createToken)
protected voidmTREE_ELEMENT(boolean _createToken)
protected voidmVAR_ASSIGN(boolean _createToken)
protected voidmWS(boolean _createToken)
TokennextToken()
voidreportError(RecognitionException e)
voidreportError(String s)
voidreportWarning(String s)
voidsetLineOffset(int lineOffset)
voidsetTool(Tool tool)

Field Detail

currentRule

protected RuleBlock currentRule

generator

protected CodeGenerator generator

lineOffset

protected int lineOffset

transInfo

ActionTransInfo transInfo

_tokenSet_0

public static final BitSet _tokenSet_0

_tokenSet_1

public static final BitSet _tokenSet_1

_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_2

public static final BitSet _tokenSet_2

_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

_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

Constructor Detail

ActionLexer

public ActionLexer(String s, RuleBlock currentRule, CodeGenerator generator, ActionTransInfo transInfo)

ActionLexer

public ActionLexer(InputStream in)

ActionLexer

public ActionLexer(Reader in)

ActionLexer

public ActionLexer(InputBuffer ib)

ActionLexer

public ActionLexer(LexerSharedInputState state)

Method Detail

mACTION

public final void mACTION(boolean _createToken)

mARG

protected final void mARG(boolean _createToken)

mAST_CONSTRUCTOR

protected final void mAST_CONSTRUCTOR(boolean _createToken)

mAST_CTOR_ELEMENT

protected final void mAST_CTOR_ELEMENT(boolean _createToken)
The arguments of a #[...] constructor are text, token type, or a tree.

mAST_ITEM

protected final void mAST_ITEM(boolean _createToken)

mCHAR

protected final void mCHAR(boolean _createToken)

mCOMMENT

protected final void mCOMMENT(boolean _createToken)

mDIGIT

protected final void mDIGIT(boolean _createToken)

mESC

protected final void mESC(boolean _createToken)

mID

protected final void mID(boolean _createToken)

mID_ELEMENT

protected final boolean mID_ELEMENT(boolean _createToken)
An ID_ELEMENT can be a func call, array ref, simple var, or AST label ref.

mINT

protected final void mINT(boolean _createToken)

mINT_OR_FLOAT

protected final void mINT_OR_FLOAT(boolean _createToken)

mML_COMMENT

protected final void mML_COMMENT(boolean _createToken)

mSL_COMMENT

protected final void mSL_COMMENT(boolean _createToken)

mSTRING

protected final void mSTRING(boolean _createToken)

mSTUFF

protected final void mSTUFF(boolean _createToken)
stuff in between #(...) and #id items Allow the escaping of the # for C preprocessor stuff.

mTEXT_ARG

protected final void mTEXT_ARG(boolean _createToken)

mTEXT_ARG_ELEMENT

protected final void mTEXT_ARG_ELEMENT(boolean _createToken)

mTEXT_ARG_ID_ELEMENT

protected final void mTEXT_ARG_ID_ELEMENT(boolean _createToken)

mTEXT_ITEM

protected final void mTEXT_ITEM(boolean _createToken)

mTREE

protected final void mTREE(boolean _createToken)

mTREE_ELEMENT

protected final void mTREE_ELEMENT(boolean _createToken)

mVAR_ASSIGN

protected final void mVAR_ASSIGN(boolean _createToken)

mWS

protected final void mWS(boolean _createToken)

nextToken

public Token nextToken()

reportError

public void reportError(RecognitionException e)

reportError

public void reportError(String s)

reportWarning

public void reportWarning(String s)

setLineOffset

public void setLineOffset(int lineOffset)

setTool

public void setTool(Tool tool)