com.inxar.jenesis
Class MVM

java.lang.Object
  |
  +--org.inxar.jenesis.VirtualMachine
        |
        +--com.inxar.jenesis.MVM

public class MVM
extends VirtualMachine

Standard VirtualMachine implementation.


Fields inherited from class org.inxar.jenesis.VirtualMachine
virtualMachine
 
Constructor Summary
MVM(java.util.Properties styleprops)
           
MVM(java.lang.String styleprops)
           
 
Method Summary
 void encode()
          Writes out the source code to all enclosed CompilationUnit instances.
 VirtualCompiler getCompiler()
          Returns the active compiler.
 FieldAccess newAccess(java.lang.String qual, java.lang.String name)
          Expression factory method which returns a new field access with the given qualifier and name.
 NewAnonymousClass newAnon(Type type)
          Expression factory method which returns a new anonymous class instance creation expression for the given type.
 ArrayType newArray(int type, int name)
          Type factory method which returns an array of primitive type with the given constant and dimensions.
 ArrayType newArray(java.lang.String type, int dims)
          Type factory method which returns an array of class type with the given name and dimensions.
 NewArray newArray(Type type)
          Expression factory method which returns a new array instance creation expression for the given type.
 ArrayType newArray(Type type, int dims)
           
 ArrayAccess newArrayAccess(java.lang.String qual, java.lang.String name)
          Expression factory method which returns a new array access expression with the given qualifier and name.
 ArrayInitializer newArrayInit(java.lang.Object o)
          Expression factory method which returns a new array initializer with the given arguments.
 Assign newAssign(int type, Variable l, Expression r)
          Expression factory method which returns a new assignment of the given type.
 Assign newAssign(Variable l, Expression r)
          Expression factory method which returns a new assignment of the SIMPLE type.
 Binary newBinary(int type, Expression l, Expression r)
          Expression factory method which returns a new unary function of the given type.
 Blank newBlank()
          Expression factory method which returns the blank expression.
 ByteLiteral newByte(byte val)
          Literal factory method which returns a new byte literal.
 Cast newCast(Type type, Expression val)
          Expression factory method which returns a new cast function having the given type and value.
 CharLiteral newChar(char val)
          Literal factory method which returns a new char literal.
 ClassLiteral newClass(java.lang.String val)
          Literal factory method which returns a new Class literal.
 NewClass newClass(Type type)
          Expression factory method which returns a new class instance creation expression for the given type.
 CompilationUnit newCompilationUnit(java.lang.String path)
          Creates a new CompilationUnit in this Machine and returns it.
 DoubleLiteral newDouble(double val)
          Literal factory method which returns a new double literal.
 False newFalse()
          Literal factory method which returns the boolean false literal.
 FloatLiteral newFloat(float val)
          Literal factory method which returns a new float literal.
 Freeform newFree(java.lang.String code)
          Expression factory method which returns a new freeform expression with the given code.
 IntLiteral newInt(int val)
          Literal factory method which returns a new int literal.
 Invoke newInvoke(java.lang.String qual, java.lang.String name)
          Expression factory method which returns a new method invocation with the given qualifier and name.
 LongLiteral newLong(long val)
          Literal factory method which returns a new long literal.
 Null newNull()
          Literal factory method which returns the null literal.
 OctalLiteral newOctal(char val)
          Literal factory method which returns a new octal char literal.
 ScientificLiteral newScientific(int precision, int scale, int exponent)
          Literal factory method which returns a new scientific floating point char literal.
 ShortLiteral newShort(short val)
          Literal factory method which returns a new short literal.
 StringLiteral newString(java.lang.String val)
          Literal factory method which returns a new String literal.
 Ternary newTernary(int type, Expression one, Expression two, Expression three)
          Expression factory method which returns a new unary function of the given type.
 True newTrue()
          Literal factory method which returns the boolean true literal.
 PrimitiveType newType(int type)
          Type factory method which returns a primitive type named by the given int as allowed by the constants listed in the Type interface.
 ClassType newType(java.lang.String name)
          Type factory method which returns a class type named with the given String.
 Unary newUnary(int type, Expression val)
          Expression factory method which returns a new unary function of the given type.
 UnicodeLiteral newUnicode(char val)
          Literal factory method which returns a new unicode char literal.
 Variable newVar(java.lang.String name)
          Expression factory method which returns a new variable with the given name.
 void setCompiler(VirtualCompiler compiler)
          Sets the active compiler.
 
