com.caucho.quercus.expr
Class LiteralStringExpr

java.lang.Object
  extended by com.caucho.quercus.expr.Expr
      extended by com.caucho.quercus.expr.LiteralStringExpr
Direct Known Subclasses:
LiteralBinaryStringExpr, LiteralStringExprPro

public class LiteralStringExpr
extends Expr

Represents a PHP string literal expression.


Field Summary
protected  StringValue _value
           
 
Fields inherited from class com.caucho.quercus.expr.Expr
COMPILE_ARG_MAX
 
Constructor Summary
LiteralStringExpr(Location location, java.lang.String value)
           
LiteralStringExpr(Location location, StringValue value)
           
LiteralStringExpr(java.lang.String value)
           
LiteralStringExpr(StringValue value)
           
 
Method Summary
 Expr createClassConst(QuercusParser parser, java.lang.String name)
          Creates a class field $class::foo
 Value eval(Env env)
          Evaluates the expression.
 Value evalConstant()
          Evaluates the expression as a constant.
 StringValue evalStringValue(Env env)
          Evaluates the expression as a string value.
 boolean isLiteral()
          Returns true for a literal expression.
 boolean isString()
          Returns true if the expression evaluates to a string.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.quercus.expr.Expr
assign, canRead, createAssign, createAssignFrom, createAssignRef, createCall, createClassField, createClassField, createCopy, createDeref, createFieldGet, createFieldGet, createIsset, createRef, createUnset, evalArg, evalArgs, evalArray, evalArrayAssign, evalAssignRef, evalAssignValue, evalBoolean, evalChar, evalConstantPrefix, evalConstantSuffix, evalCopy, evalDirty, evalDouble, evalIsset, evalLong, evalObject, evalPostIncrement, evalPreIncrement, evalRef, evalString, evalTop, evalUnsetArray, evalValue, evalVar, getFileName, getFunctionLocation, getLine, getLocation, getLocationLine, isArray, isAssign, isBoolean, isConstant, isDouble, isFalse, isLong, isNumber, isRef, isTrue, isVar, print
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_value

protected final StringValue _value
Constructor Detail

LiteralStringExpr

public LiteralStringExpr(Location location,
                         java.lang.String value)

LiteralStringExpr

public LiteralStringExpr(Location location,
                         StringValue value)

LiteralStringExpr

public LiteralStringExpr(java.lang.String value)

LiteralStringExpr

public LiteralStringExpr(StringValue value)
Method Detail

isLiteral

public boolean isLiteral()
Returns true for a literal expression.

Overrides:
isLiteral in class Expr

isString

public boolean isString()
Returns true if the expression evaluates to a string.

Overrides:
isString in class Expr

createClassConst

public Expr createClassConst(QuercusParser parser,
                             java.lang.String name)
Creates a class field $class::foo

Overrides:
createClassConst in class Expr

evalConstant

public Value evalConstant()
Evaluates the expression as a constant.

Overrides:
evalConstant in class Expr
Returns:
the expression value.

eval

public Value eval(Env env)
Evaluates the expression.

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

evalStringValue

public StringValue evalStringValue(Env env)
Evaluates the expression as a string value.

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

toString

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