pnuts.compiler
Class Compiler
java.lang.Object
|
+--pnuts.lang.Runtime
|
+--pnuts.compiler.Compiler
- All Implemented Interfaces:
- Constants, Opcode, PnutsParserTreeConstants, Visitor
- public class Compiler
- extends Runtime
- implements Visitor, Opcode, Constants
Pnuts to JVM bytecode compiler
Fields inherited from interface pnuts.compiler.Opcode |
AALOAD, AASTORE, ACONST_NULL, ALOAD, ALOAD_0, ALOAD_1, ALOAD_2, ALOAD_3, ANEWARRAY, ANEWARRAY_QUICK, ARETURN, ARRAYLENGTH, ASTORE, ASTORE_0, ASTORE_1, ASTORE_2, ASTORE_3, ATHROW, BALOAD, BASTORE, BIPUSH, BREAKPOINT, CALOAD, CASTORE, CHECKCAST, CHECKCAST_QUICK, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DDIV, DLOAD, DLOAD_0, DLOAD_1, DLOAD_2, DLOAD_3, DMUL, DNEG, DREM, DRETURN, DSTORE, DSTORE_0, DSTORE_1, DSTORE_2, DSTORE_3, DSUB, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FDIV, FLOAD, FLOAD_0, FLOAD_1, FLOAD_2, FLOAD_3, FMUL, FNEG, FREM, FRETURN, FSTORE, FSTORE_0, FSTORE_1, FSTORE_2, FSTORE_3, FSUB, GETFIELD, GETFIELD_QUICK, GETFIELD_QUICK_W, GETFIELD2_QUICK, GETSTATIC, GETSTATIC_QUICK, GETSTATIC2_QUICK, GOTO, GOTO_W, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IDIV, IF_ACMPEQ, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, IINC, ILOAD, ILOAD_0, ILOAD_1, ILOAD_2, ILOAD_3, IMPDEP1, IMPDEP2, IMUL, INEG, INSTANCEOF, INSTANCEOF_QUICK, INVOKEINTERFACE, INVOKEINTERFACE_QUICK, INVOKENONVIRTUAL_QUICK, INVOKESPECIAL, INVOKESTATIC, INVOKESTATIC_QUICK, INVOKESUPER_QUICK, INVOKEVIRTUAL, INVOKEVIRTUAL_QUICK, INVOKEVIRTUAL_QUICK_W, INVOKEVIRTUALOBJECT_QUICK, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE, ISTORE_0, ISTORE_1, ISTORE_2, ISTORE_3, ISUB, IUSHR, IXOR, JSR, JSR_W, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LDC, LDC_QUICK, LDC_W, LDC_W_QUICK, LDC2_W, LDC2_W_QUICK, LDIV, LLOAD, LLOAD_0, LLOAD_1, LLOAD_2, LLOAD_3, LMUL, LNEG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, LSTORE, LSTORE_0, LSTORE_1, LSTORE_2, LSTORE_3, LSUB, LUSHR, LXOR, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, MULTIANEWARRAY_QUICK, NEW, NEW_QUICK, NEWARRAY, NOP, POP, POP2, PUTFIELD, PUTFIELD_QUICK, PUTFIELD_QUICK_W, PUTFIELD2_QUICK, PUTSTATIC, PUTSTATIC_QUICK, PUTSTATIC2_QUICK, RET, RETURN, SALOAD, SASTORE, SIPUSH, stackGrowth, SWAP, T_BOOLEAN, T_BYTE, T_CHAR, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT, TABLESWITCH, WIDE |
Fields inherited from interface pnuts.compiler.Constants |
ACC_ABSTRACT, ACC_FINAL, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_SYNCHRONIZED, ACC_TRANSIENT, ACC_VOLATILE, CONSTANT_Class, CONSTANT_Double, CONSTANT_Fieldref, CONSTANT_Float, CONSTANT_Integer, CONSTANT_InterfaceMethodref, CONSTANT_Long, CONSTANT_Methodref, CONSTANT_NameAndType, CONSTANT_String, CONSTANT_Utf8 |
Fields inherited from interface pnuts.lang.PnutsParserTreeConstants |
JJTADDNODE, JJTANDNODE, JJTAPPLICATIONNODE, JJTARRAYTYPE, JJTASSIGNMENT, JJTASSIGNMENTAA, JJTASSIGNMENTDA, JJTASSIGNMENTEA, JJTASSIGNMENTLA, JJTASSIGNMENTMA, JJTASSIGNMENTOA, JJTASSIGNMENTPA, JJTASSIGNMENTRA, JJTASSIGNMENTRAA, JJTASSIGNMENTSA, JJTASSIGNMENTTA, JJTBLOCK, JJTBREAK, JJTCASTEXPRESSION, JJTCATCHNODE, JJTCHARACTERNODE, JJTCLASS, JJTCONTINUE, JJTDIVIDENODE, JJTELSEIFNODE, JJTELSENODE, JJTEQUALNODE, JJTEXPRESSIONLIST, JJTFALSENODE, JJTFLOATINGNODE, JJTFOREACHSTATEMENT, JJTFORINIT, JJTFORSTATEMENT, JJTFORUPDATE, JJTFUNCTIONSTATEMENT, JJTGENODE, JJTGLOBAL, JJTGTNODE, JJTIDNODE, JJTIFSTATEMENT, JJTINDEXNODE, JJTINSTANCEOFEXPRESSION, JJTINTEGERNODE, JJTLENODE, JJTLISTELEMENTS, JJTLOCAL, JJTLOGANDNODE, JJTLOGEXORNODE, JJTLOGNOTNODE, JJTLOGORNODE, JJTLTNODE, JJTMEMBERNODE, JJTMETHODNODE, JJTMODNODE, JJTMULTNODE, JJTNEGATIVENODE, jjtNodeName, JJTNOTEQNODE, JJTNOTNODE, JJTNULLNODE, JJTORNODE, JJTPACKAGE, JJTPARAM, JJTPARAMLIST, JJTPOSTDECRNODE, JJTPOSTINCRNODE, JJTPREDECRNODE, JJTPREINCRNODE, JJTRANGENODE, JJTRETURN, JJTSHIFTARITHMETICNODE, JJTSHIFTLEFTNODE, JJTSHIFTRIGHTNODE, JJTSTART, JJTSTARTSET, JJTSTATICMEMBERNODE, JJTSTATICMETHODNODE, JJTSTRINGNODE, JJTSUBTRACTNODE, JJTSWITCHBLOCK, JJTSWITCHLABEL, JJTSWITCHSTATEMENT, JJTTRUENODE, JJTVOID, JJTWHILESTATEMENT |
Constructor Summary |
Compiler()
|
Compiler(java.lang.String className)
|
Compiler(java.lang.String className,
boolean automatic)
|
Compiler(java.lang.String className,
boolean automatic,
boolean useDynamicProxy)
|
Method Summary |
protected java.lang.Object |
accept(SimpleNode node,
int idx,
Context context)
|
java.lang.Object |
addNode(SimpleNode node,
Context context)
|
java.lang.Object |
andNode(SimpleNode node,
Context context)
|
java.lang.Object |
applicationNode(SimpleNode node,
Context context)
|
java.lang.Object |
arrayType(SimpleNode node,
Context context)
|
java.lang.Object |
assignment(SimpleNode node,
Context context)
|
java.lang.Object |
assignmentAA(SimpleNode node,
Context context)
|
java.lang.Object |
assignmentDA(SimpleNode node,
Context context)
|
java.lang.Object |
assignmentEA(SimpleNode node,
Context context)
|
java.lang.Object |
assignmentLA(SimpleNode node,
Context context)
|
java.lang.Object |
assignmentMA(SimpleNode node,
Context context)
|
java.lang.Object |
assignmentOA(SimpleNode node,
Context context)
|
java.lang.Object |
assignmentPA(SimpleNode node,
Context context)
|
java.lang.Object |
assignmentRA(SimpleNode node,
Context context)
|
java.lang.Object |
assignmentRAA(SimpleNode node,
Context context)
|
java.lang.Object |
assignmentSA(SimpleNode node,
Context context)
|
java.lang.Object |
assignmentTA(SimpleNode node,
Context context)
|
java.lang.Object |
blockNode(SimpleNode node,
Context context)
|
java.lang.Object |
breakNode(SimpleNode node,
Context context)
|
java.lang.Object |
castExpression(SimpleNode node,
Context context)
|
java.lang.Object |
catchNode(SimpleNode node,
Context context)
|
java.lang.Object |
characterNode(SimpleNode node,
Context context)
|
java.lang.Object |
classNode(SimpleNode node,
Context context)
|
java.lang.Object |
compile(Pnuts pnuts,
ClassFileHandler handler)
Compile a parsed expression. |
Pnuts |
compile(Pnuts pnuts,
Context context)
Compile a parsed expression. |
PnutsFunction |
compile(PnutsFunction pf)
Compile a function group |
java.lang.Object |
compile(PnutsFunction pf,
ClassFileHandler handler)
Compile a function group. |
PnutsFunction |
compile(PnutsFunction pf,
Context context)
Compile a function group |
Pnuts |
compile(java.lang.String expression)
Compile an expression. |
Pnuts |
compile(java.lang.String expression,
Context context)
Compile an expression. |
java.lang.Object |
continueNode(SimpleNode node,
Context context)
|
static pnuts.compiler.CodeLoader |
createCodeLoader(java.lang.ClassLoader loader)
|
java.lang.Object |
divideNode(SimpleNode node,
Context context)
|
java.lang.Object |
equalNode(SimpleNode node,
Context context)
|
protected java.lang.Object |
execute(CompileContext cc,
Context context,
boolean catchJump)
|
java.lang.Object |
expressionList(SimpleNode node,
Context context)
|
java.lang.Object |
falseNode(SimpleNode node,
Context context)
|
java.lang.Object |
floatingNode(SimpleNode node,
Context context)
|
java.lang.Object |
foreachStatement(SimpleNode node,
Context context)
|
java.lang.Object |
forStatement(SimpleNode node,
Context context)
|
java.lang.Object |
functionStatement(SimpleNode node,
Context context)
|
java.lang.Object |
geNode(SimpleNode node,
Context context)
|
java.lang.Object |
global(SimpleNode node,
Context context)
|
java.lang.Object |
gtNode(SimpleNode node,
Context context)
|
java.lang.Object |
idNode(SimpleNode node,
Context context)
|
java.lang.Object |
ifStatement(SimpleNode node,
Context context)
|
void |
includeLineNo(boolean flag)
|
void |
includeMainMethod(boolean flag)
|
java.lang.Object |
indexNode(SimpleNode node,
Context context)
|
java.lang.Object |
instanceofExpression(SimpleNode node,
Context context)
|
java.lang.Object |
integerNode(SimpleNode node,
Context context)
|
static boolean |
isCompiled(java.lang.Object obj)
Check if an object is compiled |
java.lang.Object |
leNode(SimpleNode node,
Context context)
|
java.lang.Object |
listElements(SimpleNode node,
Context context)
|
java.lang.Object |
logAndNode(SimpleNode node,
Context context)
|
java.lang.Object |
logExorNode(SimpleNode node,
Context context)
|
java.lang.Object |
logNotNode(SimpleNode node,
Context context)
|
java.lang.Object |
logOrNode(SimpleNode node,
Context context)
|
java.lang.Object |
ltNode(SimpleNode node,
Context context)
|
java.lang.Object |
memberNode(SimpleNode node,
Context context)
|
java.lang.Object |
methodNode(SimpleNode node,
Context context)
|
java.lang.Object |
modNode(SimpleNode node,
Context context)
|
java.lang.Object |
multNode(SimpleNode node,
Context context)
|
java.lang.Object |
negativeNode(SimpleNode node,
Context context)
|
java.lang.Object |
notEqNode(SimpleNode node,
Context context)
|
java.lang.Object |
notNode(SimpleNode node,
Context context)
|
java.lang.Object |
nullNode(SimpleNode node,
Context context)
|
java.lang.Object |
orNode(SimpleNode node,
Context context)
|
java.lang.Object |
postDecrNode(SimpleNode node,
Context context)
|
java.lang.Object |
postIncrNode(SimpleNode node,
Context context)
|
java.lang.Object |
preDecrNode(SimpleNode node,
Context context)
|
java.lang.Object |
preIncrNode(SimpleNode node,
Context context)
|
java.lang.Object |
rangeNode(SimpleNode node,
Context context)
|
java.lang.Object |
returnNode(SimpleNode node,
Context context)
|
java.lang.Object |
shiftArithmeticNode(SimpleNode node,
Context context)
|
java.lang.Object |
shiftLeftNode(SimpleNode node,
Context context)
|
java.lang.Object |
shiftRightNode(SimpleNode node,
Context context)
|
java.lang.Object |
start(SimpleNode node,
Context context)
|
java.lang.Object |
startSet(SimpleNode node,
Context context)
|
java.lang.Object |
staticMemberNode(SimpleNode node,
Context context)
|
java.lang.Object |
staticMethodNode(SimpleNode node,
Context context)
|
java.lang.Object |
stringNode(SimpleNode node,
Context context)
|
java.lang.Object |
subtractNode(SimpleNode node,
Context context)
|
java.lang.Object |
switchBlock(SimpleNode node,
Context context)
|
java.lang.Object |
switchStatement(SimpleNode node,
Context context)
|
java.lang.Object |
trueNode(SimpleNode node,
Context context)
|
void |
useDynamicProxy(boolean flag)
|
java.lang.Object |
whileStatement(SimpleNode node,
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, toString, wait, wait, wait |
Compiler
public Compiler()
Compiler
public Compiler(java.lang.String className)
Compiler
public Compiler(java.lang.String className,
boolean automatic)
Compiler
public Compiler(java.lang.String className,
boolean automatic,
boolean useDynamicProxy)
includeLineNo
public void includeLineNo(boolean flag)
includeMainMethod
public void includeMainMethod(boolean flag)
useDynamicProxy
public void useDynamicProxy(boolean flag)
execute
protected java.lang.Object execute(CompileContext cc,
Context context,
boolean catchJump)
startSet
public java.lang.Object startSet(SimpleNode node,
Context context)
- Specified by:
startSet
in interface Visitor
start
public java.lang.Object start(SimpleNode node,
Context context)
- Specified by:
start
in interface Visitor
expressionList
public java.lang.Object expressionList(SimpleNode node,
Context context)
- Specified by:
expressionList
in interface Visitor
integerNode
public java.lang.Object integerNode(SimpleNode node,
Context context)
- Specified by:
integerNode
in interface Visitor
floatingNode
public java.lang.Object floatingNode(SimpleNode node,
Context context)
- Specified by:
floatingNode
in interface Visitor
stringNode
public java.lang.Object stringNode(SimpleNode node,
Context context)
- Specified by:
stringNode
in interface Visitor
characterNode
public java.lang.Object characterNode(SimpleNode node,
Context context)
- Specified by:
characterNode
in interface Visitor
classNode
public java.lang.Object classNode(SimpleNode node,
Context context)
- Specified by:
classNode
in interface Visitor
andNode
public java.lang.Object andNode(SimpleNode node,
Context context)
- Specified by:
andNode
in interface Visitor
orNode
public java.lang.Object orNode(SimpleNode node,
Context context)
- Specified by:
orNode
in interface Visitor
notNode
public java.lang.Object notNode(SimpleNode node,
Context context)
- Specified by:
notNode
in interface Visitor
shiftLeftNode
public java.lang.Object shiftLeftNode(SimpleNode node,
Context context)
- Specified by:
shiftLeftNode
in interface Visitor
shiftRightNode
public java.lang.Object shiftRightNode(SimpleNode node,
Context context)
- Specified by:
shiftRightNode
in interface Visitor
shiftArithmeticNode
public java.lang.Object shiftArithmeticNode(SimpleNode node,
Context context)
- Specified by:
shiftArithmeticNode
in interface Visitor
addNode
public java.lang.Object addNode(SimpleNode node,
Context context)
- Specified by:
addNode
in interface Visitor
subtractNode
public java.lang.Object subtractNode(SimpleNode node,
Context context)
- Specified by:
subtractNode
in interface Visitor
multNode
public java.lang.Object multNode(SimpleNode node,
Context context)
- Specified by:
multNode
in interface Visitor
divideNode
public java.lang.Object divideNode(SimpleNode node,
Context context)
- Specified by:
divideNode
in interface Visitor
negativeNode
public java.lang.Object negativeNode(SimpleNode node,
Context context)
- Specified by:
negativeNode
in interface Visitor
modNode
public java.lang.Object modNode(SimpleNode node,
Context context)
- Specified by:
modNode
in interface Visitor
logExorNode
public java.lang.Object logExorNode(SimpleNode node,
Context context)
- Specified by:
logExorNode
in interface Visitor
logOrNode
public java.lang.Object logOrNode(SimpleNode node,
Context context)
- Specified by:
logOrNode
in interface Visitor
logAndNode
public java.lang.Object logAndNode(SimpleNode node,
Context context)
- Specified by:
logAndNode
in interface Visitor
logNotNode
public java.lang.Object logNotNode(SimpleNode node,
Context context)
- Specified by:
logNotNode
in interface Visitor
ltNode
public java.lang.Object ltNode(SimpleNode node,
Context context)
- Specified by:
ltNode
in interface Visitor
leNode
public java.lang.Object leNode(SimpleNode node,
Context context)
- Specified by:
leNode
in interface Visitor
gtNode
public java.lang.Object gtNode(SimpleNode node,
Context context)
- Specified by:
gtNode
in interface Visitor
geNode
public java.lang.Object geNode(SimpleNode node,
Context context)
- Specified by:
geNode
in interface Visitor
equalNode
public java.lang.Object equalNode(SimpleNode node,
Context context)
- Specified by:
equalNode
in interface Visitor
notEqNode
public java.lang.Object notEqNode(SimpleNode node,
Context context)
- Specified by:
notEqNode
in interface Visitor
ifStatement
public java.lang.Object ifStatement(SimpleNode node,
Context context)
- Specified by:
ifStatement
in interface Visitor
functionStatement
public java.lang.Object functionStatement(SimpleNode node,
Context context)
- Specified by:
functionStatement
in interface Visitor
applicationNode
public java.lang.Object applicationNode(SimpleNode node,
Context context)
- Specified by:
applicationNode
in interface Visitor
blockNode
public java.lang.Object blockNode(SimpleNode node,
Context context)
- Specified by:
blockNode
in interface Visitor
trueNode
public java.lang.Object trueNode(SimpleNode node,
Context context)
- Specified by:
trueNode
in interface Visitor
falseNode
public java.lang.Object falseNode(SimpleNode node,
Context context)
- Specified by:
falseNode
in interface Visitor
nullNode
public java.lang.Object nullNode(SimpleNode node,
Context context)
- Specified by:
nullNode
in interface Visitor
idNode
public java.lang.Object idNode(SimpleNode node,
Context context)
- Specified by:
idNode
in interface Visitor
global
public java.lang.Object global(SimpleNode node,
Context context)
- Specified by:
global
in interface Visitor
listElements
public java.lang.Object listElements(SimpleNode node,
Context context)
- Specified by:
listElements
in interface Visitor
castExpression
public java.lang.Object castExpression(SimpleNode node,
Context context)
- Specified by:
castExpression
in interface Visitor
memberNode
public java.lang.Object memberNode(SimpleNode node,
Context context)
- Specified by:
memberNode
in interface Visitor
methodNode
public java.lang.Object methodNode(SimpleNode node,
Context context)
- Specified by:
methodNode
in interface Visitor
arrayType
public java.lang.Object arrayType(SimpleNode node,
Context context)
- Specified by:
arrayType
in interface Visitor
indexNode
public java.lang.Object indexNode(SimpleNode node,
Context context)
- Specified by:
indexNode
in interface Visitor
instanceofExpression
public java.lang.Object instanceofExpression(SimpleNode node,
Context context)
- Specified by:
instanceofExpression
in interface Visitor
assignment
public java.lang.Object assignment(SimpleNode node,
Context context)
- Specified by:
assignment
in interface Visitor
assignmentTA
public java.lang.Object assignmentTA(SimpleNode node,
Context context)
- Specified by:
assignmentTA
in interface Visitor
assignmentMA
public java.lang.Object assignmentMA(SimpleNode node,
Context context)
- Specified by:
assignmentMA
in interface Visitor
assignmentDA
public java.lang.Object assignmentDA(SimpleNode node,
Context context)
- Specified by:
assignmentDA
in interface Visitor
assignmentPA
public java.lang.Object assignmentPA(SimpleNode node,
Context context)
- Specified by:
assignmentPA
in interface Visitor
assignmentSA
public java.lang.Object assignmentSA(SimpleNode node,
Context context)
- Specified by:
assignmentSA
in interface Visitor
assignmentLA
public java.lang.Object assignmentLA(SimpleNode node,
Context context)
- Specified by:
assignmentLA
in interface Visitor
assignmentRA
public java.lang.Object assignmentRA(SimpleNode node,
Context context)
- Specified by:
assignmentRA
in interface Visitor
assignmentRAA
public java.lang.Object assignmentRAA(SimpleNode node,
Context context)
- Specified by:
assignmentRAA
in interface Visitor
assignmentAA
public java.lang.Object assignmentAA(SimpleNode node,
Context context)
- Specified by:
assignmentAA
in interface Visitor
assignmentEA
public java.lang.Object assignmentEA(SimpleNode node,
Context context)
- Specified by:
assignmentEA
in interface Visitor
assignmentOA
public java.lang.Object assignmentOA(SimpleNode node,
Context context)
- Specified by:
assignmentOA
in interface Visitor
preIncrNode
public java.lang.Object preIncrNode(SimpleNode node,
Context context)
- Specified by:
preIncrNode
in interface Visitor
preDecrNode
public java.lang.Object preDecrNode(SimpleNode node,
Context context)
- Specified by:
preDecrNode
in interface Visitor
postIncrNode
public java.lang.Object postIncrNode(SimpleNode node,
Context context)
- Specified by:
postIncrNode
in interface Visitor
postDecrNode
public java.lang.Object postDecrNode(SimpleNode node,
Context context)
- Specified by:
postDecrNode
in interface Visitor
staticMethodNode
public java.lang.Object staticMethodNode(SimpleNode node,
Context context)
- Specified by:
staticMethodNode
in interface Visitor
staticMemberNode
public java.lang.Object staticMemberNode(SimpleNode node,
Context context)
- Specified by:
staticMemberNode
in interface Visitor
rangeNode
public java.lang.Object rangeNode(SimpleNode node,
Context context)
- Specified by:
rangeNode
in interface Visitor
forStatement
public java.lang.Object forStatement(SimpleNode node,
Context context)
- Specified by:
forStatement
in interface Visitor
breakNode
public java.lang.Object breakNode(SimpleNode node,
Context context)
- Specified by:
breakNode
in interface Visitor
continueNode
public java.lang.Object continueNode(SimpleNode node,
Context context)
- Specified by:
continueNode
in interface Visitor
returnNode
public java.lang.Object returnNode(SimpleNode node,
Context context)
- Specified by:
returnNode
in interface Visitor
catchNode
public java.lang.Object catchNode(SimpleNode node,
Context context)
- Specified by:
catchNode
in interface Visitor
whileStatement
public java.lang.Object whileStatement(SimpleNode node,
Context context)
- Specified by:
whileStatement
in interface Visitor
foreachStatement
public java.lang.Object foreachStatement(SimpleNode node,
Context context)
- Specified by:
foreachStatement
in interface Visitor
switchStatement
public java.lang.Object switchStatement(SimpleNode node,
Context context)
- Specified by:
switchStatement
in interface Visitor
switchBlock
public java.lang.Object switchBlock(SimpleNode node,
Context context)
- Specified by:
switchBlock
in interface Visitor
accept
protected java.lang.Object accept(SimpleNode node,
int idx,
Context context)
createCodeLoader
public static pnuts.compiler.CodeLoader createCodeLoader(java.lang.ClassLoader loader)
compile
public java.lang.Object compile(Pnuts pnuts,
ClassFileHandler handler)
- Compile a parsed expression.
The resulting bytecode is handled by a ClassFileHandler.
compile
public Pnuts compile(Pnuts pnuts,
Context context)
- Compile a parsed expression.
- Parameters:
pnuts
- a parsed expression to be compiledcontext
- a context in which the expression is compiled.- Returns:
- a Pnuts object
compile
public Pnuts compile(java.lang.String expression)
- Compile an expression.
- Parameters:
expression
- an expression to be compiled.- Returns:
- a Pnuts object.
compile
public Pnuts compile(java.lang.String expression,
Context context)
- Compile an expression.
- Parameters:
expression
- an expression to be compiledcontext
- a context in which the expression is compiled.- Returns:
- a Pnuts object.
compile
public java.lang.Object compile(PnutsFunction pf,
ClassFileHandler handler)
- Compile a function group.
The resulting bytecode is handled by a ClassFileHandler.
- Parameters:
pf
- a function group.handler
- the resulting bytecode is handle by this object.- Returns:
- the result of handler.getResult() method.
compile
public PnutsFunction compile(PnutsFunction pf)
- Compile a function group
- Parameters:
pf
- a function group to be compiled.- Returns:
- a compiled version of the function group
compile
public PnutsFunction compile(PnutsFunction pf,
Context context)
- Compile a function group
- Parameters:
pf
- a function group to be compiled.context
- a context in which the function is compiled.- Returns:
- a compiled version of the function group
isCompiled
public static boolean isCompiled(java.lang.Object obj)
- Check if an object is compiled
- Parameters:
obj
- an object to be checked- Returns:
- true if the object is compiled