Class ConditionalExpr
java.lang.Object
org.antlr.stringtemplate.language.Expr
org.antlr.stringtemplate.language.ASTExpr
org.antlr.stringtemplate.language.ConditionalExpr
A conditional reference to an embedded subtemplate.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.antlr.stringtemplate.language.ASTExpr
DEFAULT_ATTRIBUTE_NAME, DEFAULT_ATTRIBUTE_NAME_DEPRECATED, DEFAULT_INDEX_VARIABLE_NAME, DEFAULT_INDEX0_VARIABLE_NAME, DEFAULT_MAP_KEY_NAME, DEFAULT_MAP_VALUE_NAME, defaultOptionValues, EMPTY_OPTION, MAP_KEY_VALUE, MISSING, supportedOptions
Fields inherited from class org.antlr.stringtemplate.language.Expr
enclosingTemplate, indentation
-
Constructor Summary
ConstructorsConstructorDescriptionConditionalExpr
(StringTemplate enclosingTemplate, antlr.collections.AST tree) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addElseIfSubtemplate
(ASTExpr conditionalTree, StringTemplate subtemplate) void
setElseSubtemplate
(StringTemplate elseSubtemplate) void
setSubtemplate
(StringTemplate subtemplate) int
write
(StringTemplate self, StringTemplateWriter out) To write out the value of a condition expr, invoke the evaluator in eval.g to walk the condition tree computing the boolean value.protected int
writeSubTemplate
(StringTemplate self, StringTemplateWriter out, StringTemplate subtemplate) Methods inherited from class org.antlr.stringtemplate.language.ASTExpr
accessField, add, applyListOfAlternatingTemplates, applyTemplateToListOfAttributes, convertAnythingIteratableToIterator, convertAnythingToIterator, convertArrayToList, evaluateArguments, evaluateExpression, first, getAST, getMethod, getObjectProperty, getOption, getTemplateInclude, handleExprOptions, invokeMethod, last, length, rawGetObjectProperty, rest, setSoleFormalArgumentToIthValue, strip, testAttributeTrue, toString, trunc, write, writeAttribute, writeIterableValue, writePOJO, writeTemplate
Methods inherited from class org.antlr.stringtemplate.language.Expr
getEnclosingTemplate, getIndentation, setIndentation
-
Constructor Details
-
ConditionalExpr
-
-
Method Details
-
setSubtemplate
-
addElseIfSubtemplate
-
getSubtemplate
-
getElseSubtemplate
-
setElseSubtemplate
-
write
To write out the value of a condition expr, invoke the evaluator in eval.g to walk the condition tree computing the boolean value. If result is true, then write subtemplate.- Overrides:
write
in classASTExpr
- Throws:
IOException
-
writeSubTemplate
protected int writeSubTemplate(StringTemplate self, StringTemplateWriter out, StringTemplate subtemplate) throws IOException - Throws:
IOException
-