com.joanju.cg.bytecode
Enum Opcode

java.lang.Object
  extended by java.lang.Enum<Opcode>
      extended by com.joanju.cg.bytecode.Opcode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Opcode>

public enum Opcode
extends java.lang.Enum<Opcode>

Enumerator of valid Opcodes. Doubles as our "factory" for creating all the *Instr (instruction) Bytecode objects.


Enum Constant Summary
ADDSNSUPER
           
ADDSUPER
           
BUILTINFUNC
           
CALL
           
CALLIN
           
CALLSUPER
           
CHECKVALS
           
COMPILEUNIT
           
DECLEVENT
           
DECLSNSUP
           
DEF
           
DEFGLOBAL
           
DEFSHARED
           
DEFVAR
           
GETSHARED
           
LITERALNUM
           
LITERALSTR
           
POP
           
PROCEDURE
           
PUBLISH
           
PUSH
           
PUSHONRET
           
RETURN
           
RETVALGET
           
RETVALSET
           
SCRIPTVALS
           
SUBSCRIBE
           
SUPERS
           
SYSHANDLE
           
TRIGGERBLOCK
           
UNKNOWNVAL
           
UNRES
           
 
Method Summary
static Opcode[] callCodes()
          Get an array of codes for subclasses of AbstractCall.
 int code()
          Get the Opcode code for storing the integer value in the database.
abstract  Bytecode createInstr(int cu, int addr)
          Create a Bytecode instruction object of the appropriate subclass for this Opcode.
static Opcode get(int code)
          Get the Opcode enum object for a given Opcode code out of the database.
 boolean isCall()
          Is this opcode used as a subclass of AbstractCall?
 java.lang.String toString()
          Get the lowercase name of the opCode (more suitable for printing).
static Opcode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Opcode[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ADDSNSUPER

public static final Opcode ADDSNSUPER

ADDSUPER

public static final Opcode ADDSUPER

BUILTINFUNC

public static final Opcode BUILTINFUNC

CALL

public static final Opcode CALL

CALLIN

public static final Opcode CALLIN

CALLSUPER

public static final Opcode CALLSUPER

CHECKVALS

public static final Opcode CHECKVALS

COMPILEUNIT

public static final Opcode COMPILEUNIT

DECLEVENT

public static final Opcode DECLEVENT

DECLSNSUP

public static final Opcode DECLSNSUP

DEF

public static final Opcode DEF

DEFGLOBAL

public static final Opcode DEFGLOBAL

DEFSHARED

public static final Opcode DEFSHARED

DEFVAR

public static final Opcode DEFVAR

GETSHARED

public static final Opcode GETSHARED

LITERALNUM

public static final Opcode LITERALNUM

LITERALSTR

public static final Opcode LITERALSTR

POP

public static final Opcode POP

PROCEDURE

public static final Opcode PROCEDURE

PUBLISH

public static final Opcode PUBLISH

PUSH

public static final Opcode PUSH

PUSHONRET

public static final Opcode PUSHONRET

RETURN

public static final Opcode RETURN

RETVALGET

public static final Opcode RETVALGET

RETVALSET

public static final Opcode RETVALSET

SCRIPTVALS

public static final Opcode SCRIPTVALS

SUBSCRIBE

public static final Opcode SUBSCRIBE

SUPERS

public static final Opcode SUPERS

SYSHANDLE

public static final Opcode SYSHANDLE

TRIGGERBLOCK

public static final Opcode TRIGGERBLOCK

UNKNOWNVAL

public static final Opcode UNKNOWNVAL

UNRES

public static final Opcode UNRES
Method Detail

values

public static final Opcode[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Opcode c : Opcode.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Opcode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

callCodes

public static Opcode[] callCodes()
Get an array of codes for subclasses of AbstractCall.


code

public int code()
Get the Opcode code for storing the integer value in the database.


createInstr

public abstract Bytecode createInstr(int cu,
                                     int addr)
Create a Bytecode instruction object of the appropriate subclass for this Opcode.


get

public static Opcode get(int code)
Get the Opcode enum object for a given Opcode code out of the database.


isCall

public boolean isCall()
Is this opcode used as a subclass of AbstractCall?


toString

public java.lang.String toString()
Get the lowercase name of the opCode (more suitable for printing).

Overrides:
toString in class java.lang.Enum<Opcode>


Copyright © 2008 Joanju Software. All Rights Reserved.