|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.ocpware.compiler.parser.State
public class State
The class state represents a state in the ΩCP engine for the compiler.
| Constructor Summary | |
|---|---|
State()
Creates a new object. |
|
| Method Summary | |
|---|---|
void |
close()
Close the state by adding some final instructions. |
void |
fillIn(java.util.List<java.lang.Integer> holes)
Adjust some instructions by adding the current instruction pointer to them. |
int[] |
getInstructions()
Getter for the array of instructions. |
int |
getNumberExpressions()
Getter for the number of expressions. |
int |
getPointer()
Getter for the current pointer to the end of the code. |
void |
incrExpressions()
Increment the number of expressions contained in this state. |
int |
putInstruction(int opCode)
Put an instruction of one op code and no argument into the store. |
int |
putInstruction(int opCode,
int arg1)
Put an instruction of one op code and one argument into the store. |
int |
putInstruction(int opCode,
int arg1,
int arg2)
Put an instruction of one op code and two arguments into the store. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public State()
| Method Detail |
|---|
public void close()
throws ArgmentTooBigException,
java.io.IOException,
IllegalOpcodeException
java.io.IOException - in case of an I/O error
ArgmentTooBigException - if the argument of the instruction exceeds
the 16 bit value
IllegalOpcodeException - in case of an illegal op codepublic void fillIn(java.util.List<java.lang.Integer> holes)
The conditional gotos contain the jump position in the second argument. This is generated as 0. Adding the position fixes this hole.
The other gotos contain the jump position in the first argument. The instruction contains the op code only. Adding the position fixes this hole and leaves the op code intact.
holes - the instructions to adjustpublic int[] getInstructions()
public int getNumberExpressions()
public int getPointer()
public void incrExpressions()
public int putInstruction(int opCode)
throws java.io.IOException,
IllegalOpcodeException
opCode - the op code
java.io.IOException - in case of an I/O error
IllegalOpcodeException - in case of an illegal op code
public int putInstruction(int opCode,
int arg1)
throws ArgmentTooBigException,
java.io.IOException,
IllegalOpcodeException
opCode - the op codearg1 - the first argument
java.io.IOException - in case of an I/O error
ArgmentTooBigException - if the argument of the instruction exceeds
the 16 bit value
IllegalOpcodeException - in case of an illegal op code
public int putInstruction(int opCode,
int arg1,
int arg2)
throws ArgmentTooBigException,
java.io.IOException,
IllegalOpcodeException
opCode - the op codearg1 - the first argumentarg2 - the second argument
java.io.IOException - in case of an I/O error
ArgmentTooBigException - if the argument of the instruction exceeds
the 16 bit value
IllegalOpcodeException - in case of an illegal op code
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||