|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.quercus.expr.ExprGenerator
public abstract class ExprGenerator
Represents compilable PHP expression.
| Field Summary | |
|---|---|
static int |
COMPILE_ARG_MAX
|
| Constructor Summary | |
|---|---|
ExprGenerator()
|
|
ExprGenerator(Location location)
|
|
| Method Summary | |
|---|---|
abstract ExprType |
analyze(AnalyzeInfo info)
Analyze the expression |
ExprType |
analyzeAssign(AnalyzeInfo info,
ExprGenerator value)
Analyze the expression |
void |
analyzeSetModified(AnalyzeInfo info)
Analyze as modified. |
void |
analyzeSetPostIncrement()
Set a post increment |
void |
analyzeSetReference(AnalyzeInfo info)
Analyze as reference |
void |
analyzeTop(AnalyzeInfo info)
Analyze the expression as a statement |
void |
analyzeUnset(AnalyzeInfo info)
Analyze as unset |
protected VarState |
combineBinaryVarState(VarState leftState,
VarState rightState)
Returns the variables state. |
void |
generate(PhpWriter out)
Generates code to evaluate the expression. |
void |
generateAppend(PhpWriter out)
Generates code to append to a string builder. |
void |
generateArg(PhpWriter out,
boolean isTop)
Generates code for a function arg, where the declaration of the argument is unknown. |
void |
generateArray(PhpWriter out)
Generates code for a reference that can be used as an array. |
void |
generateAssign(PhpWriter out,
Expr value,
boolean isTop)
Generates code to evaluate the expression |
void |
generateAssignBoolean(PhpWriter out,
Expr value,
boolean isTop)
Generates code to evaluate the expression |
void |
generateAssignClose(PhpWriter out)
Generates code to evaluate the expression |
void |
generateAssignOpen(PhpWriter out)
Generates code to evaluate the expression |
void |
generateAssignRef(PhpWriter out,
Expr value,
boolean isTop)
Generates code to evaluate the expression |
void |
generateBoolean(PhpWriter out)
Generates code to evaluate a boolean directly |
void |
generateChar(PhpWriter out)
Generates code to evaluate a string directly |
void |
generateCopy(PhpWriter out)
Generates code to recreate the expression. |
void |
generateDirty(PhpWriter out)
Generates code to evaluate the expression, expecting a modification. |
void |
generateDouble(PhpWriter out)
Generates code to evaluate the expression directly |
void |
generateExpr(PhpWriter out)
Generates code to recreate the expression. |
void |
generateGetOut(PhpWriter out)
Generates code to get the out. |
void |
generateInt(PhpWriter out)
Generates code to evaluate the expression directly |
void |
generateIsset(PhpWriter out)
Generates an expression for isset(). |
void |
generateListEachStatement(PhpWriter out,
Expr value)
Generates code to recreate the expression. |
void |
generateLong(PhpWriter out)
Generates code to evaluate the expression directly |
void |
generateModifiedRead(PhpWriter out)
Generates code to eval the expression when the content might be modified, e.g. |
void |
generateObject(PhpWriter out)
Generates code to recreate the expression, creating an object for an unset value. |
void |
generatePrint(PhpWriter out)
Generates code to print the expression directly |
void |
generateRef(PhpWriter out)
Generates code for a reference. |
void |
generateRefArg(PhpWriter out)
Generates code for a reference. |
void |
generateReturn(PhpWriter out)
Generates code for a return value |
void |
generateReturnRef(PhpWriter out)
Generates code for a return reference. |
void |
generateStatement(PhpWriter out)
Generates code to recreate the expression. |
void |
generateString(PhpWriter out)
Generates code to evaluate a string directly |
void |
generateStringValue(PhpWriter out)
Generates code to evaluate a string directly |
void |
generateTop(PhpWriter out)
Generates code to recreate the expression. |
void |
generateType(PhpWriter out)
Generates code for the native type |
void |
generateUnset(PhpWriter out)
Generates code to unset the expression |
void |
generateUnsetArray(PhpWriter out,
ExprGenerator index)
Generates code to unset the expression |
void |
generateValue(PhpWriter out)
Generates code for a function arg. |
void |
generateValueArg(PhpWriter out)
Generates code for a call arg, where the function is known to take a value, i.e. |
void |
generateVar(PhpWriter out)
Generates code for a reference. |
java.lang.Object |
getConstant()
Returns the constant value |
java.lang.Object |
getLiteral()
Returns the literal value |
Location |
getLocation()
Properties. |
ExprType |
getType()
Returns the static, analyzed type |
boolean |
isAssignment()
Returns true for an assignment expression. |
boolean |
isBoolean()
|
boolean |
isConstant()
Returns true for a constant. |
boolean |
isDefault()
|
boolean |
isDouble()
Returns true for a double-valued expression. |
boolean |
isLiteral()
Returns true for a literal |
boolean |
isLong()
Returns true for a long-valued expression. |
boolean |
isNumber()
Returns true for a number. |
boolean |
isString()
Returns true for a String-valued expression. |
boolean |
isVar()
Returns true for a Var, i.e. |
boolean |
isVarAssigned(VarExpr 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 |
|---|
public static final int COMPILE_ARG_MAX
| Constructor Detail |
|---|
public ExprGenerator()
public ExprGenerator(Location location)
| Method Detail |
|---|
public Location getLocation()
public boolean isLong()
public boolean isDouble()
public boolean isNumber()
public boolean isBoolean()
public boolean isString()
public boolean isAssignment()
public boolean isLiteral()
public boolean isConstant()
public boolean isVar()
public boolean isDefault()
public java.lang.Object getLiteral()
public java.lang.Object getConstant()
public ExprType getType()
public abstract ExprType analyze(AnalyzeInfo info)
public void analyzeTop(AnalyzeInfo info)
public ExprType analyzeAssign(AnalyzeInfo info,
ExprGenerator value)
public void analyzeSetModified(AnalyzeInfo info)
public void analyzeSetReference(AnalyzeInfo info)
public void analyzeSetPostIncrement()
public void analyzeUnset(AnalyzeInfo info)
protected VarState combineBinaryVarState(VarState leftState,
VarState rightState)
leftState - the variables to testrightState - the owning expressionpublic boolean isVarAssigned(VarExpr var)
var - the variable to test
public void generate(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateIsset(PhpWriter out)
throws java.io.IOException
java.io.IOException
public void generateModifiedRead(PhpWriter out)
throws java.io.IOException
java.io.IOException
public void generateDirty(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateArg(PhpWriter out,
boolean isTop)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateValueArg(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateValue(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateRef(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateArray(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateVar(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateReturnRef(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateRefArg(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateCopy(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateObject(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateAssign(PhpWriter out,
Expr value,
boolean isTop)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateAssignRef(PhpWriter out,
Expr value,
boolean isTop)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateAssignOpen(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateAssignClose(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateAssignBoolean(PhpWriter out,
Expr value,
boolean isTop)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateUnset(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateUnsetArray(PhpWriter out,
ExprGenerator index)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateTop(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateReturn(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateStatement(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateListEachStatement(PhpWriter out,
Expr value)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateBoolean(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateString(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateStringValue(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateAppend(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateChar(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateInt(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateLong(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateDouble(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateType(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateGetOut(PhpWriter out)
throws java.io.IOException
java.io.IOException
public void generatePrint(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
public void generateExpr(PhpWriter out)
throws java.io.IOException
out - the writer to the Java source code.
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||