com.caucho.quercus.program
Class AbstractFunction

java.lang.Object
  extended by com.caucho.quercus.program.AbstractFunction
Direct Known Subclasses:
AbstractJavaMethod, CompiledFunction, CompiledFunctionRef, Function, UndefinedFunction, UnsetFunction

public abstract class AbstractFunction
extends java.lang.Object

Represents a function


Field Summary
protected  java.lang.String _declaringClassName
           
protected  int _parseIndex
           
protected  Visibility _visibility
           
 
Constructor Summary
AbstractFunction()
           
AbstractFunction(Location location)
           
 
Method Summary
 Value call(Env env)
          Evaluates the function.
 Value call(Env env, Expr[] exprs)
          Evaluates the function.
 Value call(Env env, Value a1)
          Evaluates the function with an argument .
abstract  Value call(Env env, Value[] args)
          Evaluates the function.
 Value call(Env env, Value a1, Value a2)
          Evaluates the function with arguments
 Value call(Env env, Value a1, Value a2, Value a3)
          Evaluates the function with arguments
 Value call(Env env, Value a1, Value a2, Value a3, Value a4)
          Evaluates the function with arguments
 Value call(Env env, Value a1, Value a2, Value a3, Value a4, Value a5)
          Evaluates the function with arguments
 Value callCopy(Env env, Expr[] exprs)
          Evaluates the function.
 Value callCopy(Env env, Value[] args)
          Evaluates the function, returning a copy
 Value callMethod(Env env, Value obj)
          Evaluates the function as a method call.
 Value callMethod(Env env, Value obj, Expr[] exprs)
          Evaluates the function.
 Value callMethod(Env env, Value obj, Value a1)
          Evaluates the function as a method call.
 Value callMethod(Env env, Value obj, Value[] args)
          Evaluates the function as a method call.
 Value callMethod(Env env, Value obj, Value a1, Value a2)
          Evaluates the function as a method call.
 Value callMethod(Env env, Value obj, Value a1, Value a2, Value a3)
          Evaluates the function as a method call.
 Value callMethod(Env env, Value obj, Value a1, Value a2, Value a3, Value a4)
          Evaluates the function as a method call.
 Value callMethod(Env env, Value obj, Value a1, Value a2, Value a3, Value a4, Value a5)
          Evaluates the function as a method call.
 Value callMethodRef(Env env, Value obj)
          Evaluates the function as a method call.
 Value callMethodRef(Env env, Value obj, Expr[] exprs)
          Evaluates the function.
 Value callMethodRef(Env env, Value obj, Value a1)
          Evaluates the function as a method call.
 Value callMethodRef(Env env, Value obj, Value[] args)
          Evaluates the function as a method call, returning a reference.
 Value callMethodRef(Env env, Value obj, Value a1, Value a2)
          Evaluates the function as a method call.
 Value callMethodRef(Env env, Value obj, Value a1, Value a2, Value a3)
          Evaluates the function as a method call.
 Value callMethodRef(Env env, Value obj, Value a1, Value a2, Value a3, Value a4)
          Evaluates the function as a method call.
 Value callMethodRef(Env env, Value obj, Value a1, Value a2, Value a3, Value a4, Value a5)
          Evaluates the function as a method call.
 Value callRef(Env env)
          Evaluates the function.
 Value callRef(Env env, Expr[] exprs)
          Evaluates the function.
 Value callRef(Env env, Value a1)
          Evaluates the function with an argument .
 Value callRef(Env env, Value[] args)
          Evaluates the function, returning a reference.
 Value callRef(Env env, Value a1, Value a2)
          Evaluates the function with arguments
 Value callRef(Env env, Value a1, Value a2, Value a3)
          Evaluates the function with arguments
 Value callRef(Env env, Value a1, Value a2, Value a3, Value a4)
          Evaluates the function with arguments
 Value callRef(Env env, Value a1, Value a2, Value a3, Value a4, Value a5)
          Evaluates the function with arguments
protected  Value errorPrivateAccess(Env env, Value oldThis)
           
