com.caucho.quercus.statement
Class StatementGenerator

java.lang.Object
  extended by com.caucho.quercus.statement.StatementGenerator

public abstract class StatementGenerator
extends java.lang.Object

Represents a PHP statement


Field Summary
static int BREAK_FALL_THROUGH
           
static int FALL_THROUGH
           
static int RETURN
           
 
Constructor Summary
StatementGenerator()
           
 
Method Summary
abstract  boolean analyze(AnalyzeInfo info)
          Analyze the statement
 int fallThrough()
          Returns true if the statement can fallthrough.
 void generate(PhpWriter out)
          Generates the Java code for the statement.
 void generateCoda(PhpWriter out)
          Generates static/initialization code code for the statement.
 void generateGetOut(PhpWriter out)
          Generates the Java code for the statement.
protected abstract  void generateImpl(PhpWriter out)
          Implementation of the generation.
protected abstract  Location getLocation()
           
 boolean isOutUsed()
          Returns true if the output is used in the statement.
 boolean isVarAssigned(VarExprPro var)
          Returns true if the variable is ever assigned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FALL_THROUGH

public static final int FALL_THROUGH
See Also:
Constant Field Values

BREAK_FALL_THROUGH

public static final int BREAK_FALL_THROUGH
See Also:
Constant Field Values

RETURN

public static final int RETURN
See Also:
Constant Field Values
Constructor Detail

StatementGenerator

public StatementGenerator()
Method Detail

getLocation

protected abstract Location getLocation()

analyze

public abstract boolean analyze(AnalyzeInfo info)
Analyze the statement

Returns:
true if the following statement can be executed

fallThrough

public int fallThrough()
Returns true if the statement can fallthrough.


isVarAssigned

public boolean isVarAssigned(VarExprPro var)
Returns true if the variable is ever assigned.

Parameters:
var - the variable to test

isOutUsed

public boolean isOutUsed()
Returns true if the output is used in the statement.


generate

public final void generate(PhpWriter out)
                    throws java.io.IOException
Generates the Java code for the statement.

Parameters:
out - the writer to the generated Java source.
Throws:
java.io.IOException

generateImpl

protected abstract void generateImpl(PhpWriter out)
                              throws java.io.IOException
Implementation of the generation.

Throws:
java.io.IOException

generateGetOut

public void generateGetOut(PhpWriter out)
                    throws java.io.IOException
Generates the Java code for the statement.

Parameters:
out - the writer to the generated Java source.
Throws:
java.io.IOException

generateCoda

public void generateCoda(PhpWriter out)
                  throws java.io.IOException
Generates static/initialization code code for the statement.

Parameters:
out - the writer to the generated Java source.
Throws:
java.io.IOException