com.caucho.quercus.expr
Class AbstractVarExpr

java.lang.Object
  extended by com.caucho.quercus.expr.Expr
      extended by com.caucho.quercus.expr.AbstractVarExpr
Direct Known Subclasses:
ArrayGetExpr, ArrayTailExpr, BinaryCharAtExpr, ClassFieldExpr, ClassFieldVarExpr, ClassVarFieldExpr, ClassVarFieldVarExpr, ClassVirtualFieldExpr, ClassVirtualFieldVarExpr, ObjectFieldExpr, ObjectFieldVarExpr, ThisExpr, ThisFieldExpr, ThisFieldVarExpr, VarExpr, VarVarExpr

public abstract class AbstractVarExpr
extends Expr

Represents an expression that is assignable


Field Summary
 
Fields inherited from class com.caucho.quercus.expr.Expr
COMPILE_ARG_MAX
 
Constructor Summary
AbstractVarExpr()
           
AbstractVarExpr(Location location)
           
 
Method Summary
 void assign(QuercusParser parser)
          Marks the value as assigned
 Expr createAssign(QuercusParser parser, Expr value)
          Creates the assignment.
 Expr createAssignRef(QuercusParser parser, Expr value)
          Creates the assignment.
 Expr createCopy(ExprFactory factory)
          Creates the copy.
 Expr createRef(QuercusParser parser)
          Creates the reference
 Statement createUnset(ExprFactory factory, Location location)
          Creates the assignment.
abstract  Value eval(Env env)
          Evaluates the expression, returning a Value.
 Value evalArg(Env env, boolean isTop)
          Evaluates the expression as an argument.
 Value evalArray(Env env)
          Evaluates the expression as an array.
abstract  Value evalAssignRef(Env env, Value value)
          Assign the variable with a new reference value.
 Value evalAssignValue(Env env, Value value)
          Evaluates the expression.
 Value evalCopy(Env env)
          Evaluates the expression and copies the result for an assignment.
 Value evalObject(Env env)
          Evaluates the expression as an object.
 Value evalRef(Env env)
          Evaluates the expression as a reference when possible.
abstract  void evalUnset(Env env)
          Evaluates the expression as an argument.
abstract  Var evalVar(Env env)
          Evaluates the expression as a reference (by RefExpr).
 boolean isVar()
          Returns true if the expression is a var/left-hand-side.
 
Methods inherited from class com.caucho.quercus.expr.Expr
canRead, createAssignFrom, createCall, createClassConst, createClassField, createClassField, createDeref, createFieldGet, createFieldGet, createIsset, evalArgs, evalArrayAssign, evalBoolean, evalChar, evalConstant, evalConstantPrefix, evalConstantSuffix, evalDirty, evalDouble, evalIsset, evalLong, evalPostIncrement, evalPreIncrement, evalString, evalStringValue, evalTop, evalUnsetArray, evalValue, getFileName, getFunctionLocation, getLine, getLocation, getLocationLine, isArray, isAssign, isBoolean, isConstant, isDouble, isFalse, isLiteral, isLong, isNumber, isRef, isString, isTrue, print, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractVarExpr

public AbstractVarExpr(Location location)

AbstractVarExpr

public AbstractVarExpr()
Method Detail

isVar

public boolean isVar()
Returns true if the expression is a var/left-hand-side.

Overrides:
isVar in class Expr

assign

public void assign(QuercusParser parser)
Marks the value as assigned

Overrides:
assign in class Expr

createAssign

public Expr createAssign(QuercusParser parser,
                         Expr value)
Creates the assignment.

Overrides:
createAssign in class Expr

createAssignRef

public Expr createAssignRef(QuercusParser parser,
                            Expr value)
Creates the assignment.

Overrides:
createAssignRef in class Expr

createRef

public Expr createRef(QuercusParser parser)
Creates the reference

Overrides:
createRef in class Expr
Parameters:
location -

createCopy

public Expr createCopy(ExprFactory factory)
Creates the copy.

Overrides:
createCopy in class Expr
Parameters:
location -

createUnset

public Statement createUnset(ExprFactory factory,
                             Location location)
Creates the assignment.

Overrides:
createUnset in class Expr

eval

public abstract Value eval(Env env)
Evaluates the expression, returning a Value.

Specified by:
eval in class Expr
Parameters:
env - the calling environment.
Returns:
the expression value.

evalVar

public abstract Var evalVar(Env env)
Evaluates the expression as a reference (by RefExpr).

Overrides:
evalVar in class Expr
Parameters:
env - the calling environment.
Returns:
the expression value.

evalRef

public Value evalRef(Env env)
Evaluates the expression as a reference when possible.

Overrides:
evalRef in class Expr
Parameters:
env - the calling environment.
Returns:
the expression value.

evalArg

public Value evalArg(Env env,
                     boolean isTop)
Evaluates the expression as an argument.

Overrides:
evalArg in class Expr
Parameters:
env - the calling environment.
Returns:
the expression value.

evalCopy

public Value evalCopy(Env env)
Evaluates the expression and copies the result for an assignment.

Overrides:
evalCopy in class Expr
Parameters:
env - the calling environment.
Returns:
the expression value.

evalArray

public Value evalArray(Env env)
Evaluates the expression as an array.

Overrides:
evalArray in class Expr
Parameters:
env - the calling environment.
Returns:
the expression value.

evalObject

public Value evalObject(Env env)
Evaluates the expression as an object.

Overrides:
evalObject in class Expr
Parameters:
env - the calling environment.
Returns:
the expression value.

evalUnset

public abstract void evalUnset(Env env)
Evaluates the expression as an argument.

Parameters:
env - the calling environment.

evalAssignValue

public Value evalAssignValue(Env env,
                             Value value)
Evaluates the expression.

Overrides:
evalAssignValue in class Expr
Parameters:
env - the calling environment.
Returns:
the expression value.

evalAssignRef

public abstract Value evalAssignRef(Env env,
                                    Value value)
Assign the variable with a new reference value.

Overrides:
evalAssignRef in class Expr
Parameters:
env - the calling environment.
Returns:
the expression value.