com.caucho.quercus.expr
Class InfoVarPro

java.lang.Object
  extended by com.caucho.quercus.expr.VarInfo
      extended by com.caucho.quercus.expr.InfoVarPro
Direct Known Subclasses:
InfoVarTempPro

public class InfoVarPro
extends VarInfo

Information about a variable's use in a function.


Constructor Summary
InfoVarPro(StringValue name, FunctionInfo function)
           
InfoVarPro(VarInfo var)
           
 
Method Summary
 void generateInit(PhpWriter out, java.lang.String varName, java.lang.String argName)
          Generates the function initialization code
 int getArgumentIndex()
          Returns the argument indext
 java.lang.String getExpectedClass()
          The type hinted expected class
 java.lang.String getSymbolName()
          Gets the symbol index
 ExprType getType()
          Returns the analyzed type
 boolean isArgument()
          True if the variable is a function argument
 boolean isArrayModified()
           
 boolean isAssigned()
          True if the variable is assigned in the function.
 boolean isDefaultArg()
          True if the arg has a default value
 boolean isEnvVar()
          True if the variable is used from the symbol table, e.g.
 boolean isInitializedVar()
          True if the variable is initialized directly function foo() { global $a; }
 boolean isJavaLong()
           
 boolean isLocalVar()
          Var variables stored as Java variables.
 boolean isReadOnly()
          Returns true for a read-only variable, i.e.
 boolean isRefArgument()
          True if the variable is a reference function argument
 boolean isSuperGlobal()
          Superglobals always load from $_GLOBAL
 boolean isSymbolVar()
          Var variables stored as Java variables.
 boolean isValue()
          Value variables stored as Java locals.
 boolean isVar()
          Variables must be stored as Var if they are used as references or grabbed from the symbol table.
 void printInitType(PhpWriter out, boolean isVariableArgs)
          Generates the function initialization code
 void setArgument(boolean isArgument)
          True if the variable is a function argument
 void setArgumentIndex(int index)
          Sets the argument index
 void setArrayModified(boolean isArrayModified)
           
 void setAssigned()
          True if the variable is assigned in the function, e.g.
 void setDefaultArg(boolean isDefaultArg)
          True if the arg has a default value.
 void setExpectedClass(java.lang.String expectedClass)
          The type hinted expected class
 void setInitializedVar(boolean isInit)
          True if the variable is initialized directly function foo() { global $a; }
 void setRefArgument()
          True if the variable is a reference function argument
 void setSymbolName(java.lang.String symbolName)
          Sets the symbol index
 void setVar()
          Sets as modified, e.g.
 ExprType withType(ExprType type)
          Updates the analyzed type
 
Methods inherited from class com.caucho.quercus.expr.VarInfo
getFunction, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InfoVarPro

public InfoVarPro(StringValue name,
                  FunctionInfo function)

InfoVarPro

public InfoVarPro(VarInfo var)
Method Detail

isArgument

public boolean isArgument()
True if the variable is a function argument


setArgument

public void setArgument(boolean isArgument)
True if the variable is a function argument


setArgumentIndex

public void setArgumentIndex(int index)
Sets the argument index


getArgumentIndex

public int getArgumentIndex()
Returns the argument indext


setSymbolName

public void setSymbolName(java.lang.String symbolName)
Sets the symbol index


getSymbolName

public java.lang.String getSymbolName()
Gets the symbol index


getExpectedClass

public java.lang.String getExpectedClass()
The type hinted expected class


setExpectedClass

public void setExpectedClass(java.lang.String expectedClass)
The type hinted expected class


isDefaultArg

public boolean isDefaultArg()
True if the arg has a default value


setDefaultArg

public void setDefaultArg(boolean isDefaultArg)
True if the arg has a default value.


isReadOnly

public boolean isReadOnly()
Returns true for a read-only variable, i.e. one that doesn't need to be copied as an argument.


isAssigned

public boolean isAssigned()
True if the variable is assigned in the function.


setAssigned

public void setAssigned()
True if the variable is assigned in the function, e.g. $a = 3; foo($a); // assuming foo(&$x)


isInitializedVar

public boolean isInitializedVar()
True if the variable is initialized directly function foo() { global $a; }


setInitializedVar

public void setInitializedVar(boolean isInit)
True if the variable is initialized directly function foo() { global $a; }


isRefArgument

public boolean isRefArgument()
True if the variable is a reference function argument


setRefArgument

public void setRefArgument()
True if the variable is a reference function argument


isSuperGlobal

public boolean isSuperGlobal()
Superglobals always load from $_GLOBAL


setVar

public void setVar()
Sets as modified, e.g. $a[0] = 3; // $a could be null


isVar

public boolean isVar()
Variables must be stored as Var if they are used as references or grabbed from the symbol table. $b = &$a; $b = 3; In this case, $a and $b must be a Var, never a Value since modifying $b will modify $a.


isValue

public boolean isValue()
Value variables stored as Java locals. The variables must never be a Var.


isLocalVar

public boolean isLocalVar()
Var variables stored as Java variables.


isEnvVar

public boolean isEnvVar()
True if the variable is used from the symbol table, e.g. $$v or an include or main


isSymbolVar

public boolean isSymbolVar()
Var variables stored as Java variables.


isJavaLong

public boolean isJavaLong()

isArrayModified

public boolean isArrayModified()

setArrayModified

public void setArrayModified(boolean isArrayModified)

getType

public ExprType getType()
Returns the analyzed type


withType

public ExprType withType(ExprType type)
Updates the analyzed type


printInitType

public void printInitType(PhpWriter out,
                          boolean isVariableArgs)
                   throws java.io.IOException
Generates the function initialization code

Throws:
java.io.IOException

generateInit

public void generateInit(PhpWriter out,
                         java.lang.String varName,
                         java.lang.String argName)
                  throws java.io.IOException
Generates the function initialization code

Throws:
java.io.IOException