org.extex.ocpware.type
Enum OcpCode

java.lang.Object
  extended by java.lang.Enum<OcpCode>
      extended by org.extex.ocpware.type.OcpCode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<OcpCode>

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

This enumeration provides information about the ΩCP instructions.

The ΩCP Code Format

A ΩCP Program consists of a set of instructions. The instructions are stored in words of the length of 4 bytes (of 8 bits each). Each instruction is determined by an op code of one byte. The instruction can have 0 to 2 arguments. Any argument is at most 3 bytes (24 bits) long.

An instruction without arguments has the following layout:

8 bit 24 bit
op code unused

An instruction with one argument has the following layout:

8 bit 24 bit
op code argument 1

An instruction with two arguments has the following layout:

8 bit 24 bit
op code argument 1
unused argument 2

The ΩCP Programming Model

table[] Tables
state[] States
pc Program counter
cs Current state
first The pointer to the first character of the prefix
last The pointer to the last character of the prefix
stack[] Stack
stateStack[] State stack
The following instructions are available: ADD, DIV, GOTO, GOTO_BEG, GOTO_END, GOTO_EQ, GOTO_GE, GOTO_GT, GOTO_LE, GOTO_LT, GOTO_NE, GOTO_NO_ADVANCE, LEFT_BACKUP, LEFT_RETURN, LEFT_START, LOOKUP, MOD, MULT, PBACK_CHAR, PBACK_LCHAR, PBACK_NUM, PBACK_OUTPUT, PBACK_SOME, PUSH_CHAR, PUSH_LCHAR, PUSH_NUM, RIGHT_CHAR, RIGHT_LCHAR, RIGHT_NUM, RIGHT_OUTPUT, RIGHT_SOME, STATE_CHANGE, STATE_POP, STATE_PUSH, STOP, SUB.

Version:
$Revision: 6026 $
Author:
Gerd Neugebauer

Enum Constant Summary
ADD
          The constant ADD contains the description of the ΩCP instruction to add two numbers from the stack.
DIV
          The constant DIV contains the description of the ΩCP instruction to divide two numbers from the stack.
GOTO
          The constant GOTO contains the description of the ΩCP instruction to unconditionally branch to another instruction.
GOTO_BEG
          The constant GOTO_BEG contains the description of the ΩCP instruction to conditionally branch to another instruction.
GOTO_END
          The constant GOTO_END contains the description of the ΩCP instruction to conditionally branch to another instruction.
GOTO_EQ
          The constant GOTO_EQ contains the description of the ΩCP instruction to conditionally branch to another instruction.
GOTO_GE
          The constant GOTO_GE contains the description of the ΩCP instruction to conditionally branch to another instruction.
GOTO_GT
          The constant GOTO_GT contains the description of the ΩCP instruction to conditionally branch to another instruction.
GOTO_LE
          The constant GOTO_LE contains the description of the ΩCP instruction to conditionally branch to another instruction.
GOTO_LT
          The constant GOTO_LT contains the description of the ΩCP instruction to conditionally branch to another instruction.
GOTO_NE
          The constant GOTO_NE contains the description of the ΩCP instruction to conditionally branch to another instruction.
GOTO_NO_ADVANCE
          The constant GOTO_NO_ADVANCE contains the description of the ΩCP instruction to conditionally branch to another instruction.
LEFT_BACKUP
          The constant LEFT_BACKUP contains the description of the ΩCP instruction to back up the last pointer by 1.
LEFT_RETURN
          The constant LEFT_RETURN contains the description of the ΩCP instruction to reset the last pointer to first - 1.
LEFT_START
          The constant LEFT_START contains the description of the ΩCP instruction to set the first character position to last + 1.
LOOKUP
          The constant LOOKUP contains the description of the ΩCP instruction to look-up a value from a table.
MOD
          The constant MOD contains the description of the ΩCP instruction to compute the remainder of two numbers from the stack.
MULT
          The constant MULT contains the description of the ΩCP instruction to multiply two numbers from the stack.
PBACK_CHAR
          The constant PBACK_CHAR contains the description of the ΩCP instruction to push back a character from the right end of the prefix.
