|
|||||||||
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.Object |
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 |
exec(java.lang.Object[] args,
Context context)
|
java.lang.String[] |
getImportEnv()
|
java.lang.String |
getName()
|
int |
getNumberOfParameter()
|
Package |
getPackage()
|
java.lang.Object |
getScriptSource()
|
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, binary, call, callConstructor, callConstructor, callConstructor, callFunction, callMethod, callMethod, callMethod, cast, catchException, checkException, checkException, compareTo, escape, exec, execute, fileToURL, format, getBeginLine, getBottomType, getCompiledScript, getEndLine, getField, getFunction, getFunction, getFunctions, getIndex, getRuntime, getScriptSource, getScriptURL, getStaticField, isArray, jump, matchType, namespaceRefreshed, newInstance, parseChar, parseFloat, parseInt, parseString, primitive, printError, putField, putStaticField, quantity, range, readSymbolTable, setLine, setLine, setPackage, transform, unary, 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.Object 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 |
public java.lang.String getName()
public int getNumberOfParameter()
public java.lang.Object getScriptSource()
protected java.lang.Object exec(java.lang.Object[] args, Context context)
public Package getPackage()
public java.lang.String[] getImportEnv()
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()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |