org.rubato.rubettes.builtin
Class ArithVM

java.lang.Object
  extended by org.rubato.rubettes.builtin.ArithVM

public class ArithVM
extends java.lang.Object

The virtual machine for execution bytecode created by ArithCompiler.

Author:
Gérard Milmeister

Field Summary
static int AND
           
static int BIF
           
static int DIV
           
static int EQUALS
           
static int EXP
           
static int FALSE
           
static int FUNCALL
           
static int GE
           
static int GT
           
static int ID
           
static int IMMEDIATE
           
static int JMP
           
static int LE
           
static int LT
           
static int MINUS
           
static int NEQ
           
static int NOP
           
static int NOT
           
static int OR
           
static int PARAM
           
static int PLUS
           
static int TIMES
           
static int TRUE
           
static int UMINUS
           
 
Constructor Summary
ArithVM()
           
 
Method Summary
 void compileElse(int jmppos)
           
 void compileFalse()
           
 boolean compileId(java.lang.String id, int nrArgs)
           
 int compileIf()
           
 void compileNot()
           
 void compileNumber(double value)
           
 void compileOp(int op)
           
 void compileParam(int param)
           
 int compileThen(int ifpos)
           
 void compileTrue()
           
 void compileUnaryMinus()
           
 void dump()
           
 void eval(double... parameters)
           
 void finish()
           
 boolean getBooleanResult()
           
 java.lang.String getError()
           
 int getNrArgs()
           
 double getRealResult()
           
 boolean hasError()
           
 void setError(java.lang.String s)
           
 void setError(java.lang.String s, java.lang.Object... objects)
           
 void start()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMMEDIATE

public static final int IMMEDIATE
See Also:
Constant Field Values

TIMES

public static final int TIMES
See Also:
Constant Field Values

DIV

public static final int DIV
See Also:
Constant Field Values

PLUS

public static final int PLUS
See Also:
Constant Field Values

MINUS

public static final int MINUS
See Also:
Constant Field Values

PARAM

public static final int PARAM
See Also:
Constant Field Values

NOP

public static final int NOP
See Also:
Constant Field Values

ID

public static final int ID
See Also:
Constant Field Values

FUNCALL

public static final int FUNCALL
See Also:
Constant Field Values

UMINUS

public static final int UMINUS
See Also:
Constant Field Values

EXP

public static final int EXP
See Also:
Constant Field Values

AND

public static final int AND
See Also:
Constant Field Values

OR

public static final int OR
See Also:
Constant Field Values

LE

public static final int LE
See Also:
Constant Field Values

LT

public static final int LT
See Also:
Constant Field Values

GE

public static final int GE
See Also:
Constant Field Values

GT

public static final int GT
See Also:
Constant Field Values

EQUALS

public static final int EQUALS
See Also:
Constant Field Values

NEQ

public static final int NEQ
See Also:
Constant Field Values

FALSE

public static final int FALSE
See Also:
Constant Field Values

TRUE

public static final int TRUE
See Also:
Constant Field Values

NOT

public static final int NOT
See Also:
Constant Field Values

BIF

public static final int BIF
See Also:
Constant Field Values

JMP

public static final int JMP
See Also:
Constant Field Values
Constructor Detail

ArithVM

public ArithVM()
Method Detail

eval

public void eval(double... parameters)

getRealResult

public double getRealResult()

getBooleanResult

public boolean getBooleanResult()

setError

public void setError(java.lang.String s)

setError

public void setError(java.lang.String s,
                     java.lang.Object... objects)

hasError

public boolean hasError()

getError

public java.lang.String getError()

start

public void start()

finish

public void finish()

getNrArgs

public int getNrArgs()

compileOp

public void compileOp(int op)

compileUnaryMinus

public void compileUnaryMinus()

compileFalse

public void compileFalse()

compileTrue

public void compileTrue()

compileNot

public void compileNot()

compileId

public boolean compileId(java.lang.String id,
                         int nrArgs)

compileParam

public void compileParam(int param)

compileNumber

public void compileNumber(double value)

compileIf

public int compileIf()

compileThen

public int compileThen(int ifpos)

compileElse

public void compileElse(int jmppos)

dump

public void dump()