PBACK_LCHAR
          The constant PBACK_LCHAR contains the description of the ΩCP instruction to push back a character from the left end of the prefix.
PBACK_NUM
          The constant PBACK_NUM contains the description of the ΩCP instruction to push back a constant taken from the argument.
PBACK_OUTPUT
          The constant PBACK_OUTPUT contains the description of the ΩCP instruction to push back the top value from the arithmetic stack.
PBACK_SOME
          The constant PBACK_SOME contains the description of the ΩCP instruction to push back some characters from the prefix.
PUSH_CHAR
          The constant PUSH_CHAR contains the description of the ΩCP instruction to push a character from the prefix to the stack.
PUSH_LCHAR
          The constant PUSH_LCHAR contains the description of the ΩCP instruction to push a character from the prefix to the stack.
PUSH_NUM
          The constant PUSH_NUM contains the description of the ΩCP instruction to push a constant to the stack.
RIGHT_CHAR
          The constant RIGHT_CHAR contains the description of the ΩCP instruction to output a character from the right end of the prefix.
RIGHT_LCHAR
          The constant RIGHT_LCHAR contains the description of the ΩCP instruction to output a character from the left end of the prefix.
RIGHT_NUM
          The constant RIGHT_NUM contains the description of the ΩCP instruction to output a constant character number.
RIGHT_OUTPUT
          The constant RIGHT_OUTPUT contains the description of the ΩCP instruction to output the topmost number from the arithmetic stack.
RIGHT_SOME
          The constant RIGHT_SOME contains the description of the ΩCP instruction to output some characters from the prefix.
STATE_CHANGE
          The constant STATE_CHANGE contains the description of the ΩCP instruction to set the current state to a given value.
STATE_POP
          The constant STATE_POP contains the description of the ΩCP instruction to pop the current state from the state stack.
STATE_PUSH
          The constant STATE_PUSH contains the description of the ΩCP instruction to push a state to the state stack.
STOP
          The constant STOP contains the description of the ΩCP instruction to stop the processing of the current prefix.
SUB
          The constant SUB contains the description of the ΩCP instruction to subtract two numbers from the stack.
 
Field Summary
static int ARGUMENT_BIT_MASK
          The constant ARGUMENT_BIT_MASK contains the bit mask for the lower 24 bits used as arguments in the ΩCP engine.
static int OP_ADD
          The constant OP_ADD contains the op code for the ΩCP instruction to add two numbers from the stack.
static int OP_DIV
          The constant OP_DIV contains the op code for the ΩCP instruction to divide two numbers from the stack.
static int OP_GOTO
          The constant OP_GOTO contains the op code for the ΩCP instruction to adjust the program counter.
static int OP_GOTO_BEG
          The constant OP_GOTO_BEG contains the op code for the ΩCP instruction to conditionally adjust the program counter at the beginning of input.
static int OP_GOTO_END
          The constant OP_GOTO_END contains the op code for the ΩCP instruction to conditionally adjust the program counter at the end of input.
static int OP_GOTO_EQ
          The constant OP_GOTO_EQ contains the op code for the ΩCP instruction conditionally adjust the program counter.
static int OP_GOTO_GE
          The constant OP_GOTO_GE contains the op code for the ΩCP instruction conditionally adjust the program counter.
static int OP_GOTO_GT
          The constant OP_GOTO_GT contains the op code for the ΩCP instruction to conditionally adjust the program counter.
static int OP_GOTO_LE
          The constant OP_GOTO_LE contains the op code for the ΩCP instruction to conditionally adjust the program counter.
static int OP_GOTO_LT
          The constant OP_GOTO_LT contains the op code for the ΩCP instruction to conditionally adjust the program counter.
static int OP_GOTO_NE
          The constant OP_GOTO_NE contains the op code for the ΩCP instruction to conditionally adjust the program counter.
static int OP_GOTO_NO_ADVANCE
          The constant OP_GOTO_NO_ADVANCE contains the op code for the ocp instruction to conditionally adjust the program counter after advancing last.
static int OP_LEFT_BACKUP
          The constant OP_LEFT_BACKUP contains the op code for the ΩCP instruction to decrement the last pointer by 1.
