Support StringTemplate, ANTLR Project by making a donation! Terence often pays for things like the antlr.org server, conference travel, and this site design (that alone cost US$1000). Buy him a beer and pizza remotely ;)
|
ConditionalExpr
org.antlr.stringtemplate.language
Class ConditionalExpr
java.lang.Object
org.antlr.stringtemplate.language.Expr
org.antlr.stringtemplate.language.ASTExpr
org.antlr.stringtemplate.language.ConditionalExpr
- public class ConditionalExpr
- extends ASTExpr
A conditional reference to an embedded subtemplate.
| 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, exprTree, formatString, MAP_KEY_VALUE, nullValue, options, separatorString, supportedOptions, wrapString |
| 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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
subtemplate
StringTemplate subtemplate
elseIfSubtemplates
java.util.List elseIfSubtemplates
elseSubtemplate
StringTemplate elseSubtemplate
ConditionalExpr
public ConditionalExpr(StringTemplate enclosingTemplate,
antlr.collections.AST tree)
setSubtemplate
public void setSubtemplate(StringTemplate subtemplate)
addElseIfSubtemplate
public void addElseIfSubtemplate(ASTExpr conditionalTree,
StringTemplate subtemplate)
getSubtemplate
public StringTemplate getSubtemplate()
getElseSubtemplate
public StringTemplate getElseSubtemplate()
setElseSubtemplate
public void setElseSubtemplate(StringTemplate elseSubtemplate)
write
public int write(StringTemplate self,
StringTemplateWriter out)
throws java.io.IOException
- 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 class ASTExpr
- Throws:
java.io.IOException
writeSubTemplate
protected int writeSubTemplate(StringTemplate self,
StringTemplateWriter out,
StringTemplate subtemplate)
throws java.io.IOException
- Throws:
java.io.IOException
|