Class ActionEvaluator
java.lang.Object
antlr.TreeParser
org.antlr.stringtemplate.language.ActionEvaluator
- All Implemented Interfaces:
ActionEvaluatorTokenTypes
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]
static final antlr.collections.impl.BitSet
protected ASTExpr
protected StringTemplateWriter
protected StringTemplate
Fields inherited from class antlr.TreeParser
_retTree, astFactory, ASTNULL, inputState, returnAST, tokenNames, traceDepth
Fields inherited from interface org.antlr.stringtemplate.language.ActionEvaluatorTokenTypes
ANONYMOUS_TEMPLATE, APPLY, ARGS, ASSIGN, COLON, COMMA, CONDITIONAL, DOT, DOTDOTDOT, EOF, ESC_CHAR, FUNCTION, ID, INCLUDE, INT, LBRACK, LIST, LITERAL_elseif, LITERAL_first, LITERAL_last, LITERAL_length, LITERAL_rest, LITERAL_strip, LITERAL_super, LITERAL_trunc, LPAREN, MULTI_APPLY, NESTED_ANONYMOUS_TEMPLATE, NOT, NOTHING, NULL_TREE_LOOKAHEAD, PLUS, RBRACK, RPAREN, SEMI, SINGLEVALUEARG, STRING, TEMPLATE, TEMPLATE_ARGS, VALUE, WS, WS_CHAR
-
Constructor Summary
ConstructorsConstructorDescriptionActionEvaluator
(StringTemplate self, ASTExpr chunk, StringTemplateWriter out) Create an evaluator using attributes from self -
Method Summary
Modifier and TypeMethodDescriptionfinal int
action
(antlr.collections.AST _t) final Map
argList
(antlr.collections.AST _t, StringTemplate embedded, Map initialContext) self is assumed to be the enclosing context as foo(x=y) must find y in the template that encloses the ref to foo(x=y).final void
argumentAssignment
(antlr.collections.AST _t, StringTemplate embedded, Map argumentContext) final Object
attribute
(antlr.collections.AST _t) final Object
expr
(antlr.collections.AST _t) final Object
function
(antlr.collections.AST _t) final Object
ifAtom
(antlr.collections.AST _t) final boolean
ifCondition
(antlr.collections.AST _t) final Object
list
(antlr.collections.AST _t) create a new list of expressions as a new multi-value attributevoid
reportError
(antlr.RecognitionException e) final Object
singleFunctionArg
(antlr.collections.AST _t) final void
singleTemplateArg
(antlr.collections.AST _t, StringTemplate embedded, Map argumentContext) final void
final Object
templateApplication
(antlr.collections.AST _t) Apply template(s) to an attribute; can be applied to another apply result.final Object
templateInclude
(antlr.collections.AST _t) Methods inherited from class antlr.TreeParser
getAST, getASTFactory, getTokenName, getTokenNames, match, match, matchNot, panic, reportError, reportWarning, setASTFactory, setASTNodeClass, setASTNodeType, traceIn, traceIndent, traceOut
-
Field Details
-
self
-
out
-
chunk
-
_tokenNames
-
_tokenSet_0
public static final antlr.collections.impl.BitSet _tokenSet_0
-
-
Constructor Details
-
ActionEvaluator
Create an evaluator using attributes from self -
ActionEvaluator
public ActionEvaluator()
-
-
Method Details
-
reportError
public void reportError(antlr.RecognitionException e) - Overrides:
reportError
in classantlr.TreeParser
-
action
public final int action(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
expr
- Throws:
antlr.RecognitionException
-
templateApplication
Apply template(s) to an attribute; can be applied to another apply result.- Throws:
antlr.RecognitionException
-
attribute
- Throws:
antlr.RecognitionException
-
templateInclude
- Throws:
antlr.RecognitionException
-
function
- Throws:
antlr.RecognitionException
-
list
create a new list of expressions as a new multi-value attribute- Throws:
antlr.RecognitionException
-
template
public final void template(antlr.collections.AST _t, Vector templatesToApply) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
singleFunctionArg
- Throws:
antlr.RecognitionException
-
ifCondition
public final boolean ifCondition(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
ifAtom
- Throws:
antlr.RecognitionException
-
argList
public final Map argList(antlr.collections.AST _t, StringTemplate embedded, Map initialContext) throws antlr.RecognitionException self is assumed to be the enclosing context as foo(x=y) must find y in the template that encloses the ref to foo(x=y). We must pass in the embedded template (the one invoked) so we can check formal args in rawSetArgumentAttribute.- Throws:
antlr.RecognitionException
-
argumentAssignment
public final void argumentAssignment(antlr.collections.AST _t, StringTemplate embedded, Map argumentContext) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
singleTemplateArg
public final void singleTemplateArg(antlr.collections.AST _t, StringTemplate embedded, Map argumentContext) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-