|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoscript.data.Function.FunctionData
In order to keep function instances more lightweight, the values that will be the same for any instance of a function representing the same portion of the parse tree have been split out into this class, in order to be shared between different function instances.
Field Summary | |
boolean |
hasFxnInScope
A hint from the parser about whether scope storage can be allocated from the stack, which can only be done if there are no functions declared within this function |
NodeEvaluator |
program
The node-evaluator for evaluating the body of this function. |
Constructor Summary | |
Function.FunctionData()
|
|
Function.FunctionData(int id,
int[] argIds,
boolean varargs,
NodeEvaluator exprList,
NodeEvaluator program,
NodeEvaluator sprogram,
boolean hasVarInScope,
boolean hasFxnInScope,
Value comment)
Class Constructor. |
Method Summary | |
void |
addArgs(FunctionScope fxnScope,
MemberTable args)
A helper to populate a fxn-scope with args |
Value |
getName()
|
MemberTable |
mapArgs(MemberTable args)
Map arguments to a function into the member-table which is used for a function scope. |
void |
readExternal(java.io.ObjectInput in)
Derived class that implements Externalizable must
call this if it overrides it. |
void |
writeExternal(java.io.ObjectOutput out)
Derived class that implements Externalizable must
call this if it overrides it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public NodeEvaluator program
only public for StackFrame
public boolean hasFxnInScope
only public for StackFrame
Constructor Detail |
public Function.FunctionData(int id, int[] argIds, boolean varargs, NodeEvaluator exprList, NodeEvaluator program, NodeEvaluator sprogram, boolean hasVarInScope, boolean hasFxnInScope, Value comment)
id
- the id of the symbol that maps to the member, ie. it's nameargIds
- array of argument ids and attributesvarargs
- is this a function that can take a variable number of args?exprList
- expressions to evaluate to get args to superFxn
or null
if superFxn
is null
program
- the body of the functionsprogram
- the static body of the function, or null
hasVarInScope
- whether one or more vars/functions are declared in the
function body's scope... this is a hint from the parser to tell us if we
can avoid creating a scope object at runtimehasFxnInScope
- whether one or more functions are enclosed by this function
body's scope... this is a hint from the parser to tell us if we can allocate
scope storage from the stackcomment
- html formatted comment generated from javadoc
comment in src file, or null
public Function.FunctionData()
Method Detail |
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Externalizable
must
call this if it overrides it. It should override it to save/restore
it's own state.
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
Externalizable
must
call this if it overrides it. It should override it to save/restore
it's own state.
writeExternal
in interface java.io.Externalizable
java.io.IOException
public final MemberTable mapArgs(MemberTable args)
addArgs(oscript.data.FunctionScope, oscript.util.MemberTable)
when calling as a function.
XXX this could be used in case of constructor scope, by stripping out private parameters... maybe
args
- the input arguments
public final void addArgs(FunctionScope fxnScope, MemberTable args)
public Value getName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |