|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpnuts.lang.Runtime
pnuts.lang.Function
public class 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class pnuts.lang.Runtime |
---|
Runtime.Accessor, Runtime.Break, Runtime.Continue, Runtime.FunctionSerializer, Runtime.TypeMap |
Field Summary | |
---|---|
protected Configuration |
config
|
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 pnuts.lang.ModuleList |
moduleList
Used modules |
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 |
protected boolean |
varargs
variable length arugments |
Fields inherited from class pnuts.lang.Runtime |
---|
BOOLEAN_SYMBOL, BYTE_SYMBOL, CHAR_SYMBOL, CLONE, DOUBLE_SYMBOL, EXCEPTOIN_FIELD_SYMBOL, FLOAT_SYMBOL, INT_SYMBOL, LONG_SYMBOL, SHORT_SYMBOL, VOID_SYMBOL |
Constructor Summary | |
---|---|
protected |
Function()
|
protected |
Function(java.lang.String func,
java.lang.String[] locals,
int nargs,
boolean varargs,
SimpleNode node,
Package pkg,
Context context)
|
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()
Returns the name of the function |
protected SimpleNode |
getNode()
|
int |
getNumberOfParameter()
Returns the number of parameters |
Package |
getPackage()
|
java.lang.Object |
getScriptSource()
|
protected PnutsFunction |
register(PnutsFunction pf)
|
protected PnutsFunction |
register(PnutsFunction pf,
boolean isChild)
|
void |
setPackage(Package pkg)
|
java.lang.String |
toString()
|
protected java.lang.String |
unparse(Context context)
|
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 boolean varargs
protected java.lang.String[] locals
protected transient java.lang.Object file
protected SimpleNode node
protected pnuts.lang.ImportEnv importEnv
protected pnuts.lang.ModuleList moduleList
protected Function outer
protected java.lang.String pkgName
protected PnutsFunction function
protected transient Package pkg
protected Configuration config
Constructor Detail |
---|
protected Function()
protected Function(java.lang.String func, java.lang.String[] locals, int nargs, SimpleNode node, Package pkg, Context context)
protected Function(java.lang.String func, java.lang.String[] locals, int nargs, boolean varargs, 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 void setPackage(Package pkg)
public java.lang.String[] getImportEnv()
protected PnutsFunction register(PnutsFunction pf)
protected PnutsFunction register(PnutsFunction pf, boolean isChild)
protected SimpleNode getNode()
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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |