com.caucho.quercus.expr
Class VarExpr

java.lang.Object
  extended by com.caucho.quercus.expr.Expr
      extended by com.caucho.quercus.expr.AbstractVarExpr
          extended by com.caucho.quercus.expr.VarExpr
Direct Known Subclasses:
VarExprPro, VarTempExpr

public class VarExpr
extends AbstractVarExpr

Represents a PHP variable expression.


Field Summary
protected  StringValue _name
           
 
Fields inherited from class com.caucho.quercus.expr.Expr
COMPILE_ARG_MAX
 
Constructor Summary
protected VarExpr(Location location, VarInfo var)
           
protected VarExpr(VarInfo var)
           
 
Method Summary
 void assign(QuercusParser parser)
          Creates the assignment.
 Expr copy(Location location)
          Copy for things like $a .= "test";
 Expr createAssign(QuercusParser parser, Expr value)
          Creates the assignment.
 Expr createAssignRef(QuercusParser parser, Expr value)
          Creates the assignment.
 boolean equals(java.lang.Object o)
           
 Value eval(Env env)
          Evaluates the expression.
 Value evalArg(Env env, boolean isTop)
          Evaluates the expression.
 Value evalArray(Env env)
          Evaluates the expression, converting to an array if unset.
 Value evalAssignRef(Env env, Value value)
          Evaluates the expression.
 Value evalAssignValue(Env env, Value value)
          Evaluates the expression.
 Value evalCopy(Env env)
          Evaluates the expression.
 boolean evalIsset(Env env)
          Evaluates the expression as an isset() statement.
 Value evalObject(Env env)
          Evaluates the expression, converting to an object if is unset, NULL, or is a string.
 Value evalTop(Env env)
          Evaluates the expression.
 void evalUnset(Env env)
          Evaluates the expression.
 Var evalVar(Env env)
          Evaluates the expression.
 java.lang.String getJavaVar()
          Returns the java variable name.
 StringValue getName()
          Returns the variable name.
 VarInfo getVarInfo()
          Returns the variable info.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.quercus.expr.AbstractVarExpr
createCopy, createRef, createUnset, evalRef, isVar
 
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, evalLong, evalPostIncrement, evalPreIncrement, evalString, evalStringValue, evalUnsetArray, 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, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_name

protected final StringValue _name
Constructor Detail

VarExpr

protected VarExpr(Location location,
                  VarInfo var)

VarExpr

protected VarExpr(VarInfo var)
Method Detail

getVarInfo

public VarInfo getVarInfo()
Returns the variable info.


getName

public StringValue getName()
Returns the variable name.


getJavaVar

public java.lang.String getJavaVar()
Returns the java variable name.


copy

public Expr copy(Location location)
Copy for things like $a .= "test";

Parameters:
location -

createAssign

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

Overrides:
createAssign in class AbstractVarExpr

assign

public void assign(QuercusParser parser)
Creates the assignment.

Overrides:
assign in class AbstractVarExpr

createAssignRef

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

Overrides:
createAssignRef in class AbstractVarExpr

eval

public Value eval(Env env)
Evaluates the expression.

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

evalTop

public Value evalTop(Env env)
Evaluates the expression.

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

evalIsset

public boolean evalIsset(Env env)
Evaluates the expression as an isset() statement.

Overrides:
evalIsset in class Expr

evalCopy

public Value evalCopy(Env env)
Evaluates the expression.

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

evalArray

public Value evalArray(Env env)
Evaluates the expression, converting to an array if unset.

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

evalObject

public Value evalObject(Env env)
Evaluates the expression, converting to an object if is unset, NULL, or is a string.

Overrides:
evalObject 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.

evalAssignValue

public Value evalAssignValue(Env env,
                             Value value)
Evaluates the expression. The value must not be a Var.

Overrides:
evalAssignValue in class AbstractVarExpr
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.

evalUnset

public void evalUnset(Env env)
Evaluates the expression.

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

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