protected  Value errorProtectedAccess(Env env, Value oldThis)
           
 Value[] evalArguments(Env env, Expr fun, Expr[] args)
          Binds the user's arguments to the actual arguments.
 AbstractFunction getActualFunction(int actualArgs)
          Returns the actual function
 Arg[] getArgs()
          Returns the args.
 java.lang.String getCompilationName()
           
 ClassDef getDeclaringClass()
           
 java.lang.String getDeclaringClassName()
           
 Location getLocation()
           
 java.lang.String getName()
           
 boolean isAbstract()
          Returns true for an abstract function.
 boolean isBoolean()
          Returns true for a boolean function.
 boolean isCallUsesSymbolTable()
          Returns true if the function uses/modifies the local symbol table
 boolean isCallUsesVariableArgs()
          Returns true if the function uses variable args.
 boolean isDouble()
          Returns true for a double function.
 boolean isFinal()
           
 boolean isGlobal()
          Returns true for a global function.
 boolean isLong()
          Returns true for a long function.
 boolean isPrivate()
           
 boolean isProtected()
           
 boolean isPublic()
           
 boolean isReturnsReference()
          True for a returns reference.
 boolean isStatic()
           
 boolean isString()
          Returns true for a string function.
 void setDeclaringClassName(java.lang.String name)
           
 void setFinal(boolean isFinal)
           
 void setGlobal(boolean isGlobal)
          Returns true for a global function.
 void setParseIndex(int index)
           
 void setVisibility(Visibility v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_visibility

protected Visibility _visibility

_declaringClassName

protected java.lang.String _declaringClassName

_parseIndex

protected int _parseIndex
Constructor Detail

AbstractFunction

public AbstractFunction()

AbstractFunction

public AbstractFunction(Location location)
Method Detail

getName

public java.lang.String getName()

getCompilationName

public final java.lang.String getCompilationName()

getDeclaringClassName

public java.lang.String getDeclaringClassName()

setDeclaringClassName

public void setDeclaringClassName(java.lang.String name)

getDeclaringClass

public ClassDef getDeclaringClass()

isGlobal

public final boolean isGlobal()
Returns true for a global function.


isAbstract

public boolean isAbstract()
Returns true for an abstract function.


isStatic

public boolean isStatic()

isFinal

public final boolean isFinal()

setFinal

public final void setFinal(boolean isFinal)

isPublic

public final boolean isPublic()

isProtected

public final boolean isProtected()

isPrivate

public final boolean isPrivate()

setVisibility

public final void setVisibility(Visibility v)

setParseIndex

public final void setParseIndex(int index)

getLocation

public final Location getLocation()

setGlobal

public final void setGlobal(boolean isGlobal)
Returns true for a global function.


isBoolean

public boolean isBoolean()
Returns true for a boolean function.


isString

public boolean isString()
Returns true for a string function.


isLong

public boolean isLong()
Returns true for a long function.


isDouble

public boolean isDouble()
Returns true for a double function.


isCallUsesVariableArgs

public boolean isCallUsesVariableArgs()
Returns true if the function uses variable args.


isCallUsesSymbolTable

public boolean isCallUsesSymbolTable()
Returns true if the function uses/modifies the local symbol table


isReturnsReference

public boolean isReturnsReference()
True for a returns reference.


getArgs

public Arg[] getArgs()
Returns the args.


getActualFunction

public AbstractFunction getActualFunction(int actualArgs)
Returns the actual function


evalArguments

public Value[] evalArguments(Env env,
                             Expr fun,
                             Expr[] args)
Binds the user's arguments to the actual arguments.

Parameters:
args - the user's arguments
Returns:
the user arguments augmented by any defaults

call

public abstract Value call(Env env,
                           Value[] args)
Evaluates the function.


callRef

public Value callRef(Env env,
                     Value[] args)
Evaluates the function, returning a reference.


callCopy

public Value callCopy(Env env,
                      Value[] args)
Evaluates the function, returning a copy


callMethod

public Value callMethod(Env env,
                        Value obj,
                        Value[] args)
Evaluates the function as a method call.


errorProtectedAccess

protected Value errorProtectedAccess(Env env,
                                     Value oldThis)

errorPrivateAccess

protected Value errorPrivateAccess(Env env,
                                   Value oldThis)

callMethodRef

public Value callMethodRef(Env env,
                           Value obj,
                           Value[] args)
Evaluates the function as a method call, returning a reference.


call

public Value call(Env env)
Evaluates the function.


call

public Value call(Env env,
                  Value a1)
Evaluates the function with an argument .


call

public Value call(Env env,
                  Value a1,
                  Value a2)
Evaluates the function with arguments


call

public Value call(Env env,
                  Value a1,
                  Value a2,
                  Value a3)
Evaluates the function with arguments


call

public Value call(Env env,
                  Value a1,
                  Value a2,
                  Value a3,
                  Value a4)
Evaluates the function with arguments


call

public Value call(Env env,
                  Value a1,
                  Value a2,
                  Value a3,
                  Value a4,
                  Value a5)
Evaluates the function with arguments


call

public Value call(Env env,
                  Expr[] exprs)
Evaluates the function.


callCopy

public Value callCopy(Env env,
                      Expr[] exprs)
Evaluates the function.


callRef

public Value callRef(Env env)
Evaluates the function.


callRef

public Value callRef(Env env,
                     Value a1)
Evaluates the function with an argument .


callRef

public Value callRef(Env env,
                     Value a1,
                     Value a2)
Evaluates the function with arguments


callRef

public Value callRef(Env env,
                     Value a1,
                     Value a2,
                     Value a3)
Evaluates the function with arguments


callRef

public Value callRef(Env env,
                     Value a1,
                     Value a2,
                     Value a3,
                     Value a4)
Evaluates the function with arguments


callRef

public Value callRef(Env env,
                     Value a1,
                     Value a2,
                     Value a3,
                     Value a4,
                     Value a5)
Evaluates the function with arguments


callRef

public Value callRef(Env env,
                     Expr[] exprs)
Evaluates the function.


callMethod

public Value callMethod(Env env,
                        Value obj)
Evaluates the function as a method call.


callMethod

public Value callMethod(Env env,
                        Value obj,
                        Value a1)
Evaluates the function as a method call.


callMethod

public Value callMethod(Env env,
                        Value obj,
                        Value a1,
                        Value a2)
Evaluates the function as a method call.


callMethod

public Value callMethod(Env env,
                        Value obj,
                        Value a1,
                        Value a2,
                        Value a3)
Evaluates the function as a method call.


callMethod

public Value callMethod(Env env,
                        Value obj,
                        Value a1,
                        Value a2,
                        Value a3,
                        Value a4)
Evaluates the function as a method call.


callMethod

public Value callMethod(Env env,
                        Value obj,
                        Value a1,
                        Value a2,
                        Value a3,
                        Value a4,
                        Value a5)
Evaluates the function as a method call.


callMethod

public Value callMethod(Env env,
                        Value obj,
                        Expr[] exprs)
Evaluates the function.


callMethodRef

public Value callMethodRef(Env env,
                           Value obj)
Evaluates the function as a method call.


callMethodRef

public Value callMethodRef(Env env,
                           Value obj,
                           Value a1)
Evaluates the function as a method call.


callMethodRef

public Value callMethodRef(Env env,
                           Value obj,
                           Value a1,
                           Value a2)
Evaluates the function as a method call.


callMethodRef

public Value callMethodRef(Env env,
                           Value obj,
                           Value a1,
                           Value a2,
                           Value a3)
Evaluates the function as a method call.


callMethodRef

public Value callMethodRef(Env env,
                           Value obj,
                           Value a1,
                           Value a2,
                           Value a3,
                           Value a4)
Evaluates the function as a method call.


callMethodRef

public Value callMethodRef(Env env,
                           Value obj,
                           Value a1,
                           Value a2,
                           Value a3,
                           Value a4,
                           Value a5)
Evaluates the function as a method call.


callMethodRef

public Value callMethodRef(Env env,
                           Value obj,
                           Expr[] exprs)
Evaluates the function.