koala.dynamicjava.tree
Class ExpressionStatement

java.lang.Object
  extended by koala.dynamicjava.tree.Node
      extended by koala.dynamicjava.tree.Statement
          extended by koala.dynamicjava.tree.ExpressionStatement
All Implemented Interfaces:
ExpressionContainer, SourceInfo.Wrapper

public class ExpressionStatement
extends Statement
implements ExpressionContainer

This class represents the assert statement nodes of the syntax tree


Field Summary
 
Fields inherited from interface koala.dynamicjava.tree.ExpressionContainer
EXPRESSION
 
Constructor Summary
ExpressionStatement(Expression exp, boolean hasSemi)
          Creates a new expression statement
ExpressionStatement(Expression exp, boolean hasSemi, SourceInfo si)
          Creates a new assert statement
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 Expression getExpression()
          Returns the expression
 boolean getHasSemicolon()
           
 void setExpression(Expression e)
          Sets the expression
 String toString()
          Implementation of toString for use in unit testing
 
Methods inherited from class koala.dynamicjava.tree.Node
archiveProperties, getProperties, getProperty, getSourceInfo, hasProperty, setProperty, setSourceInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExpressionStatement

public ExpressionStatement(Expression exp,
                           boolean hasSemi)
Creates a new expression statement

Parameters:
exp - The expression
hasSemi - Whether the expression is followed by a semicolon
Throws:
IllegalArgumentException - if exp is null

ExpressionStatement

public ExpressionStatement(Expression exp,
                           boolean hasSemi,
                           SourceInfo si)
Creates a new assert statement

Parameters:
exp - The expression
hasSemi - Whether the expression is followed by a semicolon
Throws:
IllegalArgumentException - if exp is null
Method Detail

getExpression

public Expression getExpression()
Description copied from interface: ExpressionContainer
Returns the expression

Specified by:
getExpression in interface ExpressionContainer

getHasSemicolon

public boolean getHasSemicolon()

setExpression

public void setExpression(Expression e)
Description copied from interface: ExpressionContainer
Sets the expression

Specified by:
setExpression in interface ExpressionContainer

acceptVisitor

public <T> T acceptVisitor(Visitor<T> visitor)
Allows a visitor to traverse the tree

Specified by:
acceptVisitor in class Node
Parameters:
visitor - the visitor to accept

toString

public String toString()
Implementation of toString for use in unit testing

Overrides:
toString in class Object