Methods inherited from class org.inxar.jenesis.VirtualMachine
getVirtualMachine, setVirtualMachine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MVM

public MVM(java.util.Properties styleprops)

MVM

public MVM(java.lang.String styleprops)
    throws java.io.IOException
Method Detail

newType

public ClassType newType(java.lang.String name)
Description copied from class: VirtualMachine
Type factory method which returns a class type named with the given String.
Overrides:
newType in class VirtualMachine

newType

public PrimitiveType newType(int type)
Description copied from class: VirtualMachine
Type factory method which returns a primitive type named by the given int as allowed by the constants listed in the Type interface.
Overrides:
newType in class VirtualMachine

newArray

public ArrayType newArray(java.lang.String type,
                          int dims)
Description copied from class: VirtualMachine
Type factory method which returns an array of class type with the given name and dimensions.
Overrides:
newArray in class VirtualMachine

newArray

public ArrayType newArray(int type,
                          int name)
Description copied from class: VirtualMachine
Type factory method which returns an array of primitive type with the given constant and dimensions.
Overrides:
newArray in class VirtualMachine

newArray

public ArrayType newArray(Type type,
                          int dims)

newNull

public Null newNull()
Description copied from class: VirtualMachine
Literal factory method which returns the null literal.
Overrides:
newNull in class VirtualMachine

newTrue

public True newTrue()
Description copied from class: VirtualMachine
Literal factory method which returns the boolean true literal.
Overrides:
newTrue in class VirtualMachine

newFalse

public False newFalse()
Description copied from class: VirtualMachine
Literal factory method which returns the boolean false literal.
Overrides:
newFalse in class VirtualMachine

newByte

public ByteLiteral newByte(byte val)
Description copied from class: VirtualMachine
Literal factory method which returns a new byte literal.
Overrides:
newByte in class VirtualMachine

newShort

public ShortLiteral newShort(short val)
Description copied from class: VirtualMachine
Literal factory method which returns a new short literal.
Overrides:
newShort in class VirtualMachine

newInt

public IntLiteral newInt(int val)
Description copied from class: VirtualMachine
Literal factory method which returns a new int literal.
Overrides:
newInt in class VirtualMachine

newLong

public LongLiteral newLong(long val)
Description copied from class: VirtualMachine
Literal factory method which returns a new long literal.
Overrides:
newLong in class VirtualMachine

newFloat

public FloatLiteral newFloat(float val)
Description copied from class: VirtualMachine
Literal factory method which returns a new float literal.
Overrides:
newFloat in class VirtualMachine

newDouble

public DoubleLiteral newDouble(double val)
Description copied from class: VirtualMachine
Literal factory method which returns a new double literal.
Overrides:
newDouble in class VirtualMachine

newChar

public CharLiteral newChar(char val)
Description copied from class: VirtualMachine
Literal factory method which returns a new char literal.
Overrides:
newChar in class VirtualMachine

newOctal

public OctalLiteral newOctal(char val)
Description copied from class: VirtualMachine
Literal factory method which returns a new octal char literal.
Overrides:
newOctal in class VirtualMachine

newUnicode

public UnicodeLiteral newUnicode(char val)
Description copied from class: VirtualMachine
Literal factory method which returns a new unicode char literal.
Overrides:
newUnicode in class VirtualMachine

newScientific

public ScientificLiteral newScientific(int precision,
                                       int scale,
                                       int exponent)
Description copied from class: VirtualMachine
Literal factory method which returns a new scientific floating point char literal.
Overrides:
newScientific in class VirtualMachine

newString

public StringLiteral newString(java.lang.String val)
Description copied from class: VirtualMachine
Literal factory method which returns a new String literal.
Overrides:
newString in class VirtualMachine

newClass

public ClassLiteral newClass(java.lang.String val)
Description copied from class: VirtualMachine
Literal factory method which returns a new Class literal.
Overrides:
newClass in class VirtualMachine

newCast

public Cast newCast(Type type,
                    Expression val)
