anvil.script.statements
Class VariableStatement

java.lang.Object
  |
  +--anvil.script.statements.Statement
        |
        +--anvil.script.statements.VariableStatement
All Implemented Interfaces:
Type, VariableType
Direct Known Subclasses:
LocalVariableStatement, MemberVariableStatement, StaticVariableStatement

public abstract class VariableStatement
extends Statement
implements VariableType

class VariableType


Field Summary
protected  java.lang.StringBuffer _content
           
protected  Location _contentlocation
           
protected  Doc _document
           
protected  Expression _expression
           
protected  java.lang.Boolean _hasconstantinit
           
protected  java.lang.String _name
           
protected  DefinitionStatement _parent
           
protected  Scope[] _parents
           
protected  boolean _private
           
protected  Any _value
           
 
Fields inherited from class anvil.script.statements.Statement
CONTENT_COMPRESS, CONTENT_PACK, CONTENT_PRESERVE, CONTENT_PROCESSING, CONTENT_SILENT, DEFAULT_NAMESPACE, EMPTY, ST_ASSERT, ST_BLOCK, ST_BREAK, ST_CALL, ST_CASE, ST_CATCH, ST_CDATA, ST_CLASS, ST_COMPRESS, ST_CONST, ST_CONTINUE, ST_CUSTOM_TAG, ST_DEFAULT, ST_DO, ST_DOCUMENT, ST_ELSE, ST_ELSEIF, ST_ENDCASE, ST_ENDCLASS, ST_ENDCONST, ST_ENDDEFAULT, ST_ENDEVAL, ST_ENDFOR, ST_ENDFOREACH, ST_ENDFUNCTION, ST_ENDIF, ST_ENDINNER, ST_ENDMODULE, ST_ENDNAMESPACE, ST_ENDOUTER, ST_ENDREPLACE, ST_ENDSWITCH, ST_ENDVAR, ST_ENDWHILE, ST_EVAL, ST_EXIT, ST_FINALLY, ST_FOR, ST_FOREACH, ST_FUNCTION, ST_IF, ST_IMPLICIT_BLOCK, ST_IMPORT, ST_INNER, ST_INTERFACE, ST_INVALID, ST_INVOKE, ST_MODULE, ST_NAMESPACE, ST_NONE, ST_OUTER, ST_PACK, ST_PRESERVE, ST_PRINT, ST_REPLACE, ST_RETURN, ST_SILENT, ST_SWITCH, ST_SYNCHRONIZED, ST_TAG, ST_THROW, ST_TRY, ST_VAR, ST_WHILE, ST_YIELD
 
Fields inherited from interface anvil.script.Type
CLASS, CONSTANT_VARIABLE, CONSTRUCTOR, FUNCTION, FUNCTION_PARAMETER, GLOBAL_NAMESPACE, IMPORT, INTERFACE, INTERFACE_METHOD, LOCAL_VARIABLE, MEMBER_VARIABLE, METHOD, MODULE, NAMESPACE, SCOPE0, STATIC_VARIABLE, SYSTEM_NAMESPACE, TYPE_NAMES
 
Constructor Summary
VariableStatement(DefinitionStatement parent, java.lang.String name, Expression expr, Modifiers mods)
           
 
Method Summary
 void check(ErrorListener context)
           
abstract  void compile(ByteCompiler context)
           
 Expression createInitializer()
           
 Expression createStaticInitializer()
           
 Doc getDocument()
           
 Expression getExpression()
           
 java.lang.String getName()
           
 Scope getParent()
           
 Scope[] getParents()
           
 Statement getParentStatement()
           
 java.lang.String getQualifiedName()
           
abstract  int getType()
           
abstract  int getTypeRef(ConstantPool pool)
           
 Any getValue()
           
 boolean hasConstantInitializer()
           
 boolean isPrivate()
           
 void onCharacters(TemplateParser parser, java.lang.String cdata)
           
 void setExpression(Expression expr)
           
 Any setValue(Any value)
           
 java.lang.String toString()
           
 int typeOf()
           
 
Methods inherited from class anvil.script.statements.Statement
addChild, allowBreak, allowContinue, allowLabel, allowYield, callFinalizer, compress, eliminate, getBlockStatement, getCatchStatement, getChildStatement, getClassStatement, getContentState, getDefinitionStatement, getFunctionStatement, getInterfaceStatement, getLabelDepth, getLabeled, getLocation, getModuleStatement, getScopeStatement, getStaticContent, getSwitch, getTag, getTagId, getTypeRef, hasEnd, hasStaticContent, importExternals, isBlocked, isDeclared, isStaticRegion, lookupAnyDeclaration, name, onProcessingInstruction, onTag, pack, parse, parseLabel, setChildStatement, setLocation, setParentStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_parent

protected DefinitionStatement _parent

_parents

protected Scope[] _parents

_private

protected boolean _private

_name

protected java.lang.String _name

_expression

protected Expression _expression

_document

protected Doc _document

_hasconstantinit

protected java.lang.Boolean _hasconstantinit

_value

protected Any _value

_content

protected java.lang.StringBuffer _content

_contentlocation

protected Location _contentlocation
Constructor Detail

VariableStatement

public VariableStatement(DefinitionStatement parent,
                         java.lang.String name,
                         Expression expr,
                         Modifiers mods)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getParentStatement

public Statement getParentStatement()
Overrides:
getParentStatement in class Statement

getQualifiedName

public java.lang.String getQualifiedName()
Specified by:
getQualifiedName in interface Type

getName

public java.lang.String getName()
Specified by:
getName in interface Type

isPrivate

public boolean isPrivate()
Specified by:
isPrivate in interface Type

getExpression

public Expression getExpression()

setExpression

public void setExpression(Expression expr)

getValue

public Any getValue()
Specified by:
getValue in interface VariableType

setValue

public Any setValue(Any value)
Specified by:
setValue in interface VariableType

getParent

public Scope getParent()
Specified by:
getParent in interface Type

getParents

public Scope[] getParents()
Specified by:
getParents in interface Type

getDocument

public Doc getDocument()
Specified by:
getDocument in interface Type

typeOf

public int typeOf()
Overrides:
typeOf in class Statement

getType

public abstract int getType()
Specified by:
getType in interface Type

onCharacters

public void onCharacters(TemplateParser parser,
                         java.lang.String cdata)
Overrides:
onCharacters in class Statement

check

public void check(ErrorListener context)
Overrides:
check in class Statement

hasConstantInitializer

public boolean hasConstantInitializer()
Specified by:
hasConstantInitializer in interface VariableType

createStaticInitializer

public Expression createStaticInitializer()

createInitializer

public Expression createInitializer()

getTypeRef

public abstract int getTypeRef(ConstantPool pool)
Specified by:
getTypeRef in interface Type

compile

public abstract void compile(ByteCompiler context)
Overrides:
compile in class Statement