-// Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL]
+// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
package org.xwt.js;
-/** each instruction is an opcode and an optional literal literal. */
-public interface OpCodes {
+/**
+ * Constants for the various JavaScript ByteCode operations.
+ *
+ * Each instruction is an opcode and an optional literal literal; the
+ * arithmetic Tokens are also valid. They are: BITOR, BITXOR, BITAND,
+ * ADD, INC, DEC, SUB, MUL, DIV, MOD, LSH, RSH, URSH, LT, LE, GT, GE,
+ * EQ, NE
+ */
+interface ByteCodes {
/** push the literal onto the stack */
public static final byte LITERAL = -2;
public static final byte OBJECT = -4;
/** create a new instance; literal is a reference to the corresponding ForthBlock */
- public static final byte FUNCTION = -5;
+ public static final byte NEWFUNCTION = -5;
/** pop a string off the stack and declare it in the current scope */
public static final byte DECLARE = -6;
/** push a reference to the current scope onto the stack */
- /*
- public static final byte THIS = -7;
- */
+ public static final byte TOPSCOPE = -7;
/** pop two elements off the stack; push stack[-1].get(stack[top]) */
public static final byte GET = -8;
/** pop an element; push a JS.Array containing the keys of the popped element */
public static final byte PUSHKEYS = -19;
- /** FIXME: execute the ForthBlock pointed to by the literal */
- public static final byte EXPR = -20;
-
/** swap the top two elements on the stack */
public static final byte SWAP = -23;