|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pnuts.lang.Runtime | +--pnuts.lang.Function
This class represents a function with a certain number of parameters. In Pnuts, functions should be accessed through PnutsFunction. This class is used mainly by compiler implementors. Note that there is no way to create a Function object through public API.
Field Summary | |
protected java.lang.String |
file
file name in which this function is defined |
protected java.lang.String |
funcName
name of the function including the scope information |
protected PnutsFunction |
function
reference to PnutsFunction |
protected pnuts.lang.ImportEnv |
importEnv
"import" environment |
protected java.lang.String[] |
locals
local parameters |
protected java.lang.String |
name
name of the function without the scope information |
protected int |
nargs
the number of arguments |
protected SimpleNode |
node
reference to the definition |
protected Function |
outer
reference to the outer function |
protected Package |
pkg
|
protected java.lang.String |
pkgName
the package name in which this function is defined |
Constructor Summary | |
protected |
Function()
|
protected |
Function(java.lang.String func,
java.lang.String[] locals,
int nargs,
SimpleNode node,
Package pkg,
Context context)
|
Method Summary | |
protected java.lang.Object |
accept(Visitor visitor,
Context context)
|
protected java.lang.Object |
call(java.lang.Object[] args,
Context context)
|
protected java.lang.Object |
exec(java.lang.Object[] args,
Context context)
|
protected java.lang.String |
getFile()
|
java.lang.String |
getName()
|
protected void |
init()
|
protected PnutsFunction |
register(PnutsFunction pf)
|
java.lang.String |
toString()
|
protected java.lang.String |
unparse(Context context)
|
Methods inherited from class pnuts.lang.Runtime |
arrayType,
assignRange,
callConstructor,
callConstructor,
callConstructor,
callFunction,
callMethod,
callMethod,
callMethod,
cast,
catchException,
checkException,
checkException,
doReturn,
getField,
getIndex,
getInterpreter,
getNodes,
getStaticField,
isArray,
newInstance,
parseChar,
parseFloat,
parseInt,
parseString,
primitive,
putField,
putStaticField,
quantity,
readSymbolTable,
setInterpreter,
setLine,
writeSymbolTable |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected java.lang.String funcName
protected java.lang.String name
protected int nargs
protected java.lang.String[] locals
protected java.lang.String file
protected SimpleNode node
protected pnuts.lang.ImportEnv importEnv
protected Function outer
protected java.lang.String pkgName
protected PnutsFunction function
protected transient Package pkg
Constructor Detail |
protected Function()
protected Function(java.lang.String func, java.lang.String[] locals, int nargs, SimpleNode node, Package pkg, Context context)
Method Detail |
protected void init()
public java.lang.String getName()
protected java.lang.String getFile()
protected java.lang.Object call(java.lang.Object[] args, Context context)
protected java.lang.Object exec(java.lang.Object[] args, Context context)
protected PnutsFunction register(PnutsFunction pf)
protected java.lang.Object accept(Visitor visitor, Context context)
protected java.lang.String unparse(Context context)
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |