aspoev.interpreter.base
Class BlockElement

java.lang.Object
  extended byaspoev.interpreter.base.Element
      extended byaspoev.interpreter.base.StatementElement
          extended byaspoev.interpreter.base.BlockElement
All Implemented Interfaces:
java.lang.Cloneable, aspoev.Executable, pJ.jasmine.PRI, java.io.Serializable

public class BlockElement
extends StatementElement
implements pJ.jasmine.PRI

This Element is the AST equivalent of a c-style block, delineated by '{' and '}'. Although you might think that a MethodInvokationElement would contain its body, the StatementElements to be executed by the method are actually delegated to this class. It calls upon the current ExecutionEnvironment to push scope before it executes, and pop scope after it executes. This effectively gives variables a limited lifetime. Variables can be returned from a BlockElement by means of a ReturnElement, created with the keyword 'return' in vejal.

See Also:
Serialized Form

Field Summary
protected  aspoev.interpreter.base.ExecutionIterator execution
           
protected  pJ.jasmine.ListOfObject statements
           
 
Fields inherited from class aspoev.interpreter.base.Element
parent
 
Fields inherited from interface pJ.jasmine.PRI
DELETECHANGE, MODIFYCHANGE, NOCHANGE
 
Constructor Summary
BlockElement()
           
 
Method Summary
 void addStatement(StatementElement statement)
          Called by generated parser aspoev.interpreter.parser.VejalParser
 java.lang.Object clone()
           
protected  java.lang.Object executeElement()
           
 java.util.Collection getChildrenByType(java.lang.Class childClass)
           
 java.lang.String getCodeString()
           
 boolean stepBackExecution()
           
 java.lang.String toString()
           
 
Methods inherited from class aspoev.interpreter.base.Element
execute, getRValue, persist
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

statements

protected pJ.jasmine.ListOfObject statements

execution

protected transient aspoev.interpreter.base.ExecutionIterator execution
Constructor Detail

BlockElement

public BlockElement()
Method Detail

addStatement

public void addStatement(StatementElement statement)
Called by generated parser aspoev.interpreter.parser.VejalParser


clone

public java.lang.Object clone()
Specified by:
clone in class Element

executeElement

protected java.lang.Object executeElement()
Overrides:
executeElement in class StatementElement

getChildrenByType

public java.util.Collection getChildrenByType(java.lang.Class childClass)
Specified by:
getChildrenByType in class Element

stepBackExecution

public boolean stepBackExecution()

getCodeString

public java.lang.String getCodeString()
Specified by:
getCodeString in class Element

toString

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