static int OP_LEFT_RETURN
          The constant OP_LEFT_RETURN contains the op code for the ΩCP instruction to rest last to first - 1.
static int OP_LEFT_START
          The constant OP_LEFT_START contains the op code for the ΩCP instruction to set first to last + 1.
static int OP_LOOKUP
          The constant OP_LOOKUP contains the op code for the ΩCP instruction to lookup a table entry.
static int OP_MOD
          The constant OP_MOD contains the op code for the ΩCP instruction to compute the remainder of two arguments from the stack.
static int OP_MULT
          The constant OP_MULT contains the op code for the ΩCP instruction to multiply two arguments from the stack.
static int OP_PBACK_CHAR
          The constant OP_PBACK_CHAR contains the op code for the ΩCP instruction to push back a character from the right end of the prefix
static int OP_PBACK_LCHAR
          The constant OP_PBACK_LCHAR contains the op code for the ΩCP instruction to push back a character from the left end of the prefix.
static int OP_PBACK_NUM
          The constant OP_PBACK_NUM contains the op code for the ΩCP instruction to push back a number.
static int OP_PBACK_OUTPUT
          The constant OP_PBACK_OUTPUT contains the op code for the ΩCP instruction to push back a character from the arithmetic stack.
static int OP_PBACK_SOME
          The constant OP_PBACK_SOME contains the op code for the ΩCP instruction to push back a match.
static int OP_PUSH_CHAR
          The constant OP_PUSH_CHAR contains the op code for the ΩCP instruction to push back a character.
static int OP_PUSH_LCHAR
          The constant OP_PUSH_LCHAR contains the op code for the ΩCP instruction to push a referenced character.
static int OP_PUSH_NUM
          The constant OP_PUSH_NUM contains the op code for the ΩCP instruction to push a number.
static int OP_RIGHT_CHAR
          The constant OP_RIGHT_CHAR contains the op code for the ΩCP instruction to output a character from the right end of the prefix.
static int OP_RIGHT_LCHAR
          The constant OP_RIGHT_LCHAR contains the op code for the ΩCP instruction to output a character from the left end of the prefix.
static int OP_RIGHT_NUM
          The constant OP_RIGHT_NUM contains the op code for the ΩCP instruction to output a constant.
static int OP_RIGHT_OUTPUT
          The constant OP_RIGHT_OUTPUT contains the op code for the ΩCP instruction to pop a value off the arithmetic stack and output it.
static int OP_RIGHT_SOME
          The constant OP_RIGHT_SOME contains the op code for the ΩCP instruction to output some characters of the prefix.
static int OP_STATE_CHANGE
          The constant OP_STATE_CHANGE contains the op code for the ΩCP instruction to set a new state.
static int OP_STATE_POP
          The constant OP_STATE_POP contains the op code for the ΩCP instruction to pop a state from the state stack.
static int OP_STATE_PUSH
          The constant OP_STATE_PUSH contains the op code for the ΩCP instruction to push a state onto the state stack.
static int OP_STOP
          The constant OP_STOP contains the op code for the ΩCP instruction to end the processing.
static int OP_SUB
          The constant OP_SUB contains the op code for the ΩCP instruction to subtract two numbers from the stack.
static int OPCODE_OFFSET
          The constant OPCODE_OFFSET contains the offset for the op code.
 
Method Summary
static OcpCode get(int opcode)
          Get the OcpCode for a given op code.
 OcpArgumentType[] getArguments()
          Getter for the description of the arguments of the instruction.
 java.lang.String getInstruction()
          Getter for instruction.
 int getOpcode()
          Getter for opcode.
 int inst()
          Get the first word of the instruction withput argument.
 int inst(int arg)
          Get the first word of the instruction with one argument.
