com.caucho.quercus.statement
Class SwitchStatement

java.lang.Object
  extended by com.caucho.quercus.statement.Statement
      extended by com.caucho.quercus.statement.SwitchStatement
Direct Known Subclasses:
ProSwitchStatement

public class SwitchStatement
extends Statement

Represents a switch statement.


Field Summary
protected  BlockStatement[] _blocks
           
protected  Expr[][] _cases
           
protected  Statement _defaultBlock
           
protected  java.lang.String _label
           
protected  Expr _value
           
 
Fields inherited from class com.caucho.quercus.statement.Statement
BREAK_FALL_THROUGH, FALL_THROUGH, RETURN
 
Constructor Summary
SwitchStatement(Location location, Expr value, java.util.ArrayList<Expr[]> caseList, java.util.ArrayList<BlockStatement> blockList, Statement defaultBlock, java.lang.String label)
           
 
Method Summary
 Value execute(Env env)
          Executes the 'switch' statement, returning any value.
 int fallThrough()
          Returns true if control can go past the statement.
 
Methods inherited from class com.caucho.quercus.statement.Statement
getLocation, getParent, isLoop, rethrow, rethrow, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_value

protected final Expr _value

_cases

protected final Expr[][] _cases

_blocks

protected final BlockStatement[] _blocks

_defaultBlock

protected final Statement _defaultBlock

_label

protected final java.lang.String _label
Constructor Detail

SwitchStatement

public SwitchStatement(Location location,
                       Expr value,
                       java.util.ArrayList<Expr[]> caseList,
                       java.util.ArrayList<BlockStatement> blockList,
                       Statement defaultBlock,
                       java.lang.String label)
Method Detail

execute

public Value execute(Env env)
Executes the 'switch' statement, returning any value.

Specified by:
execute in class Statement

fallThrough

public int fallThrough()
Returns true if control can go past the statement.

Overrides:
fallThrough in class Statement