| java.lang.Object java.lang.Runtime pnuts.compiler.Compiler
Compiler | public class Compiler extends Runtime implements Visitor(Code) | | Pnuts to JVM bytecode compiler
|
Inner Class :static class MethodSignatureInfo | |
Inner Class :static class ConstructorSignatureInfo extends MethodSignatureInfo | |
Inner Class :static class FieldSignatureInfo | |
Inner Class :public static class ClassGenerationResult | |
Inner Class :static class CodeLoaderFactory | |
Inner Class :static class PrivilegedCodeLoaderFactory extends CodeLoaderFactory | |
Method Summary | |
public Object | _listElements(SimpleNode node, Context context) | Object | _start(SimpleNode node, Context context, boolean catchJump) | protected Object | accept(SimpleNode node, int idx, Context context) | static void | addConstant(Object n, Context context) | void | addLineInfo(CompileContext cc, int ctx, SimpleNode node) | public Object | addNode(SimpleNode node, Context context) | public Object | andNode(SimpleNode node, Context context) | public Object | applicationNode(SimpleNode node, Context context) | public Object | arrayType(SimpleNode node, Context context) | void | assignGlobal(ClassFile cf, int id, int ctx, int rhs, SimpleNode lhs, CompileContext cc, boolean nopop) | void | assignId(ClassFile cf, int id, int ctx, int rhs, SimpleNode lhs, CompileContext cc, boolean mutable, boolean nopop) | void | assignIndex(ClassFile cf, int id, int ctx, int rhs, SimpleNode lhs, CompileContext cc, boolean nopop) | void | assignMember(ClassFile cf, int id, int ctx, int rhs, SimpleNode lhs, CompileContext cc, boolean nopop) | void | assignRange(ClassFile cf, int id, int ctx, int rhs, SimpleNode lhs, CompileContext cc) | void | assignStaticMember(ClassFile cf, int id, int ctx, int rhs, SimpleNode lhs, CompileContext cc, boolean nopop) | public Object | assignment(SimpleNode node, Context context) | public Object | assignmentAA(SimpleNode node, Context context) | public Object | assignmentDA(SimpleNode node, Context context) | public Object | assignmentEA(SimpleNode node, Context context) | public Object | assignmentLA(SimpleNode node, Context context) | public Object | assignmentMA(SimpleNode node, Context context) | public Object | assignmentOA(SimpleNode node, Context context) | public Object | assignmentPA(SimpleNode node, Context context) | public Object | assignmentRA(SimpleNode node, Context context) | public Object | assignmentRAA(SimpleNode node, Context context) | public Object | assignmentSA(SimpleNode node, Context context) | public Object | assignmentTA(SimpleNode node, Context context) | public static Class | attachClosure(Class cls, PnutsFunction closure, Context context) | public Object | beanDef(SimpleNode node, Context context) | Object | binary(String operator, SimpleNode node, Context context) | public Object | blockNode(SimpleNode node, Context context) | Object | bool(String operator, SimpleNode node, Context context) | void | booleanCheck(int id, ClassFile cf, Context context) | public Object | breakNode(SimpleNode node, Context context) | void | buildArray(SimpleNode node, Context context) | static SimpleNode | buildClosureNode(List nodes, List fieldSigs, Map typeMap) | static void | buildFieldDeclaration(FieldSignatureInfo fsig, List assignmentNodes) | static SimpleNode | buildGetterNode(Class type, String name) | void | buildList(SimpleNode node, Context context) | static SimpleNode | buildMethodFunction(SimpleNode methodDef, MethodSignatureInfo siginfo, Set superMethodNames) | static SimpleNode | buildSetterNode(Class type, String name) | public static Object | buildSubclassInstance(String encodedNode, Context context) | public Object | buildSubclassInstance(SimpleNode node, Context context) | boolean | canConstantFold(SimpleNode node) | static String | capitalize(String name) | public Object | castExpression(SimpleNode node, Context context) | public Object | catchBlock(SimpleNode node, Context context) | public Object | catchNode(SimpleNode node, Context context) | public Object | characterNode(SimpleNode node, Context context) | public Object | classDef(SimpleNode node, Context context) | public Object | classDefBody(SimpleNode node, Context context) | public Object | className(SimpleNode node, Context context) | public Object | classNode(SimpleNode node, Context context) | public Object | classScript(SimpleNode node, Context context) | static Map | collectThisReferences(SimpleNode node, Set superMethodNames) | static void | collectThisReferences(SimpleNode node, Map frefs, Set superMethodNames) | public Object | compile(Pnuts pnuts, ClassFileHandler handler) Compile a parsed expression. | Object | compile(Pnuts pnuts, ClassFileHandler handler, CompileContext cc) | public Pnuts | compile(Pnuts pnuts, Context context) Compile a parsed expression.
Parameters: pnuts - a parsed expression to be compiled Parameters: context - a context in which the expression is compiled. | public Pnuts | compile(String expression) Compile an expression.
Parameters: expression - an expression to be compiled. | public Pnuts | compile(String expression, Context context) Compile an expression.
Parameters: expression - an expression to be compiled Parameters: context - a context in which the expression is compiled. | public Object | compile(PnutsFunction pf, ClassFileHandler handler) Compile a function group. | public PnutsFunction | compile(PnutsFunction pf) Compile a function group
Parameters: pf - a function group to be compiled. | public PnutsFunction | compile(PnutsFunction pf, Context context) Compile a function group
Parameters: pf - a function group to be compiled. Parameters: context - a context in which the function is compiled. | public ClassFile | compileClassScript(SimpleNode classScriptNode, Object scriptSource, List helperClassFiles) | public Object | compileClassScript(Reader reader, Object scriptSource, ClassFileHandler handler) | void | compute(ClassFile cf, int id, int ctx) | public Object | continueNode(SimpleNode node, Context context) | static void | convertIndexNode(SimpleNode node) | static CodeLoader | createCodeLoader(ClassLoader loader, boolean privileged) Create a class loader to load compiled code. | public static CodeLoader | createCodeLoader(ClassLoader loader) | static String | decapitalize(String name) | public Class | defineClass(String encodedNode, Context context) | public Class | defineClass(SimpleNode node, Context context) | public Object | divideNode(SimpleNode node, Context context) | public Object | doStatement(SimpleNode node, Context context) | public Object | equalNode(SimpleNode node, Context context) | void | error(ClassFile cf, String keyword, CompileContext cc) | void | error(ClassFile cf, String keyword, int[] locals, CompileContext cc) | void | errorSymbol(ClassFile cf, String keyword, int stringConstant, CompileContext cc) | protected Object | execute(CompileContext cc, Context context, boolean catchJump) | public Object | expressionList(SimpleNode node, Context context) | public Object | falseNode(SimpleNode node, Context context) | public Object | finallyNode(SimpleNode node, Context context) | public Object | floatingNode(SimpleNode node, Context context) | public Object | forStatement(SimpleNode node, Context context) | public Object | foreachStatement(SimpleNode node, Context context) | public Object | functionStatement(SimpleNode node, Context context) | public Object | geNode(SimpleNode node, Context context) | public ClassGenerationResult | generateClass(SimpleNode node, Context context) | static ClassGenerationResult | generateClass(String className, String scriptFile, SimpleNode classDefBody, ClassSpec superclassSpec, ClassSpec[] interfaces, List importNodes, Compiler compiler, CompileContext cc) | static ClassGenerationResult | generateClass(String className, String scriptFile, List methodSigs, List constructorSigs, List fieldSigs, Set superMethodNames, ClassSpec superclassSpec, ClassSpec[] interfaces, List importNodes, Compiler compiler, CompileContext cc) | void | generateClass(SimpleNode classDefBody, String className, ClassSpec superclassSpec, List interfaces, List importNodes, CompileContext cc) | static String | gensym(Context context) | SimpleNode | getClassDefNode(SimpleNode node, Context cc) | static SimpleNode | getClassDefNode(String className, boolean isInterface, SimpleNode typeNode, SimpleNode classDefBody) | static String | getClassName(SimpleNode node) | static CodeLoader | getCodeLoader(Context context) | static String | getPackageName(SimpleNode node) | static void | getRef(Reference ref, CompileContext cc) | public static Signature | getterSignature(Class type, String name) | public Object | global(SimpleNode node, Context context) | public Object | gtNode(SimpleNode node, Context context) | static void | handleClassDefBody(SimpleNode classDefBody, List methodSigs, List constructorSigs, List fieldSigs, Set superMethodNames) | static ConstructorSignatureInfo | handleConstructorDef(SimpleNode defNode, Set superMethodNames) | static FieldSignatureInfo | handleFieldDef(SimpleNode defNode) | static MethodSignatureInfo | handleMethodDef(SimpleNode methodDef, Set superMethodNames) | public Object | idNode(SimpleNode node, Context context) | public Object | ifStatement(SimpleNode node, Context context) | public Object | importNode(SimpleNode node, Context context) | boolean | inControl(SimpleNode node, CompileContext cc) | public void | includeColumnNo(boolean flag) | public void | includeLineNo(boolean flag) | public void | includeMainMethod(boolean flag) | public Object | indexNode(SimpleNode node, Context context) | public Object | instanceofExpression(SimpleNode node, Context context) | public Object | integerNode(SimpleNode node, Context context) | public static boolean | isCompiled(Object obj) | static boolean | isConditionalNode(SimpleNode node) | static boolean | isConstant(SimpleNode node) | static boolean | isLeafFrame(SimpleNode node) | public Object | leNode(SimpleNode node, Context context) | public Object | listElements(SimpleNode node, Context context) | public static Class | loadBytecode(String name, String encodedBytecode, PnutsFunction closure, Context context) | public Object | logAndNode(SimpleNode node, Context context) | public Object | logNotNode(SimpleNode node, Context context) | public Object | logOrNode(SimpleNode node, Context context) | public Object | ltNode(SimpleNode node, Context context) | public Object | mapNode(SimpleNode node, Context context) | static void | markMemberNodeInBeanDef(SimpleNode beanPropertyDef, int targetIndex, int tableIndex, SimpleNode node) | public Object | memberNode(SimpleNode node, Context context) | public Object | methodDef(SimpleNode node, Context context) | public Object | methodNode(SimpleNode node, Context context) | public Object | modNode(SimpleNode node, Context context) | public Object | multNode(SimpleNode node, Context context) | Object | multiAssign(SimpleNode lhs, SimpleNode rhs, Context context) | Object | multiAssignFast(SimpleNode lhs, SimpleNode rhs, Context context) | public Object | negativeNode(SimpleNode node, Context context) | public Object | newNode(SimpleNode node, Context context) | public Object | notEqNode(SimpleNode node, Context context) | public Object | notNode(SimpleNode node, Context context) | public Object | nullNode(SimpleNode node, Context context) | public Object | orNode(SimpleNode node, Context context) | static String | packageName(SimpleNode node) | public Object | packageNode(SimpleNode node, Context context) | static Object[] | parseIndex(SimpleNode node) | public Object | postDecrNode(SimpleNode node, Context context) | public Object | postIncrNode(SimpleNode node, Context context) | public Object | preDecrNode(SimpleNode node, Context context) | public Object | preIncrNode(SimpleNode node, Context context) | void | preprocess(SimpleNode node) | public Object | rangeNode(SimpleNode node, Context context) | static void | renameIDs(SimpleNode node, String name) | void | resolveClassName(SimpleNode nameNode, CompileContext cc, int ctx) | static Signature | resolveSignature(MethodSignatureInfo methodSig, Context context) | static Signature | resolveSignature(ConstructorSignatureInfo constructorSig, Context context) | void | resolveType(SimpleNode typeNode, CompileContext cc, int ctx) | public Object | returnNode(SimpleNode node, Context context) | static boolean | scanLeafFrames(SimpleNode node) | public void | setConstantFolding(boolean flag) | public void | setTraceMode(boolean mode) | public static Signature | setterSignature(Class type, String name) | public Object | shiftArithmeticNode(SimpleNode node, Context context) | public Object | shiftLeftNode(SimpleNode node, Context context) | public Object | shiftRightNode(SimpleNode node, Context context) | static String[] | split(String s, char delim) | public Object | start(SimpleNode node, Context context) | public Object | startSet(SimpleNode node, Context context) | void | staticBlock(ClassFile cf, SimpleNode closureNode, CompileContext cc) | public Object | staticMemberNode(SimpleNode node, Context context) | public Object | staticMethodNode(SimpleNode node, Context context) | public Object | stringNode(SimpleNode node, Context context) | public Object | subtractNode(SimpleNode node, Context context) | public Object | switchBlock(SimpleNode node, Context context) | public Object | switchStatement(SimpleNode node, Context context) | public Object | ternary(SimpleNode node, Context context) | public Object | throwNode(SimpleNode node, Context context) | public Object | trueNode(SimpleNode node, Context context) | public Object | tryStatement(SimpleNode node, Context context) | Object | unary(String operator, SimpleNode node, Context context) | static void | updateMethodSignatureInfo(MethodSignatureInfo sig, String fieldName) | static void | updateMethodSignatureInfo(List sigs, String fieldName) | public void | useDynamicProxy(boolean flag) | public Object | whileStatement(SimpleNode node, Context context) | public Object | xorNode(SimpleNode node, Context context) | public Object | yieldNode(SimpleNode node, Context context) |
METHOD_FACTORY_FUNCTION | final static String METHOD_FACTORY_FUNCTION(Code) | | |
_constantFolding | boolean _constantFolding(Code) | | |
_includeColumnNo | boolean _includeColumnNo(Code) | | |
_includeLineNo | boolean _includeLineNo(Code) | | |
automatic | boolean automatic(Code) | | |
codeLoaderFactory | static CodeLoaderFactory codeLoaderFactory(Code) | | |
hasBootClassLoader | static boolean hasBootClassLoader(Code) | | |
hasJava2Security | static boolean hasJava2Security(Code) | | |
hasValueOfPrimitive | static boolean hasValueOfPrimitive(Code) | | |
includeMainMethod | boolean includeMainMethod(Code) | | |
privilegedCodeLoaderFactory | static CodeLoaderFactory privilegedCodeLoaderFactory(Code) | | |
traceMode | boolean traceMode(Code) | | |
useDynamicProxy | boolean useDynamicProxy(Code) | | |
Compiler | public Compiler()(Code) | | |
Compiler | public Compiler(String className, boolean automatic)(Code) | | |
Compiler | public Compiler(String className, boolean automatic, boolean useDynamicProxy)(Code) | | |
buildFieldDeclaration | static void buildFieldDeclaration(FieldSignatureInfo fsig, List assignmentNodes)(Code) | | |
collectThisReferences | static void collectThisReferences(SimpleNode node, Map frefs, Set superMethodNames)(Code) | | |
compile | public Pnuts compile(Pnuts pnuts, Context context)(Code) | | Compile a parsed expression.
Parameters: pnuts - a parsed expression to be compiled Parameters: context - a context in which the expression is compiled. a Pnuts object |
compile | public Pnuts compile(String expression)(Code) | | Compile an expression.
Parameters: expression - an expression to be compiled. a Pnuts object. |
compile | public Pnuts compile(String expression, Context context)(Code) | | Compile an expression.
Parameters: expression - an expression to be compiled Parameters: context - a context in which the expression is compiled. a Pnuts object. |
compile | public Object compile(PnutsFunction pf, ClassFileHandler handler)(Code) | | Compile a function group. The resulting bytecode is handled by a
ClassFileHandler.
Parameters: pf - a function group. Parameters: handler - the resulting bytecode is handle by this object. the result of handler.getResult() method. |
compile | public PnutsFunction compile(PnutsFunction pf)(Code) | | Compile a function group
Parameters: pf - a function group to be compiled. a compiled version of the function group |
compile | public PnutsFunction compile(PnutsFunction pf, Context context)(Code) | | Compile a function group
Parameters: pf - a function group to be compiled. Parameters: context - a context in which the function is compiled. a compiled version of the function group |
createCodeLoader | static CodeLoader createCodeLoader(ClassLoader loader, boolean privileged)(Code) | | Create a class loader to load compiled code.
|
generateClass | static ClassGenerationResult generateClass(String className, String scriptFile, List methodSigs, List constructorSigs, List fieldSigs, Set superMethodNames, ClassSpec superclassSpec, ClassSpec[] interfaces, List importNodes, Compiler compiler, CompileContext cc)(Code) | | |
handleClassDefBody | static void handleClassDefBody(SimpleNode classDefBody, List methodSigs, List constructorSigs, List fieldSigs, Set superMethodNames)(Code) | | |
handleConstructorDef | static ConstructorSignatureInfo handleConstructorDef(SimpleNode defNode, Set superMethodNames)(Code) | | |
handleFieldDef | static FieldSignatureInfo handleFieldDef(SimpleNode defNode)(Code) | | |
handleMethodDef | static MethodSignatureInfo handleMethodDef(SimpleNode methodDef, Set superMethodNames)(Code) | | |
includeColumnNo | public void includeColumnNo(boolean flag)(Code) | | |
includeLineNo | public void includeLineNo(boolean flag)(Code) | | |
includeMainMethod | public void includeMainMethod(boolean flag)(Code) | | |
isCompiled | public static boolean isCompiled(Object obj)(Code) | | Check if an object is compiled
Parameters: obj - an object to be checked true if the object is compiled |
markMemberNodeInBeanDef | static void markMemberNodeInBeanDef(SimpleNode beanPropertyDef, int targetIndex, int tableIndex, SimpleNode node)(Code) | | |
parseIndex | static Object[] parseIndex(SimpleNode node)(Code) | | [base_component_node, [idx_node_0, idx_node_1, ...]] |
resolveSignature | static Signature resolveSignature(ConstructorSignatureInfo constructorSig, Context context)(Code) | | |
setConstantFolding | public void setConstantFolding(boolean flag)(Code) | | |
setTraceMode | public void setTraceMode(boolean mode)(Code) | | |
updateMethodSignatureInfo | static void updateMethodSignatureInfo(MethodSignatureInfo sig, String fieldName)(Code) | | |
updateMethodSignatureInfo | static void updateMethodSignatureInfo(List sigs, String fieldName)(Code) | | |
useDynamicProxy | public void useDynamicProxy(boolean flag)(Code) | | |
|
|