com.caucho.quercus.program
Class FunctionInfo

java.lang.Object
  extended by com.caucho.quercus.program.FunctionInfo
Direct Known Subclasses:
ProFunctionInfo

public class FunctionInfo
extends java.lang.Object

Information about a function.


Constructor Summary
FunctionInfo(QuercusContext quercus, ClassDef classDef, java.lang.String name)
           
 
Method Summary
 void addTempVar(java.lang.String name)
          Adds a temp variable.
 FunctionInfo copy()
           
protected  FunctionInfo createCopy()
           
 java.lang.String createTempVar()
           
 VarInfo createVar(java.lang.String name)
           
 VarInfo createVar(StringValue name)
          Returns the variable.
protected  VarInfo createVarInfo(StringValue name)
           
 ClassDef getDeclaringClass()
          Gets the owning class.
 java.lang.String getName()
           
 QuercusContext getQuercus()
          Returns the owning quercus.
 int getTempIndex()
           
 java.util.Collection<java.lang.String> getTempVariables()
          Returns the temp variables.
 java.util.Collection<VarInfo> getVariables()
          Returns the variables.
 boolean hasThis()
          Return true if the function allows $this
 boolean isClosure()
          True for a closure function (top-level script).
 boolean isConstructor()
          True for a constructor
 boolean isFinal()
           
 boolean isGlobal()
          True for a global function (top-level script).
 boolean isMethod()
          True for a method.
 boolean isNonStaticMethod()
          True for a method.
 boolean isOutUsed()
          Returns true if the out is used.
 boolean isPageMain()
          True for a main function (top-level script).
 boolean isPageStatic()
          True for a static function (top-level script).
 boolean isReadOnly()
          Returns true for a read-only function, i.e.
 boolean isReturnsReference()
          True if the function returns a reference.
 boolean isUsesGlobal()
           
 boolean isUsesSymbolTable()
          True if the function uses the symbol table
 boolean isVariableArgs()
          True if the function has variable numbers of arguments
 boolean isVariableVar()
          True if the function has variable vars.
 void setClosure(boolean isClosure)
          True for a closure.
 void setConstructor(boolean isConstructor)
          True for a constructor.
 void setFunction(Function fun)
          Sets the actual function.
 void setGlobal(boolean isGlobal)
          True for a global function.
 void setHasThis(boolean hasThis)
           
 void setModified()
          True for a non-read-only function
 void setOutUsed()
          Set true if the out is used.
 void setPageMain(boolean isPageMain)
          True for a main function (top-level script).
 void setPageStatic(boolean isPageStatic)
          True for a static function (top-level script).
 void setReturnsReference(boolean isReturnsReference)
          True if the function returns a reference.
 void setUsesGlobal(boolean isUsesGlobal)
           
 void setUsesSymbolTable(boolean isUsesSymbolTable)
          True if the function uses the symbol table
 void setVariableArgs(boolean isVariableArgs)
          True if the function has variable numbers of arguments
 void setVariableVar(boolean isVariableVar)
          True if the function has variable vars
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FunctionInfo

public FunctionInfo(QuercusContext quercus,
                    ClassDef classDef,
                    java.lang.String name)
Method Detail

copy

public FunctionInfo copy()

createCopy

protected FunctionInfo createCopy()

getQuercus

public QuercusContext getQuercus()
Returns the owning quercus.


getName

public java.lang.String getName()

setFunction

public void setFunction(Function fun)
Sets the actual function.


isGlobal

public boolean isGlobal()
True for a global function (top-level script).


setGlobal

public void setGlobal(boolean isGlobal)
True for a global function.


setClosure

public void setClosure(boolean isClosure)
True for a closure.


isClosure

public boolean isClosure()
True for a closure function (top-level script).


isFinal

public boolean isFinal()

isPageMain

public boolean isPageMain()
True for a main function (top-level script).


setPageMain

public void setPageMain(boolean isPageMain)
True for a main function (top-level script).


isPageStatic

public boolean isPageStatic()
True for a static function (top-level script).


setPageStatic

public void setPageStatic(boolean isPageStatic)
True for a static function (top-level script).


setHasThis

public void setHasThis(boolean hasThis)

hasThis

public boolean hasThis()
Return true if the function allows $this


getDeclaringClass

public ClassDef getDeclaringClass()
Gets the owning class.


isMethod

public boolean isMethod()
True for a method.


isNonStaticMethod

public boolean isNonStaticMethod()
True for a method.


isConstructor

public boolean isConstructor()
True for a constructor


setConstructor

public void setConstructor(boolean isConstructor)
True for a constructor.


isReturnsReference

public boolean isReturnsReference()
True if the function returns a reference.


setReturnsReference

public void setReturnsReference(boolean isReturnsReference)
True if the function returns a reference.


isVariableVar

public boolean isVariableVar()
True if the function has variable vars.


setVariableVar

public void setVariableVar(boolean isVariableVar)
True if the function has variable vars


isVariableArgs

public boolean isVariableArgs()
True if the function has variable numbers of arguments


setVariableArgs

public void setVariableArgs(boolean isVariableArgs)
True if the function has variable numbers of arguments


isUsesSymbolTable

public boolean isUsesSymbolTable()
True if the function uses the symbol table


setUsesSymbolTable

public void setUsesSymbolTable(boolean isUsesSymbolTable)
True if the function uses the symbol table


isUsesGlobal

public boolean isUsesGlobal()

setUsesGlobal

public void setUsesGlobal(boolean isUsesGlobal)

isOutUsed

public boolean isOutUsed()
Returns true if the out is used.


setOutUsed

public void setOutUsed()
Set true if the out is used.


isReadOnly

public boolean isReadOnly()
Returns true for a read-only function, i.e. no values are changed.


setModified

public void setModified()
True for a non-read-only function


createVar

public VarInfo createVar(java.lang.String name)

createVar

public VarInfo createVar(StringValue name)
Returns the variable.


createVarInfo

protected VarInfo createVarInfo(StringValue name)

getVariables

public java.util.Collection<VarInfo> getVariables()
Returns the variables.


addTempVar

public void addTempVar(java.lang.String name)
Adds a temp variable.


getTempVariables

public java.util.Collection<java.lang.String> getTempVariables()
Returns the temp variables.


getTempIndex

public int getTempIndex()

createTempVar

public java.lang.String createTempVar()

toString

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