org.antlr.stringtemplate.language
Class ConditionalExpr

java.lang.Object
  extended by org.antlr.stringtemplate.language.Expr
      extended by org.antlr.stringtemplate.language.ASTExpr
          extended by org.antlr.stringtemplate.language.ConditionalExpr

public class ConditionalExpr
extends ASTExpr

A conditional reference to an embedded subtemplate.


Field Summary
 
Fields inherited from class org.antlr.stringtemplate.language.ASTExpr
DEFAULT_ATTRIBUTE_NAME, DEFAULT_ATTRIBUTE_NAME_DEPRECATED, DEFAULT_INDEX_VARIABLE_NAME, DEFAULT_MAP_VALUE_NAME, REFLECTION_ATTRIBUTES
 
Fields inherited from class org.antlr.stringtemplate.language.Expr
enclosingTemplate, indentation
 
Constructor Summary
ConditionalExpr(StringTemplate enclosingTemplate, antlr.collections.AST tree)
           
 
Method Summary
 StringTemplate getElseSubtemplate()
           
 StringTemplate getSubtemplate()
           
 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.
 
Methods inherited from class org.antlr.stringtemplate.language.ASTExpr
add, applyListOfAlternatingTemplates, applyTemplateToListOfAttributes, computeSeparator, convertArrayToList, evaluateArguments, first, getAST, getObjectProperty, getTemplateInclude, isValidMapInstance, isValidReturnTypeMapInstance, last, rest, setSoleFormalArgumentToIthValue, testAttributeTrue, write, writeAttribute
 
Methods inherited from class org.antlr.stringtemplate.language.Expr
getEnclosingTemplate, getIndentation, setIndentation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConditionalExpr

public ConditionalExpr(StringTemplate enclosingTemplate,
                       antlr.collections.AST tree)
Method Detail

setSubtemplate

public void setSubtemplate(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


Copyright ? 2006-2009 Terence Parr