package ch.kulp.jetty;

public enum Operation {
    BITWISE_OR(0x0, "|", true, true),
    BITWISE_AND(0x1, "&", false, false),
    ADD(0x2, "+", true, true),
    MULTIPLY(0x3, "*", false, false),
    PACK(0x4, "^^", true, false),
    SHIFT_LEFT(0x5, "<<", false, true),
    COMPARE_LT(0x6, "<", false, false),
    COMPARE_EQ(0x7, "==", false, false),
    COMPARE_GE(0x8, ">=", false, false),
    BITWISE_ANDN(0x9, "&~", false, true),
    BITWISE_XOR(0xa, "^", true, true),
    SUBTRACT(0xb, "-", false, true),
    BITWISE_XORN(0xc, "^~", false, false),
    SHIFT_RIGHT_LOGIC(0xd, ">>", false, true),
    COMPARE_NE(0xe, "<>", false, false),
    SHIFT_RIGHT_ARITH(0xf, ">>>", false, true);

    int val;
    String opName;
    boolean inertX, inertY;

    Operation(int val, String opName, boolean inertX, boolean inertY) {
        this.val = val;
        this.opName = opName;
        this.inertX = inertX;
        this.inertY = inertY;
    }

    static Operation get(int val) {
        return values()[val];
    }

    @Override
    public String toString() {
        return opName;
    }

    public boolean isIdentityWithA() {
        return this == Operation.ADD || this == Operation.BITWISE_OR;
    }
}

@@ -49,39 +49,78 @@
     
-BITWISE_OR(
+// @formatter:off%0A    BITWISE_OR        ( 
 0x0
+ 
 , %22%7C%22
+   
 , true
+  
 , true
+  
 ),%0A 
@@ -137,174 +137,266 @@
 _AND
-(
+       ( 
 0x1
+ 
 , %22&%22
+   
 , false
+ 
 , false
+ 
 ),%0A    
-ADD(
+BITWISE_XOR       ( 
 0x2
+ 
 , %22
-+%22
+%5E%22   
 , true
+  
 , true
+  
 ),%0A    
-MULTIPLY(
+SHIFT_RIGHT_ARITH ( 
 0x3
+ 
 , %22
-*%22
+%3E%3E%22  
 , false
+ 
 , 
-false
+true  
 ),%0A
+%0A
     
-PACK(
+ADD               ( 
 0x4
+ 
 , %22
-%5E%5E%22
++%22   
 , true
-, false),%0A    SHIFT_LEFT(
+  , true  ),%0A    MULTIPLY          ( 
 0x5
+ 
 , %22
-%3C%3C%22
+*%22   
 , false
+ 
 , 
-true
+false 
 ),%0A 
@@ -410,33 +410,48 @@
 ARE_
-LT(
+EQ        ( 
 0x6
+ 
 , %22
-%3C%22
+==%22  
 , false
+ 
 , false
+ 
 ),%0A 
@@ -465,75 +465,104 @@
 ARE_
-EQ(
+LT        ( 
 0x7
+ 
 , %22
-==%22
+%3C%22   
 , false
+ 
 , false
+ 
 ),%0A
+%0A
     
-COMPARE_GE(
+BITWISE_ORN       ( 
 0x8
+ 
 , %22
-%3E=%22
+%7C~%22  
 , false
+ 
 , 
-false
+true  
 ),%0A 
@@ -580,150 +580,210 @@
 ANDN
-(
+      ( 
 0x9
+ 
 , %22&~%22
+  
 , false
+ 
 , true
+  
 ),%0A    
-BITWISE_XOR(
+PACK              ( 
 0xa
+ 
 , %22%5E
+%5E
 %22
+  
 , true
-, true),%0A    SUBTRACT(
+  , false ),%0A    SHIFT_RIGHT_LOGIC ( 
 0xb
+ 
 , %22
--%22
+%3E%3E%3E%22 
 , false
+ 
 , true
+  
 ),%0A
+%0A
     
-BITWISE_XORN(
+SUBTRACT          ( 
 0xc
+ 
 , %22
-%5E~%22
+-%22   
 , false
+ 
 , 
-false
+true  
 ),%0A 
@@ -795,133 +795,183 @@
 IFT_
-RIGHT_LOGIC(
+LEFT        ( 
 0xd
+ 
 , %22
-%3E%3E%22
+%3C%3C%22  
 , false
+ 
 , true
+  
 ),%0A    
-COMPARE_NE(
+TEST_BIT          ( 
 0xe
+ 
 , %22
-%3C%3E%22
+@%22   
 , false
+ 
 , false
+ 
 ),%0A    
-SHIFT_RIGHT_ARITH(
+COMPARE_GE        ( 
 0xf
+ 
 , %22%3E
-%3E%3E%22
+=%22  
 , false
+ 
 , 
-true);
+false );%0A    // @formatter:on
 %0A%0A  

Update Operations for new ops in tenyr v0.8.0