Description copied from class: VirtualMachine
Expression factory method which returns a new cast function having the given type and value.
Overrides:
newCast in class VirtualMachine

newUnary

public Unary newUnary(int type,
                      Expression val)
Description copied from class: VirtualMachine
Expression factory method which returns a new unary function of the given type.
Overrides:
newUnary in class VirtualMachine

newBinary

public Binary newBinary(int type,
                        Expression l,
                        Expression r)
Description copied from class: VirtualMachine
Expression factory method which returns a new unary function of the given type.
Overrides:
newBinary in class VirtualMachine

newTernary

public Ternary newTernary(int type,
                          Expression one,
                          Expression two,
                          Expression three)
Description copied from class: VirtualMachine
Expression factory method which returns a new unary function of the given type.
Overrides:
newTernary in class VirtualMachine

newAssign

public Assign newAssign(int type,
                        Variable l,
                        Expression r)
Description copied from class: VirtualMachine
Expression factory method which returns a new assignment of the given type.
Overrides:
newAssign in class VirtualMachine

newAssign

public Assign newAssign(Variable l,
                        Expression r)
Description copied from class: VirtualMachine
Expression factory method which returns a new assignment of the SIMPLE type. This is a convenience * method.
Overrides:
newAssign in class VirtualMachine

newAccess

public FieldAccess newAccess(java.lang.String qual,
                             java.lang.String name)
Description copied from class: VirtualMachine
Expression factory method which returns a new field access with the given qualifier and name.
Overrides:
newAccess in class VirtualMachine

newInvoke

public Invoke newInvoke(java.lang.String qual,
                        java.lang.String name)
Description copied from class: VirtualMachine
Expression factory method which returns a new method invocation with the given qualifier and name.
Overrides:
newInvoke in class VirtualMachine

newArrayAccess

public ArrayAccess newArrayAccess(java.lang.String qual,
                                  java.lang.String name)
Description copied from class: VirtualMachine
Expression factory method which returns a new array access expression with the given qualifier and name.
Overrides:
newArrayAccess in class VirtualMachine

newArray

public NewArray newArray(Type type)
Description copied from class: VirtualMachine
Expression factory method which returns a new array instance creation expression for the given type.
Overrides:
newArray in class VirtualMachine

newArrayInit

public ArrayInitializer newArrayInit(java.lang.Object o)
Description copied from class: VirtualMachine
Expression factory method which returns a new array initializer with the given arguments.
Overrides:
newArrayInit in class VirtualMachine

newClass

public NewClass newClass(Type type)
Description copied from class: VirtualMachine
Expression factory method which returns a new class instance creation expression for the given type.
Overrides:
newClass in class VirtualMachine

newAnon

public NewAnonymousClass newAnon(Type type)
Description copied from class: VirtualMachine
Expression factory method which returns a new anonymous class instance creation expression for the given type.
Overrides:
newAnon in class VirtualMachine

newBlank

public Blank newBlank()
Description copied from class: VirtualMachine
Expression factory method which returns the blank expression.
Overrides:
newBlank in class VirtualMachine

newFree

public Freeform newFree(java.lang.String code)
Description copied from class: VirtualMachine
Expression factory method which returns a new freeform expression with the given code.
Overrides:
newFree in class VirtualMachine

newVar

public Variable newVar(java.lang.String name)
Description copied from class: VirtualMachine
Expression factory method which returns a new variable with the given name.
Overrides:
newVar in class VirtualMachine

newCompilationUnit

public CompilationUnit newCompilationUnit(java.lang.String path)
Description copied from class: VirtualMachine
Creates a new CompilationUnit in this Machine and returns it.
Overrides:
newCompilationUnit in class VirtualMachine

getCompiler

public VirtualCompiler getCompiler()
Description copied from class: VirtualMachine
Returns the active compiler.
Overrides:
getCompiler in class VirtualMachine

setCompiler

public void setCompiler(VirtualCompiler compiler)
Description copied from class: VirtualMachine
Sets the active compiler.
Overrides:
setCompiler in class VirtualMachine

encode

public void encode()
            throws java.io.IOException
Description copied from class: VirtualMachine
Writes out the source code to all enclosed CompilationUnit instances.
Overrides:
encode in class VirtualMachine