2003/06/07 12:00:57
[org.ibex.core.git] / src / org / xwt / js / ByteCodes.java
similarity index 83%
rename from src/org/xwt/js/OpCodes.java
rename to src/org/xwt/js/ByteCodes.java
index 428d06f..8e79a9a 100644 (file)
@@ -1,8 +1,15 @@
-// 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;       
@@ -14,15 +21,13 @@ public interface OpCodes {
     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;           
@@ -51,9 +56,6 @@ public interface OpCodes {
     /** 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;