anvil.script.compiler
Class ByteCompiler

java.lang.Object
  |
  +--anvil.script.compiler.ByteCompiler
All Implemented Interfaces:
CodecConstants

public class ByteCompiler
extends java.lang.Object
implements CodecConstants

class ByteCompiler


Field Summary
 Field _f_const
           
 Field _f_switch
           
 Field _f_text
           
static int CHECK
           
static int DELETE
           
static int GET
           
static int GET_BOOLEAN
           
static int L_CONTEXT
           
static int L_FRAME
           
static int L_THIS
           
static int SET
           
static java.lang.String TYPE_ANY
           
static java.lang.String TYPE_ANY_ARRAY
           
static java.lang.String TYPE_ANY_OP
           
static java.lang.String TYPE_COMPILED_SCRIPT
           
static java.lang.String TYPE_CONTEXT
           
static java.lang.String TYPE_FUNCTION
           
 java.lang.String TYPE_MODULE
           
static java.lang.String TYPE_OBJECT
           
static java.lang.String TYPE_STACKFRAME
           
static java.lang.String TYPE_SYMBOLS
           
 
Fields inherited from interface anvil.codec.CodecConstants
ACC_ABSTRACT, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_TRANSIENT, ACC_VOLATILE, ATTR_Code, ATTR_ConstantValue, ATTR_Deprecated, ATTR_Exceptions, ATTR_InnerClasses, ATTR_LineNumberTable, ATTR_LocalVariableTable, ATTR_SourceFile, ATTR_Synthetic, CLASS_MAGIC, CONSTANT_Class, CONSTANT_Double, CONSTANT_FieldRef, CONSTANT_Float, CONSTANT_Integer, CONSTANT_InterfaceMethodRef, CONSTANT_Long, CONSTANT_MethodRef, CONSTANT_NameAndType, CONSTANT_SourceFile, CONSTANT_String, CONSTANT_Utf8, MAJOR_VERSION, MINOR_VERSION, T_BOOLEAN, T_BYTE, T_CHAR, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT
 
Constructor Summary
ByteCompiler(Smith smith, ModuleEnvelope envelope)
           
 
Method Summary
 void accessInstance(ClassType context, ClassType target)
           
 int addSwitch(java.util.Iterator keys)
           
 void any2boolean()
           
 void boolean2any()
           
 boolean compile()
           
 void compileArgumentList(CompilableFunction function, Node[] parameters)
           
 void compileArgumentList(CompilableFunction function, Node[] parameters, int contextindex)
           
 void compileArgumentList(Node[] parameters)
           
 void compileCall(CompilableFunction function, Node[] parameters)
           
 ByteCompiler constant(Any value, boolean canchange)
           
 Address getAddress()
           
 java.lang.String getClassname()
           
 ClassRoom getClassRoom()
           
 Code getCode()
           
 Method getMethod()
           
 Module getModule()
           
 ClassRoom getModuleClass()
           
 ConstantPool getPool()
           
static java.lang.String getSignature(CompilableFunction function)
           
 void popClass()
           
 void popCode()
           
 void pushClass(ClassRoom clazz)
           
 void pushCode(Code code)
           
 ByteCompiler reflect(java.lang.String classname)
           
 ByteCompiler symbol(int index)
           
 ByteCompiler symbol(java.lang.String name)
           
 ByteCompiler text(Code code, java.lang.String text, boolean newline)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

L_THIS

public static final int L_THIS
See Also:
Constant Field Values

L_CONTEXT

public static final int L_CONTEXT
See Also:
Constant Field Values

L_FRAME

public static final int L_FRAME
See Also:
Constant Field Values

TYPE_MODULE

public java.lang.String TYPE_MODULE

TYPE_OBJECT

public static final java.lang.String TYPE_OBJECT
See Also:
Constant Field Values

TYPE_ANY

public static final java.lang.String TYPE_ANY
See Also:
Constant Field Values

TYPE_ANY_OP

public static final java.lang.String TYPE_ANY_OP
See Also:
Constant Field Values

TYPE_ANY_ARRAY

public static final java.lang.String TYPE_ANY_ARRAY
See Also:
Constant Field Values

TYPE_CONTEXT

public static final java.lang.String TYPE_CONTEXT
See Also:
Constant Field Values

TYPE_SYMBOLS

public static final java.lang.String TYPE_SYMBOLS
See Also:
Constant Field Values

TYPE_FUNCTION

public static final java.lang.String TYPE_FUNCTION
See Also:
Constant Field Values

TYPE_COMPILED_SCRIPT

public static final java.lang.String TYPE_COMPILED_SCRIPT
See Also:
Constant Field Values

TYPE_STACKFRAME

public static final java.lang.String TYPE_STACKFRAME
See Also:
Constant Field Values

GET

public static final int GET
See Also:
Constant Field Values

GET_BOOLEAN

public static final int GET_BOOLEAN
See Also:
Constant Field Values

SET

public static final int SET
See Also:
Constant Field Values

CHECK

public static final int CHECK
See Also:
Constant Field Values

DELETE

public static final int DELETE
See Also:
Constant Field Values

_f_const

public Field _f_const

_f_text

public Field _f_text

_f_switch

public Field _f_switch
Constructor Detail

ByteCompiler

public ByteCompiler(Smith smith,
                    ModuleEnvelope envelope)
Method Detail

getAddress

public Address getAddress()

getModule

public Module getModule()

getClassname

public java.lang.String getClassname()

getModuleClass

public ClassRoom getModuleClass()

getClassRoom

public ClassRoom getClassRoom()

getPool

public ConstantPool getPool()

pushClass

public void pushClass(ClassRoom clazz)

popClass

public void popClass()

getMethod

public Method getMethod()

getCode

public Code getCode()

pushCode

public void pushCode(Code code)

popCode

public void popCode()

text

public ByteCompiler text(Code code,
                         java.lang.String text,
                         boolean newline)

symbol

public ByteCompiler symbol(java.lang.String name)

symbol

public ByteCompiler symbol(int index)

constant

public ByteCompiler constant(Any value,
                             boolean canchange)

addSwitch

public int addSwitch(java.util.Iterator keys)

reflect

public ByteCompiler reflect(java.lang.String classname)

compile

public boolean compile()

compileArgumentList

public void compileArgumentList(CompilableFunction function,
                                Node[] parameters)

compileArgumentList

public void compileArgumentList(CompilableFunction function,
                                Node[] parameters,
                                int contextindex)

compileArgumentList

public void compileArgumentList(Node[] parameters)

compileCall

public void compileCall(CompilableFunction function,
                        Node[] parameters)

getSignature

public static java.lang.String getSignature(CompilableFunction function)

any2boolean

public void any2boolean()

boolean2any

public void boolean2any()

accessInstance

public void accessInstance(ClassType context,
                           ClassType target)