| java.lang.Object oscript.compiler.CompilerContext
CompilerContext | public class CompilerContext (Code) | | The syntax-tree (parse-tree) does not simply translate into a single
NodeEvaluator. Instead, functions defined within the file,
etc., also turn into "nested" NodeEvaluators. Each nested
NodeEvaluator results in construction of a new compiler
(CompilerVisitor), which contributes an additional
evalNodeX to the same classfile......
|
Method Summary | |
void | addSMITs(int evalNodeIdx, int[] smitIdxs) For each function, in addition to having an specific eval method,
has a SMIT. | final static CompiledNodeEvaluator | compileNode(String name, Node node) | int | fieldref(String className, String methodName, String sig) | int | getInstanceConstantIdx(Object obj) Get the instance variable index of the specified object. | int | getNextEvalNodeIdx(String name) Get the index used for the name of the next evalNodeX()
method. | static org.apache.bcel.generic.Type | getPrimitiveType(Class c) | static org.apache.bcel.generic.Type | getType(Class c) | int | ifmethodref(String className, String methodName, String sig) | static Class | makeAccessible(Class c) | int | makeField(String name, Class cls) | static String | makeUniqueIdentifierName(String name) | int | methodref(String className, String methodName, String sig) | void | pushFunctionData(InstructionList il, int id, int[] argIds, boolean varargs, int extendsIdx, int fxnIdx, int staticIdx, boolean hasVarInScope, boolean hasFxnInScope, Value comment) | void | pushInstanceConstant(InstructionList il, Object obj) push the instance constant onto the stack, setting ret-val to true. | void | pushInt(InstructionList il, int i) | void | pushSymbol(InstructionList il, String name) Push symbol id (int) on stack. |
ANY_EXCEPTION_TYPE | final static ObjectType ANY_EXCEPTION_TYPE(Code) | | |
DEBUG | final public static boolean DEBUG(Code) | | |
EMPTY_ARG_IDS | final public static int[] EMPTY_ARG_IDS(Code) | | |
EVAL_NODE_ARG_NAMES | final static String[] EVAL_NODE_ARG_NAMES(Code) | | |
EVAL_NODE_ARG_TYPES | final static org.apache.bcel.generic.Type[] EVAL_NODE_ARG_TYPES(Code) | | |
EXCEPTION_TYPE | final static ObjectType EXCEPTION_TYPE(Code) | | |
OBJECT_TYPE | final static org.apache.bcel.generic.Type OBJECT_TYPE(Code) | | Note, conflict between org.apache.bcel.generic.Type and oscript.data.Type.
|
SCOPE_TYPE | final static org.apache.bcel.generic.Type SCOPE_TYPE(Code) | | |
STRING_TYPE | final static org.apache.bcel.generic.Type STRING_TYPE(Code) | | |
SYMBOL_TABLE_TYPE | final static org.apache.bcel.generic.Type SYMBOL_TABLE_TYPE(Code) | | |
VALUE_ARRAY_TYPE | final static org.apache.bcel.generic.Type VALUE_ARRAY_TYPE(Code) | | |
VALUE_TYPE | final static org.apache.bcel.generic.Type VALUE_TYPE(Code) | | |
cg | ClassGen cg(Code) | | The class that is being built.
|
className | String className(Code) | | The name of the class that is generated.
|
cp | ConstantPoolGen cp(Code) | | The constant-pool of the class that is being built.
|
failed | public static int failed(Code) | | |
succeeded | public static int succeeded(Code) | | |
addSMITs | void addSMITs(int evalNodeIdx, int[] smitIdxs)(Code) | | For each function, in addition to having an specific eval method,
has a SMIT. The CompilerContext needs to know it's index, so it
can generate an accessor method.
|
getInstanceConstantIdx | int getInstanceConstantIdx(Object obj)(Code) | | Get the instance variable index of the specified object. The first
time this is called with a given object, this creates an member
variable within the constructed class.
|
getNextEvalNodeIdx | int getNextEvalNodeIdx(String name)(Code) | | Get the index used for the name of the next evalNodeX()
method. This is tracked here so an evalInnerNode switch method
can be constructed with the appropriate number of cases
The generated method corresponding to this index, should have the name
"_" + idx + "_" + name
|
getPrimitiveType | static org.apache.bcel.generic.Type getPrimitiveType(Class c)(Code) | | |
getType | static org.apache.bcel.generic.Type getType(Class c)(Code) | | |
pushFunctionData | void pushFunctionData(InstructionList il, int id, int[] argIds, boolean varargs, int extendsIdx, int fxnIdx, int staticIdx, boolean hasVarInScope, boolean hasFxnInScope, Value comment)(Code) | | push FunctionData on the stack, but cached
|
pushInstanceConstant | void pushInstanceConstant(InstructionList il, Object obj)(Code) | | push the instance constant onto the stack, setting ret-val to true.
|
pushInt | void pushInt(InstructionList il, int i)(Code) | | |
pushSymbol | void pushSymbol(InstructionList il, String name)(Code) | | Push symbol id (int) on stack. Note that the numeric value of the
symbol may be different on differerent invocations of the script
engine. In the case of SymbolTable s, this is taken
into account when serializing, so when the table is re-created it
is using the current numeric values of the symbol.
the current symbol value (ie. with the current symbol table,but could be different when code is reloaded into a differentinvokation of the script env) |
|
|