|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pnuts.lang.PnutsFunction
A PnutsFunction represents a group of Pnuts functions with a same name.
Field Summary | |
static PnutsFunction |
CATCH
|
static PnutsFunction |
CLASS
|
static PnutsFunction |
DEFINED
|
static PnutsFunction |
EVAL
|
static PnutsFunction |
GET_CONTEXT
|
static PnutsFunction |
IMPORT
|
static PnutsFunction |
LOAD
|
static PnutsFunction |
LOAD_FILE
|
static PnutsFunction |
PACKAGE
|
protected Package |
pkg
|
static PnutsFunction[] |
primitives
|
static PnutsFunction |
QUIT
|
static PnutsFunction |
REQUIRE
|
static PnutsFunction |
THROW
|
static PnutsFunction |
USE
|
Constructor Summary | |
protected |
PnutsFunction()
|
protected |
PnutsFunction(java.lang.String name)
|
Method Summary | |
java.lang.Object |
accept(int narg,
Visitor visitor,
Context context)
|
protected void |
added(int narg)
This method is called when a Function object is registered to this object. |
static void |
autoload(java.lang.String name,
AutoloadHook loadHook)
|
static void |
autoload(java.lang.String name,
java.lang.String file)
register "name" as an autoloaded function. |
java.lang.Object |
call(java.lang.Object[] args)
call a function with arguments "args" |
java.lang.Object |
call(java.lang.Object[] args,
Context context)
Call a function in "context" with arguments "args". |
static java.lang.Object |
call(java.lang.String name,
java.lang.Object[] args)
call a function "name" with arguments "args" |
static java.lang.Object |
call(java.lang.String name,
java.lang.Object[] args,
Context context)
call a function "name" in "context" with arguments "args" |
static java.lang.Object |
call(java.lang.String name,
java.lang.Object[] args,
java.lang.String pkg)
call a function "pkg::name" with arguments "args" |
boolean |
defined(int narg)
Check if the function with narg parameter is defined |
protected java.util.Enumeration |
elements()
|
protected java.lang.Object |
exec(java.lang.Object[] args,
Context context)
Call a function in "context" with arguments "args". |
protected Function |
get(int narg)
|
java.lang.String[] |
getImportEnv(int narg)
|
java.lang.String |
getName()
|
Package |
getPackage()
|
Package |
getPackage(int narg)
Deprecated. |
boolean |
isBuiltin()
|
protected void |
put(int narg,
Function f)
|
java.lang.String |
toString()
|
java.lang.String |
unparse(int narg)
Retrieve the symbolic definition of the function. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final PnutsFunction GET_CONTEXT
public static final PnutsFunction PACKAGE
public static final PnutsFunction IMPORT
public static final PnutsFunction CATCH
public static final PnutsFunction THROW
public static final PnutsFunction EVAL
public static final PnutsFunction LOAD_FILE
public static final PnutsFunction LOAD
public static final PnutsFunction QUIT
public static final PnutsFunction DEFINED
public static final PnutsFunction USE
public static final PnutsFunction CLASS
public static final PnutsFunction REQUIRE
public static final PnutsFunction[] primitives
protected transient Package pkg
Constructor Detail |
protected PnutsFunction()
protected PnutsFunction(java.lang.String name)
Method Detail |
public static void autoload(java.lang.String name, java.lang.String file)
public static void autoload(java.lang.String name, AutoloadHook loadHook)
protected final void put(int narg, Function f)
protected void added(int narg)
narg
- the number of parametersprotected final Function get(int narg)
public boolean defined(int narg)
narg
- the number of paramters. -1 means a arbitrary length parameter.public java.lang.String getName()
public final java.lang.Object call(java.lang.Object[] args, Context context)
protected java.lang.Object exec(java.lang.Object[] args, Context context)
public final java.lang.Object call(java.lang.Object[] args)
public java.lang.String toString()
public static java.lang.Object call(java.lang.String name, java.lang.Object[] args, java.lang.String pkg)
public static java.lang.Object call(java.lang.String name, java.lang.Object[] args, Context context)
public static java.lang.Object call(java.lang.String name, java.lang.Object[] args)
public java.lang.String unparse(int narg)
narg
- the number of paramters. -1 means a arbitrary length parameter.public Package getPackage(int narg)
narg
- the number of paramters. -1 means a arbitrary length parameter.public Package getPackage()
public java.lang.String[] getImportEnv(int narg)
narg
- the number of paramters. -1 means a arbitrary length parameter.public boolean isBuiltin()
public java.lang.Object accept(int narg, Visitor visitor, Context context)
narg
- the number of paramters. -1 means a arbitrary length parameter.protected java.util.Enumeration elements()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |