cager.jexpr.ast
Class Block

java.lang.Object
  extended bycager.jexpr.ast.AST
      extended bycager.jexpr.ast.Statement
          extended bycager.jexpr.ast.Block

public class Block
extends Statement

An AST node to represent a block of statements.

Each statement within the block is held in a list.


Constructor Summary
Block()
           
 
Method Summary
 void add(Statement s)
          Add a statement to this block's list.
 void dump(int level)
          Dump this node and all children to System.out.
 AST[] getChildren()
           
 Statement getStatement(int index)
          Get the statement indexed by index.
 Statement[] getStatements()
          Returns children as Statement[].
 java.lang.Object visit(Visitor v, java.lang.Object o)
          Provided to implement the visitor pattern.
 
Methods inherited from class cager.jexpr.ast.AST
dumpChildren, dumpPrefix, getParent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Block

public Block()
Method Detail

add

public void add(Statement s)
Add a statement to this block's list.


getStatement

public Statement getStatement(int index)
Get the statement indexed by index.


getChildren

public AST[] getChildren()
Specified by:
getChildren in class AST

getStatements

public Statement[] getStatements()
Returns children as Statement[].


visit

public java.lang.Object visit(Visitor v,
                              java.lang.Object o)
                       throws ParseException
Description copied from class: AST
Provided to implement the visitor pattern.

Specified by:
visit in class AST
Throws:
ParseException

dump

public void dump(int level)
Description copied from class: AST
Dump this node and all children to System.out.

Overrides:
dump in class AST