com.caucho.quercus.expr
Class ObjectFieldExpr

java.lang.Object
  extended by com.caucho.quercus.expr.Expr
      extended by com.caucho.quercus.expr.AbstractVarExpr
          extended by com.caucho.quercus.expr.ObjectFieldExpr
Direct Known Subclasses:
ObjectFieldExprPro

public class ObjectFieldExpr
extends AbstractVarExpr

Represents a PHP field reference.


Field Summary
protected  StringValue _name
           
protected  Expr _objExpr
           
 
Fields inherited from class com.caucho.quercus.expr.Expr
COMPILE_ARG_MAX
 
Constructor Summary
ObjectFieldExpr(Expr objExpr, StringValue name)
           
ObjectFieldExpr(Location location, Expr objExpr, StringValue name)
           
 
Method Summary
 Expr createCall(QuercusParser parser, Location location, java.util.ArrayList<Expr> args)
          Creates a function call expression
 Value eval(Env env)
          Evaluates the expression.
 Value evalArg(Env env, boolean isTop)
          Evaluates the expression.
 Value evalArray(Env env)
          Evaluates the expression, creating an array if the field is unset.
 Value evalAssignRef(Env env, Value value)
          Evaluates the expression.
 Value evalDirty(Env env)
          Evaluates the expression, with the object expected to be modified, e.g.
 boolean evalIsset(Env env)
          Evaluates the expression as an isset() statement.
 Value evalObject(Env env)
          Evaluates the expression, creating an object if the field is unset.
 Value evalPostIncrement(Env env, int incr)
          Handles post increments.
 Value evalPreIncrement(Env env, int incr)
          Handles post increments.
 void evalUnset(Env env)
          Evaluates the expression.
 void evalUnsetArray(Env env, Value index)
          Evaluates the expression as an array index unset
 Var evalVar(Env env)
          Evaluates the expression.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.quercus.expr.AbstractVarExpr
assign, createAssign, createAssignRef, createCopy, createRef, createUnset, evalAssignValue, evalCopy, evalRef, isVar
 
Methods inherited from class com.caucho.quercus.expr.Expr
canRead, createAssignFrom, createClassConst, createClassField, createClassField, createDeref, createFieldGet, createFieldGet, createIsset, evalArgs, evalArrayAssign, evalBoolean, evalChar, evalConstant, evalConstantPrefix, evalConstantSuffix, evalDouble, evalLong, evalString, evalStringValue, evalTop, evalValue, getFileName, getFunctionLocation, getLine, getLocation, getLocationLine, isArray, isAssign, isBoolean, isConstant, isDouble, isFalse, isLiteral, isLong, isNumber, isRef, isString, isTrue, print
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_objExpr

protected final Expr _objExpr

_name

protected final StringValue _name
Constructor Detail

ObjectFieldExpr

public ObjectFieldExpr(Location location,
                       Expr objExpr,
                       StringValue name)

ObjectFieldExpr

public ObjectFieldExpr(Expr objExpr,
                       StringValue name)
Method Detail

createCall

public Expr createCall(QuercusParser parser,
                       Location location,
                       java.util.ArrayList<Expr> args)
                throws java.io.IOException
Creates a function call expression

Overrides:
createCall in class Expr
Throws:
java.io.IOException

eval

public Value eval(Env env)
Evaluates the expression.

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

evalVar

public Var evalVar(Env env)
Evaluates the expression.

Specified by:
evalVar in class AbstractVarExpr
Parameters:
env - the calling environment.
Returns:
the expression value.

evalArg

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

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

evalDirty

public Value evalDirty(Env env)
Description copied from class: Expr
Evaluates the expression, with the object expected to be modified, e.g. from an unset.

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

evalAssignRef

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

Specified by:
evalAssignRef in class AbstractVarExpr
Parameters:
env - the calling environment.
Returns:
the expression value.

evalPostIncrement

public Value evalPostIncrement(Env env,
                               int incr)
Handles post increments.

Overrides:
evalPostIncrement in class Expr

evalPreIncrement

public Value evalPreIncrement(Env env,
                              int incr)
Handles post increments.

Overrides:
evalPreIncrement in class Expr

evalArray

public Value evalArray(Env env)
Evaluates the expression, creating an array if the field is unset.

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

evalObject

public Value evalObject(Env env)
Evaluates the expression, creating an object if the field is unset.

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

evalUnset

public void evalUnset(Env env)
Evaluates the expression.

Specified by:
evalUnset in class AbstractVarExpr
Parameters:
env - the calling environment.

evalUnsetArray

public void evalUnsetArray(Env env,
                           Value index)
Evaluates the expression as an array index unset

Overrides:
evalUnsetArray in class Expr

toString

public java.lang.String toString()
Overrides:
toString in class Expr

evalIsset

public boolean evalIsset(Env env)
Description copied from class: Expr
Evaluates the expression as an isset() statement.

Overrides:
evalIsset in class Expr