/** create a new instance; literal is a reference to the corresponding ForthBlock */
public static final byte NEWFUNCTION = -5;
- /** pop a string off the stack and declare it in the current scope */
+ /** if given a non-null argument declare its argument in the current scope and push
+ it to the stack, else, declares the element on the top of the stack and leaves it
+ there */
public static final byte DECLARE = -6;
/** push a reference to the current scope onto the stack */
public static final byte TOPSCOPE = -7;
- /** pop two elements off the stack; push stack[-1].get(stack[top]) */
+ /** if given a null literal pop two elements off the stack; push stack[-1].get(stack[top])
+ else pop one element off the stack, push stack[top].get(literal) */
public static final byte GET = -8;
/** push stack[-1].get(stack[top]) */
/** execute the ForthBlock pointed to by the literal until BREAK encountered; push TRUE onto the stack for the first iteration
* and FALSE for all subsequent iterations */
- public static final byte LOOP = -22;
-
-
+ public static final byte LOOP = -22;
+
+ /** pop three elements off the stack; method arguments, method name, and an object to call the method on, then calls the method
+ Has a similar effect a a GET followed by a CALL */
+ public static final byte CALLMETHOD = -23;
+
+ /** finish a finally block and carry out whatever instruction initiated the finally block */
+ public static final byte FINALLY_DONE = -24;
+
public static final String[] bytecodeToString = new String[] {
"", "", "LITERAL", "ARRAY", "OBJECT", "NEWFUNCTION", "DECLARE", "TOPSCOPE",
"GET", "GET_PRESERVE", "PUT", "JT", "JF", "JMP", "POP", "CALL", "PUSHKEYS",
- "SWAP", "NEWSCOPE", "OLDSCOPE", "DUP", "LABEL", "LOOP"
+ "SWAP", "NEWSCOPE", "OLDSCOPE", "DUP", "LABEL", "LOOP", "CALLMETHOD",
+ "FINALLY_DONE"
};
}