public abstract class Expr
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
COMPILE_ARG_MAX |
static Expr[] |
NULL_ARGS |
Modifier and Type | Method and Description |
---|---|
void |
assign(QuercusParser parser)
Mark as an assignment for a list()
|
boolean |
canRead()
Returns true for an expression that can be read (only $a[] uses this)
|
Expr |
createAssign(QuercusParser parser,
Expr value) |
Expr |
createAssignFrom(QuercusParser parser,
AbstractVarExpr leftHandSide)
Creates an assignment using this value as the right hand side.
|
Expr |
createAssignRef(QuercusParser parser,
Expr value) |
Expr |
createCall(QuercusParser parser,
Location location,
java.util.ArrayList<Expr> args)
Creates a function call expression
|
Expr |
createClassConst(QuercusParser parser,
Expr name)
Creates a class field $class::foo
|
Expr |
createClassConst(QuercusParser parser,
StringValue name)
Creates a class field $class::foo
|
Expr |
createClassField(QuercusParser parser,
Expr name)
Creates a class field $class::${foo}
|
Expr |
createClassField(QuercusParser parser,
StringValue name)
Creates a class field $class::$foo
|
Expr |
createCopy(ExprFactory factory)
Creates a assignment
|
Expr |
createDeref(ExprFactory factory) |
Expr |
createFieldGet(ExprFactory factory,
Location location,
Expr name)
Creates a field ref
|
Expr |
createFieldGet(ExprFactory factory,
Location location,
StringValue name)
Creates a field ref
|
Expr |
createIsset(ExprFactory factory)
Creates an isset expression
|
Expr |
createRef(QuercusParser parser)
Creates a reference.
|
Statement |
createUnset(ExprFactory factory,
Location location)
Creates a assignment
|
boolean |
equals(java.lang.Object obj) |
abstract Value |
eval(Env env)
Evaluates the expression, returning a Value, never a Var.
|
Value |
evalArg(Env env,
boolean isTop)
Evaluates the expression as a function argument where it is unknown
if the value will be used as a reference.
|
static Value[] |
evalArgs(Env env,
Expr[] exprs)
Evaluates arguments
|
Value |
evalArray(Env env)
Evaluates the expression, creating an array for unassigned values.
|
Value |
evalArrayAssign(Env env,
Expr indexExpr,
Expr valueExpr)
Evaluates as an array index assign ($a[index] = value).
|
Value |
evalArrayAssignRef(Env env,
Expr indexExpr,
Expr valueExpr)
Evaluates as an array index assign ($a[index] = value).
|
Value |
evalArrayAssignRef(Env env,
Expr indexExpr,
Value value)
Evaluates as an array index assign ($a[index] = value).
|
Value |
evalArrayAssignTail(Env env,
Value value)
Evaluates as an array tail assign ($a[] = value).
|
Value |
evalAssignRef(Env env,
Expr valueExpr)
Evaluates an assignment.
|
Value |
evalAssignRef(Env env,
Value value)
Evaluates an assignment.
|
Value |
evalAssignValue(Env env,
Expr valueExpr)
Evaluates an assignment.
|
Value |
evalAssignValue(Env env,
Value value)
Evaluates an assignment.
|
boolean |
evalBoolean(Env env)
Evaluates the expression as a boolean.
|
char |
evalChar(Env env)
Evaluates the expression as a string
|
Value |
evalConstant()
Evaluates the expression as a constant.
|
Value |
evalConstantPrefix()
Evaluates as a constant prefix.
|
Value |
evalConstantSuffix()
Evaluates as a constant prefix.
|
Value |
evalCopy(Env env)
Evaluates the expression as a copy.
|
Value |
evalDirty(Env env)
Evaluates the expression, with the object expected to be modified,
e.g.
|
double |
evalDouble(Env env)
Evaluates the expression as a double
|
boolean |
evalEmpty(Env env)
Evaluates as an empty() expression.
|
boolean |
evalIsset(Env env)
Evaluates the expression as an isset() statement.
|
Value |
evalIssetValue(Env env)
Evaluates the expression as an isset() statement.
|
long |
evalLong(Env env)
Evaluates the expression as a long
|
Value |
evalObject(Env env)
Evaluates the expression, creating an object for unassigned values.
|
Value |
evalPostIncrement(Env env,
int incr)
Handles post increments.
|
Value |
evalPreIncrement(Env env,
int incr)
Handles post increments.
|
QuercusClass |
evalQuercusClass(Env env)
Evaluates as a QuercusClass.
|
Value |
evalRef(Env env)
Evaluates the expression, returning a Var for variables, and a Value
for values.
|
java.lang.String |
evalString(Env env)
Evaluates the expression as a string
|
StringValue |
evalStringValue(Env env)
Evaluates the expression as a string value
|
Value |
evalTop(Env env)
Evaluates the expression.
|
void |
evalUnsetArray(Env env,
Expr indexExpr)
Evaluates the expression as an array index unset
|
Value |
evalValue(Env env)
Evaluates the expression, returning a Value.
|
Var |
evalVar(Env env)
Evaluates the expression, always returning a variable.
|
java.lang.String |
getFileName()
Returns the filename.
|
java.lang.String |
getFunctionLocation()
Returns the function name.
|
int |
getLine()
Returns the line number in the file.
|
Location |
getLocation()
Returns the location.
|
java.lang.String |
getLocationLine()
Returns the file name and line number, if location is known.
|
boolean |
isArray()
Returns true if the expression evaluates to an array.
|
boolean |
isAssign() |
boolean |
isBoolean()
Returns true if the expression evaluates to a boolean.
|
boolean |
isConstant()
Returns true for a constant expression.
|
boolean |
isDouble()
Returns true if the expression evaluates to a double.
|
boolean |
isFalse()
Returns true if a static false value.
|
boolean |
isLiteral()
Returns true for a literal expression.
|
boolean |
isLong()
Returns true if the expression evaluates to a long.
|
boolean |
isNumber()
Returns true if the expression evaluates to a number.
|
boolean |
isRef()
Returns true for a reference.
|
boolean |
isString()
Returns true if the expression evaluates to a string.
|
boolean |
isTrue()
Returns true if a static true value.
|
boolean |
isVar()
Returns true if the expression is a var/left-hand-side.
|
void |
print(Env env)
Prints to the output as an echo.
|
java.lang.String |
toString() |
public static final int COMPILE_ARG_MAX
public static final Expr[] NULL_ARGS
public Expr(Location location)
public Expr()
public final Location getLocation()
public java.lang.String getFileName()
public int getLine()
public java.lang.String getFunctionLocation()
public java.lang.String getLocationLine()
public boolean isRef()
public boolean isConstant()
public boolean isLiteral()
public boolean isTrue()
public boolean isFalse()
public boolean isAssign()
public boolean canRead()
public boolean isBoolean()
public boolean isLong()
public boolean isDouble()
public boolean isNumber()
public boolean isString()
public boolean isArray()
public boolean isVar()
public Expr createAssign(QuercusParser parser, Expr value) throws java.io.IOException
java.io.IOException
public Expr createAssignFrom(QuercusParser parser, AbstractVarExpr leftHandSide)
public void assign(QuercusParser parser) throws java.io.IOException
java.io.IOException
public Expr createAssignRef(QuercusParser parser, Expr value) throws java.io.IOException
java.io.IOException
public Expr createRef(QuercusParser parser) throws java.io.IOException
location
- java.io.IOException
public Expr createDeref(ExprFactory factory) throws java.io.IOException
java.io.IOException
public Expr createCopy(ExprFactory factory)
location
- public Expr createFieldGet(ExprFactory factory, Location location, StringValue name)
public Expr createFieldGet(ExprFactory factory, Location location, Expr name)
public Expr createClassConst(QuercusParser parser, StringValue name)
public Expr createClassConst(QuercusParser parser, Expr name)
public Expr createClassField(QuercusParser parser, StringValue name)
public Expr createClassField(QuercusParser parser, Expr name)
public Statement createUnset(ExprFactory factory, Location location) throws java.io.IOException
java.io.IOException
public Expr createIsset(ExprFactory factory) throws java.io.IOException
java.io.IOException
public Expr createCall(QuercusParser parser, Location location, java.util.ArrayList<Expr> args) throws java.io.IOException
java.io.IOException
public Value evalConstant()
public Value evalConstantPrefix()
public Value evalConstantSuffix()
public abstract Value eval(Env env)
env
- the calling environment.public Var evalVar(Env env)
env
- the calling environment.public Value evalValue(Env env)
env
- the calling environment.public Value evalRef(Env env)
env
- the calling environment.public Value evalCopy(Env env)
env
- the calling environment.public Value evalArg(Env env, boolean isTop)
env
- the calling environment.isTail
- true for the top expressionpublic Value evalTop(Env env)
env
- the calling environment.public Value evalDirty(Env env)
env
- the calling environment.public Value evalArray(Env env)
env
- the calling environment.public Value evalObject(Env env)
env
- the calling environment.public Value evalAssignValue(Env env, Expr valueExpr)
public Value evalAssignValue(Env env, Value value)
public Value evalAssignRef(Env env, Expr valueExpr)
public Value evalAssignRef(Env env, Value value)
public Value evalArrayAssign(Env env, Expr indexExpr, Expr valueExpr)
public Value evalArrayAssignRef(Env env, Expr indexExpr, Expr valueExpr)
public Value evalArrayAssignRef(Env env, Expr indexExpr, Value value)
public Value evalArrayAssignTail(Env env, Value value)
public java.lang.String evalString(Env env)
env
- the calling environment.public StringValue evalStringValue(Env env)
env
- the calling environment.public char evalChar(Env env)
env
- the calling environment.public boolean evalBoolean(Env env)
env
- the calling environment.public long evalLong(Env env)
env
- the calling environment.public double evalDouble(Env env)
env
- the calling environment.public boolean evalIsset(Env env)
public Value evalIssetValue(Env env)
public void evalUnsetArray(Env env, Expr indexExpr)
public boolean evalEmpty(Env env)
public QuercusClass evalQuercusClass(Env env)
public void print(Env env) throws java.io.IOException
java.io.IOException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object