static OcpCode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static OcpCode[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

RIGHT_OUTPUT

public static final OcpCode RIGHT_OUTPUT
The constant RIGHT_OUTPUT contains the description of the ΩCP instruction to output the topmost number from the arithmetic stack. This element is removed from the stack.


RIGHT_NUM

public static final OcpCode RIGHT_NUM
The constant RIGHT_NUM contains the description of the ΩCP instruction to output a constant character number. The constant is passed in as argument.


RIGHT_CHAR

public static final OcpCode RIGHT_CHAR
The constant RIGHT_CHAR contains the description of the ΩCP instruction to output a character from the right end of the prefix.


RIGHT_LCHAR

public static final OcpCode RIGHT_LCHAR
The constant RIGHT_LCHAR contains the description of the ΩCP instruction to output a character from the left end of the prefix.


RIGHT_SOME

public static final OcpCode RIGHT_SOME
The constant RIGHT_SOME contains the description of the ΩCP instruction to output some characters from the prefix.


PBACK_OUTPUT

public static final OcpCode PBACK_OUTPUT
The constant PBACK_OUTPUT contains the description of the ΩCP instruction to push back the top value from the arithmetic stack.


PBACK_NUM

public static final OcpCode PBACK_NUM
The constant PBACK_NUM contains the description of the ΩCP instruction to push back a constant taken from the argument.


PBACK_CHAR

public static final OcpCode PBACK_CHAR
The constant PBACK_CHAR contains the description of the ΩCP instruction to push back a character from the right end of the prefix.


PBACK_LCHAR

public static final OcpCode PBACK_LCHAR
The constant PBACK_LCHAR contains the description of the ΩCP instruction to push back a character from the left end of the prefix.


PBACK_SOME

public static final OcpCode PBACK_SOME
The constant PBACK_SOME contains the description of the ΩCP instruction to push back some characters from the prefix.


ADD

public static final OcpCode ADD
The constant ADD contains the description of the ΩCP instruction to add two numbers from the stack. The result is returned via the stack.


SUB

public static final OcpCode SUB
The constant SUB contains the description of the ΩCP instruction to subtract two numbers from the stack. The result is returned via the stack.


MULT

public static final OcpCode MULT
The constant MULT contains the description of the ΩCP instruction to multiply two numbers from the stack. The result is returned via the stack.


DIV

public static final OcpCode DIV
The constant DIV contains the description of the ΩCP instruction to divide two numbers from the stack. The result is returned via the stack.


MOD

public static final OcpCode MOD
The constant MOD contains the description of the ΩCP instruction to compute the remainder of two numbers from the stack. The result is returned via the stack.


LOOKUP

public static final OcpCode LOOKUP
The constant LOOKUP contains the description of the ΩCP instruction to look-up a value from a table. The index and the table number are passed in via the stack. The result is returned on the stack.


PUSH_NUM

public static final OcpCode PUSH_NUM
The constant PUSH_NUM contains the description of the ΩCP instruction to push a constant to the stack.


PUSH_CHAR

public static final OcpCode PUSH_CHAR
The constant PUSH_CHAR contains the description of the ΩCP instruction to push a character from the prefix to the stack. The argument passed in is the index of the character counted from the right end.


PUSH_LCHAR

public static final OcpCode PUSH_LCHAR
The constant PUSH_LCHAR contains the description of the ΩCP instruction to push a character from the prefix to the stack. The argument passed in is the index of the character counted from the left end.


STATE_CHANGE

public static final OcpCode STATE_CHANGE
The constant STATE_CHANGE contains the description of the ΩCP instruction to set the current state to a given value. The argument is the state to use.


STATE_PUSH

public static final OcpCode STATE_PUSH
The constant STATE_PUSH contains the description of the ΩCP instruction to push a state to the state stack.


STATE_POP

public static final OcpCode STATE_POP
The constant STATE_POP contains the description of the ΩCP instruction to pop the current state from the state stack.


LEFT_START

public static final OcpCode LEFT_START
The constant LEFT_START contains the description of the ΩCP instruction to set the first character position to last + 1.


LEFT_RETURN

public static final OcpCode LEFT_RETURN
The constant LEFT_RETURN contains the description of the ΩCP instruction to reset the last pointer to first - 1.


LEFT_BACKUP

public static final OcpCode LEFT_BACKUP
The constant LEFT_BACKUP contains the description of the ΩCP instruction to back up the last pointer by 1.


GOTO

public static final OcpCode GOTO
The constant GOTO contains the description of the ΩCP instruction to unconditionally branch to another instruction. The argument is the number of the instruction to set the program counter to.


GOTO_NE

public static final OcpCode GOTO_NE
The constant GOTO_NE contains the description of the ΩCP instruction to conditionally branch to another instruction. The first argument is compared against the character pointed to by last and the branching is performed if they are not equal. The second argument is the number of the instruction to set the program counter to.


GOTO_EQ

public static final OcpCode GOTO_EQ
The constant GOTO_EQ contains the description of the ΩCP instruction to conditionally branch to another instruction. The first argument is compared against the character pointed to by last and the branching is performed if they are equal. The second argument is the number of the instruction to set the program counter to.


GOTO_LT

public static final OcpCode GOTO_LT
The constant GOTO_LT contains the description of the ΩCP instruction to conditionally branch to another instruction. The first argument is compared against the character pointed to by last and the branching is performed if the last character is less than the argument. The second argument is the number of the instruction to set the program counter to.


GOTO_LE

public static final OcpCode GOTO_LE
The constant GOTO_LE contains the description of the ΩCP instruction to conditionally branch to another instruction. The first argument is compared against the character pointed to by last and the branching is performed if the last character is less or equal than the argument. The second argument is the number of the instruction to set the program counter to.


GOTO_GT

public static final OcpCode GOTO_GT
The constant GOTO_GT contains the description of the ΩCP instruction to conditionally branch to another instruction. The first argument is compared against the character pointed to by last and the branching is performed if the last character is greater than the argument. The second argument is the number of the instruction to set the program counter to.


GOTO_GE

public static final OcpCode GOTO_GE
The constant GOTO_GE contains the description of the ΩCP instruction to conditionally branch to another instruction. The first argument is compared against the character pointed to by last and the branching is performed if the last character is greater or equal than the argument. The second argument is the number of the instruction to set the program counter to.


GOTO_NO_ADVANCE

public static final OcpCode GOTO_NO_ADVANCE
The constant GOTO_NO_ADVANCE contains the description of the ΩCP instruction to conditionally branch to another instruction. The value of last is incremented and the branching is performed if last has reached the end of input. The argument is the number of the instruction to set the program counter to.


GOTO_BEG

public static final OcpCode GOTO_BEG
The constant GOTO_BEG contains the description of the ΩCP instruction to conditionally branch to another instruction. The branching is performed at the beginning of input. The argument is the number of the instruction to set the program counter to.


GOTO_END

public static final OcpCode GOTO_END
The constant GOTO_END contains the description of the ΩCP instruction to conditionally branch to another instruction. The branching is performed at the end of input. The argument is the number of the instruction to set the program counter to.


STOP

public static final OcpCode STOP
The constant STOP contains the description of the ΩCP instruction to stop the processing of the current prefix.

Field Detail

OP_ADD

public static final int OP_ADD
The constant OP_ADD contains the op code for the ΩCP instruction to add two numbers from the stack.

See Also:
ADD, Constant Field Values

OP_DIV

public static final int OP_DIV
The constant OP_DIV contains the op code for the ΩCP instruction to divide two numbers from the stack.

See Also:
DIV, Constant Field Values

OP_GOTO

public static final int OP_GOTO
The constant OP_GOTO contains the op code for the ΩCP instruction to adjust the program counter.

See Also:
GOTO, Constant Field Values

OP_GOTO_BEG

public static final int OP_GOTO_BEG
The constant OP_GOTO_BEG contains the op code for the ΩCP instruction to conditionally adjust the program counter at the beginning of input.

See Also:
GOTO_BEG, Constant Field Values

OP_GOTO_END

public static final int OP_GOTO_END
The constant OP_GOTO_END contains the op code for the ΩCP instruction to conditionally adjust the program counter at the end of input.

See Also:
GOTO_END, Constant Field Values

OP_GOTO_EQ

public static final int OP_GOTO_EQ
The constant OP_GOTO_EQ contains the op code for the ΩCP instruction conditionally adjust the program counter.

See Also:
GOTO_EQ, Constant Field Values

OP_GOTO_GE

public static final int OP_GOTO_GE
The constant OP_GOTO_GE contains the op code for the ΩCP instruction conditionally adjust the program counter.

See Also:
GOTO_GE, Constant Field Values

OP_GOTO_GT

public static final int OP_GOTO_GT
The constant OP_GOTO_GT contains the op code for the ΩCP instruction to conditionally adjust the program counter.

See Also:
GOTO_GT, Constant Field Values

OP_GOTO_LE

public static final int OP_GOTO_LE
The constant OP_GOTO_LE contains the op code for the ΩCP instruction to conditionally adjust the program counter.

See Also:
GOTO_LE, Constant Field Values

OP_GOTO_LT

public static final int OP_GOTO_LT
The constant OP_GOTO_LT contains the op code for the ΩCP instruction to conditionally adjust the program counter.

See Also:
GOTO_LT, Constant Field Values

OP_GOTO_NE

public static final int OP_GOTO_NE
The constant OP_GOTO_NE contains the op code for the ΩCP instruction to conditionally adjust the program counter.

See Also:
GOTO_NE, Constant Field Values

OP_GOTO_NO_ADVANCE

public static final int OP_GOTO_NO_ADVANCE
The constant OP_GOTO_NO_ADVANCE contains the op code for the ocp instruction to conditionally adjust the program counter after advancing last.

See Also:
GOTO_NO_ADVANCE, Constant Field Values

OP_LEFT_BACKUP

public static final int OP_LEFT_BACKUP
The constant OP_LEFT_BACKUP contains the op code for the ΩCP instruction to decrement the last pointer by 1.

See Also:
LEFT_BACKUP, Constant Field Values

OP_LEFT_RETURN

public static final int OP_LEFT_RETURN
The constant OP_LEFT_RETURN contains the op code for the ΩCP instruction to rest last to first - 1.

See Also:
LEFT_RETURN, Constant Field Values

OP_LEFT_START

public static final int OP_LEFT_START
The constant OP_LEFT_START contains the op code for the ΩCP instruction to set first to last + 1.

See Also:
LEFT_START, Constant Field Values

OP_LOOKUP

public static final int OP_LOOKUP
The constant OP_LOOKUP contains the op code for the ΩCP instruction to lookup a table entry.

See Also:
LOOKUP, Constant Field Values

OP_MOD

public static final int OP_MOD
The constant OP_MOD contains the op code for the ΩCP instruction to compute the remainder of two arguments from the stack.

See Also:
MOD, Constant Field Values

OP_MULT

public static final int OP_MULT
The constant OP_MULT contains the op code for the ΩCP instruction to multiply two arguments from the stack.

See Also:
MULT, Constant Field Values

OP_PBACK_CHAR

public static final int OP_PBACK_CHAR
The constant OP_PBACK_CHAR contains the op code for the ΩCP instruction to push back a character from the right end of the prefix

See Also:
PBACK_CHAR, Constant Field Values

OP_PBACK_LCHAR

public static final int OP_PBACK_LCHAR
The constant OP_PBACK_LCHAR contains the op code for the ΩCP instruction to push back a character from the left end of the prefix.

See Also:
PBACK_LCHAR, Constant Field Values

OP_PBACK_NUM

public static final int OP_PBACK_NUM
The constant OP_PBACK_NUM contains the op code for the ΩCP instruction to push back a number.

See Also:
PBACK_NUM, Constant Field Values

OP_PBACK_OUTPUT

public static final int OP_PBACK_OUTPUT
The constant OP_PBACK_OUTPUT contains the op code for the ΩCP instruction to push back a character from the arithmetic stack.

See Also:
PBACK_OUTPUT, Constant Field Values

OP_PBACK_SOME

public static final int OP_PBACK_SOME
The constant OP_PBACK_SOME contains the op code for the ΩCP instruction to push back a match.

See Also:
PBACK_SOME, Constant Field Values

OP_PUSH_CHAR

public static final int OP_PUSH_CHAR
The constant OP_PUSH_CHAR contains the op code for the ΩCP instruction to push back a character.

See Also:
PUSH_CHAR, Constant Field Values

OP_PUSH_LCHAR

public static final int OP_PUSH_LCHAR
The constant OP_PUSH_LCHAR contains the op code for the ΩCP instruction to push a referenced character.

See Also:
PUSH_LCHAR, Constant Field Values

OP_PUSH_NUM

public static final int OP_PUSH_NUM
The constant OP_PUSH_NUM contains the op code for the ΩCP instruction to push a number.

See Also:
PUSH_NUM, Constant Field Values

OP_RIGHT_CHAR

public static final int OP_RIGHT_CHAR
The constant OP_RIGHT_CHAR contains the op code for the ΩCP instruction to output a character from the right end of the prefix.

See Also:
RIGHT_CHAR, Constant Field Values

OP_RIGHT_LCHAR

public static final int OP_RIGHT_LCHAR
The constant OP_RIGHT_LCHAR contains the op code for the ΩCP instruction to output a character from the left end of the prefix.

See Also:
RIGHT_LCHAR, Constant Field Values

OP_RIGHT_NUM

public static final int OP_RIGHT_NUM
The constant OP_RIGHT_NUM contains the op code for the ΩCP instruction to output a constant.

See Also:
RIGHT_NUM, Constant Field Values

OP_RIGHT_OUTPUT

public static final int OP_RIGHT_OUTPUT
The constant OP_RIGHT_OUTPUT contains the op code for the ΩCP instruction to pop a value off the arithmetic stack and output it.

See Also:
RIGHT_OUTPUT, Constant Field Values

OP_RIGHT_SOME

public static final int OP_RIGHT_SOME
The constant OP_RIGHT_SOME contains the op code for the ΩCP instruction to output some characters of the prefix.

See Also:
RIGHT_SOME, Constant Field Values

OP_STATE_CHANGE

public static final int OP_STATE_CHANGE
The constant OP_STATE_CHANGE contains the op code for the ΩCP instruction to set a new state.

See Also:
STATE_CHANGE, Constant Field Values

OP_STATE_POP

public static final int OP_STATE_POP
The constant OP_STATE_POP contains the op code for the ΩCP instruction to pop a state from the state stack.

See Also:
STATE_POP, Constant Field Values

OP_STATE_PUSH

public static final int OP_STATE_PUSH
The constant OP_STATE_PUSH contains the op code for the ΩCP instruction to push a state onto the state stack.

See Also:
STATE_PUSH, Constant Field Values

OP_STOP

public static final int OP_STOP
The constant OP_STOP contains the op code for the ΩCP instruction to end the processing.

See Also:
STOP, Constant Field Values

OP_SUB

public static final int OP_SUB
The constant OP_SUB contains the op code for the ΩCP instruction to subtract two numbers from the stack.

See Also:
SUB, Constant Field Values

ARGUMENT_BIT_MASK

public static final int ARGUMENT_BIT_MASK
The constant ARGUMENT_BIT_MASK contains the bit mask for the lower 24 bits used as arguments in the ΩCP engine.

See Also:
Constant Field Values

OPCODE_OFFSET

public static final int OPCODE_OFFSET
The constant OPCODE_OFFSET contains the offset for the op code.

See Also:
Constant Field Values
Method Detail

values

public static final OcpCode[] 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(OcpCode c : OcpCode.values())
        System.out.println(c);

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

valueOf

public static OcpCode 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

get

public static OcpCode get(int opcode)
Get the OcpCode for a given op code.

Parameters:
opcode - the op code
Returns:
the op code or null for an unknown op code

getArguments

public OcpArgumentType[] getArguments()
Getter for the description of the arguments of the instruction. The description is a list of the following bytes:
n
The corresponding argument is a number.
c
The corresponding argument is a character code.
l
The corresponding argument is a label, i.e. a reference to a code position.
s
The corresponding argument is a state, i.e. a reference to a state number.

Returns:
the args

getOpcode

public int getOpcode()
Getter for opcode.

Returns:
the opcode

getInstruction

public java.lang.String getInstruction()
Getter for instruction.

Returns:
the instruction

inst

public int inst()
Get the first word of the instruction withput argument.

Returns:
the instruction without argument

inst

public int inst(int arg)
Get the first word of the instruction with one argument.

Parameters:
arg - the argument
Returns:
the instruction with one argument