1 12 package org.eclipse.jdt.internal.compiler.ast; 13 14 import org.eclipse.jdt.internal.compiler.flow.FlowInfo; 15 import org.eclipse.jdt.internal.compiler.util.Util; 16 17 public abstract class OperatorExpression extends Expression implements OperatorIds { 18 19 public static int[][] OperatorSignatures = new int[NumberOfTables][]; 20 21 static {classInitialize();} 22 23 26 public OperatorExpression() { 27 super(); 28 } 29 public static final void classInitialize() { 30 OperatorSignatures[AND] = get_AND(); 31 OperatorSignatures[AND_AND] = get_AND_AND(); 32 OperatorSignatures[DIVIDE] = get_DIVIDE(); 33 OperatorSignatures[EQUAL_EQUAL] = get_EQUAL_EQUAL(); 34 OperatorSignatures[GREATER] = get_GREATER(); 35 OperatorSignatures[GREATER_EQUAL] = get_GREATER_EQUAL(); 36 OperatorSignatures[LEFT_SHIFT] = get_LEFT_SHIFT(); 37 OperatorSignatures[LESS] = get_LESS(); 38 OperatorSignatures[LESS_EQUAL] = get_LESS_EQUAL(); 39 OperatorSignatures[MINUS] = get_MINUS(); 40 OperatorSignatures[MULTIPLY] = get_MULTIPLY(); 41 OperatorSignatures[OR] = get_OR(); 42 OperatorSignatures[OR_OR] = get_OR_OR(); 43 OperatorSignatures[PLUS] = get_PLUS(); 44 OperatorSignatures[REMAINDER] = get_REMAINDER(); 45 OperatorSignatures[RIGHT_SHIFT] = get_RIGHT_SHIFT(); 46 OperatorSignatures[UNSIGNED_RIGHT_SHIFT] = get_UNSIGNED_RIGHT_SHIFT(); 47 OperatorSignatures[XOR] = get_XOR(); 48 } 49 50 public static final String generateTableTestCase(){ 51 54 58 59 int[] operators = new int[]{AND,AND_AND,DIVIDE,GREATER,GREATER_EQUAL, 60 LEFT_SHIFT,LESS,LESS_EQUAL,MINUS,MULTIPLY,OR,OR_OR,PLUS,REMAINDER, 61 RIGHT_SHIFT,UNSIGNED_RIGHT_SHIFT,XOR}; 62 63 class Decode { 64 public final String constant(int code){ 65 switch(code){ 66 case T_boolean : return "true"; case T_byte : return "((byte) 3)"; case T_char : return "'A'"; case T_double : return "300.0d"; case T_float : return "100.0f"; case T_int : return "1"; case T_long : return "7L"; case T_JavaLangString : return "\"hello-world\""; case T_null : return "null"; case T_short : return "((short) 5)"; case T_JavaLangObject : return "null";} return Util.EMPTY_STRING;} 78 79 public final String type(int code){ 80 switch(code){ 81 case T_boolean : return "z"; case T_byte : return "b"; case T_char : return "c"; case T_double : return "d"; case T_float : return "f"; case T_int : return "i"; case T_long : return "l"; case T_JavaLangString : return "str"; case T_null : return "null"; case T_short : return "s"; case T_JavaLangObject : return "obj";} return "xxx";} 94 public final String operator(int operator){ 95 switch (operator) { 96 case EQUAL_EQUAL : return "=="; case LESS_EQUAL : return "<="; case GREATER_EQUAL :return ">="; case LEFT_SHIFT : return "<<"; case RIGHT_SHIFT : return ">>"; case UNSIGNED_RIGHT_SHIFT : return ">>>"; case OR_OR :return "||"; case AND_AND : return "&&"; case PLUS : return "+"; case MINUS : return "-"; case NOT : return "!"; case REMAINDER : return "%"; case XOR : return "^"; case AND : return "&"; case MULTIPLY : return "*"; case OR : return "|"; case TWIDDLE : return "~"; case DIVIDE : return "/"; case GREATER : return ">"; case LESS : return "<"; } return "????";} } 118 119 120 Decode decode = new Decode(); 121 String s; 122 123 s = "\tpublic static void binaryOperationTablesTestCase(){\n" + 125 "\t\t//TC test : all binary operation (described in tables)\n"+ "\t\t//method automatically generated by\n"+ "\t\t//org.eclipse.jdt.internal.compiler.ast.OperatorExpression.generateTableTestCase();\n"+ 129 "\t\tString str0;\t String str\t= "+decode.constant(T_JavaLangString)+";\n"+ "\t\tint i0;\t int i\t= "+decode.constant(T_int)+";\n"+ "\t\tboolean z0;\t boolean z\t= "+decode.constant(T_boolean)+";\n"+ "\t\tchar c0; \t char c\t= "+decode.constant(T_char)+";\n"+ "\t\tfloat f0; \t float f\t= "+decode.constant(T_float)+";\n"+ "\t\tdouble d0;\t double d\t= "+decode.constant(T_double)+";\n"+ "\t\tbyte b0; \t byte b\t= "+decode.constant(T_byte)+";\n"+ "\t\tshort s0; \t short s\t= "+decode.constant(T_short)+";\n"+ "\t\tlong l0; \t long l\t= "+decode.constant(T_long)+";\n"+ "\t\tObject obj0; \t Object obj\t= "+decode.constant(T_JavaLangObject)+";\n"+ "\n"; 141 int error = 0; 142 for (int i=0; i < operators.length; i++) 143 { int operator = operators[i]; 144 for (int left=0; left<16;left++) 145 for (int right=0; right<16;right++) 146 { int result = (OperatorSignatures[operator][(left<<4)+right]) & 0x0000F; 147 if (result != T_undefined) 148 149 155 { s += "\t\t"+decode.type(result)+"0"+" = "+decode.type(left); s += " "+decode.operator(operator)+" "+decode.type(right)+";\n"; String begin = result == T_JavaLangString ? "\t\tif (! " : "\t\tif ( "; String test = result == T_JavaLangString ? ".equals(" : " != ("; s += begin +decode.type(result)+"0"+test +decode.constant(left)+" " +decode.operator(operator)+" " +decode.constant(right)+"))\n"; s += "\t\t\tSystem.out.println("+ (++error) +");\n"; 165 } 166 } 167 } 168 169 return s += "\n\t\tSystem.out.println(\"binary tables test : done\");}"; } 171 172 public static final int[] get_AND(){ 173 174 179 int[] table = new int[16*16]; 180 181 195 table[(T_byte<<4)+T_byte] = (Byte2Int<<12) +(Byte2Int<<4) +T_int; 197 table[(T_byte<<4)+T_long] = (Byte2Long<<12)+(Long2Long<<4)+T_long; 198 table[(T_byte<<4)+T_short] = (Byte2Int<<12) +(Short2Int<<4)+T_int; 199 table[(T_byte<<4)+T_char] = (Byte2Int<<12) +(Char2Int<<4) +T_int; 206 table[(T_byte<<4)+T_int] = (Byte2Int<<12) +(Int2Int<<4) +T_int; 207 209 table[(T_long<<4)+T_byte] = (Long2Long<<12)+(Byte2Long<<4)+T_long; 211 table[(T_long<<4)+T_long] = (Long2Long<<12)+(Long2Long<<4)+T_long; 212 table[(T_long<<4)+T_short] = (Long2Long<<12)+(Short2Long<<4)+T_long; 213 table[(T_long<<4)+T_char] = (Long2Long<<12)+(Char2Long<<4)+T_long; 220 table[(T_long<<4)+T_int] = (Long2Long<<12)+(Int2Long<<4)+T_long; 221 223 table[(T_short<<4)+T_byte] = (Short2Int<<12)+(Byte2Int<<4)+T_int; 225 table[(T_short<<4)+T_long] = (Short2Long<<12)+(Long2Long<<4)+T_long; 226 table[(T_short<<4)+T_short] = (Short2Int<<12)+(Short2Int<<4)+T_int; 227 table[(T_short<<4)+T_char] = (Short2Int<<12)+(Char2Int<<4)+T_int; 234 table[(T_short<<4)+T_int] = (Short2Int<<12)+(Int2Int<<4)+T_int; 235 237 251 265 279 293 307 table[(T_boolean<<4)+T_boolean] = (Boolean2Boolean << 12)+(Boolean2Boolean << 4)+T_boolean; 317 321 table[(T_char<<4)+T_byte] = (Char2Int<<12)+(Byte2Int<<4)+T_int; 323 table[(T_char<<4)+T_long] = (Char2Long<<12)+(Long2Long<<4)+T_long; 324 table[(T_char<<4)+T_short] = (Char2Int<<12)+(Short2Int<<4)+T_int; 325 table[(T_char<<4)+T_char] = (Char2Int<<12)+(Char2Int<<4)+T_int; 332 table[(T_char<<4)+T_int] = (Char2Int<<12)+(Int2Int<<4)+T_int; 333 335 table[(T_int<<4)+T_byte] = (Int2Int<<12)+(Byte2Int<<4)+T_int; 337 table[(T_int<<4)+T_long] = (Int2Long<<12)+(Long2Long<<4)+T_long; 338 table[(T_int<<4)+T_short] = (Int2Int<<12)+(Short2Int<<4)+T_int; 339 table[(T_int<<4)+T_char] = (Int2Int<<12)+(Char2Int<<4)+T_int; 346 table[(T_int<<4)+T_int] = (Int2Int<<12)+(Int2Int<<4)+T_int; 347 349 363 return table; 364 } 365 366 public static final int[] get_AND_AND(){ 367 368 373 int[] table = new int[16*16]; 374 375 389 403 417 431 445 459 473 487 501 table[(T_boolean<<4)+T_boolean] = (Boolean2Boolean<<12)+(Boolean2Boolean<<4)+T_boolean; 511 515 529 543 return table; 557 } 558 559 public static final int[] get_DIVIDE(){ 560 561 566 567 569 return get_MINUS(); 570 } 571 572 public static final int[] get_EQUAL_EQUAL(){ 573 574 579 int[] table = new int[16*16]; 580 581 595 table[(T_byte<<4)+T_byte] = (Byte2Int<<12)+(Byte2Int<<4)+T_boolean; 597 table[(T_byte<<4)+T_long] = (Byte2Long<<12)+(Long2Long<<4)+T_boolean; 598 table[(T_byte<<4)+T_short] = (Byte2Int<<12)+(Short2Int<<4)+T_boolean; 599 table[(T_byte<<4)+T_double] = (Byte2Double<<12)+(Double2Double<<4)+T_boolean; 603 table[(T_byte<<4)+T_float] = (Byte2Float<<12)+(Float2Float<<4)+T_boolean; 604 table[(T_byte<<4)+T_char] = (Byte2Int<<12)+(Char2Int<<4)+T_boolean; 606 table[(T_byte<<4)+T_int] = (Byte2Int<<12)+(Int2Int<<4)+T_boolean; 607 609 table[(T_long<<4)+T_byte] = (Long2Long<<12)+(Byte2Long<<4)+T_boolean; 611 table[(T_long<<4)+T_long] = (Long2Long<<12)+(Long2Long<<4)+T_boolean; 612 table[(T_long<<4)+T_short] = (Long2Long<<12)+(Short2Long<<4)+T_boolean; 613 table[(T_long<<4)+T_double] = (Long2Double<<12)+(Double2Double<<4)+T_boolean; 617 table[(T_long<<4)+T_float] = (Long2Float<<12)+(Float2Float<<4)+T_boolean; 618 table[(T_long<<4)+T_char] = (Long2Long<<12)+(Char2Long<<4)+T_boolean; 620 table[(T_long<<4)+T_int] = (Long2Long<<12)+(Int2Long<<4)+T_boolean; 621 623 table[(T_short<<4)+T_byte] = (Short2Int<<12)+(Byte2Int<<4)+T_boolean; 625 table[(T_short<<4)+T_long] = (Short2Long<<12)+(Long2Long<<4)+T_boolean; 626 table[(T_short<<4)+T_short] = (Short2Int<<12)+(Short2Int<<4)+T_boolean; 627 table[(T_short<<4)+T_double] = (Short2Double<<12)+(Double2Double<<4)+T_boolean; 631 table[(T_short<<4)+T_float] = (Short2Float<<12)+(Float2Float<<4)+T_boolean; 632 table[(T_short<<4)+T_char] = (Short2Int<<12)+(Char2Int<<4)+T_boolean; 634 table[(T_short<<4)+T_int] = (Short2Int<<12)+(Int2Int<<4)+T_boolean; 635 637 651 table[(T_JavaLangString<<4)+T_JavaLangString] = 657 (T_JavaLangObject<<16)+(T_JavaLangString<<12)+(T_JavaLangObject<<8)+(T_JavaLangString<<4)+T_boolean; 658 table[(T_JavaLangString<<4)+T_JavaLangObject] = 659 (T_JavaLangObject<<16)+(T_JavaLangString<<12)+(T_JavaLangObject<<8)+(T_JavaLangObject<<4)+T_boolean; 660 table[(T_JavaLangString<<4)+T_null] = 666 (T_JavaLangObject<<16)+(T_JavaLangString<<12)+(T_JavaLangObject<<8)+(T_null<<4)+T_boolean; 667 668 table[(T_JavaLangObject<<4)+T_JavaLangString] = 674 (T_JavaLangObject<<16)+(T_JavaLangObject<<12)+(T_JavaLangObject<<8)+(T_JavaLangString<<4)+T_boolean; 675 table[(T_JavaLangObject<<4)+T_JavaLangObject] = 676 (T_JavaLangObject<<16)+(T_JavaLangObject<<12)+(T_JavaLangObject<<8)+(T_JavaLangObject<<4)+T_boolean; 677 table[(T_JavaLangObject<<4)+T_null] = 683 (T_JavaLangObject<<16)+(T_JavaLangObject<<12)+(T_JavaLangObject<<8)+(T_null<<4)+T_boolean; 684 685 table[(T_double<<4)+T_byte] = (Double2Double<<12)+(Byte2Double<<4)+T_boolean; 687 table[(T_double<<4)+T_long] = (Double2Double<<12)+(Long2Double<<4)+T_boolean; 688 table[(T_double<<4)+T_short] = (Double2Double<<12)+(Short2Double<<4)+T_boolean; 689 table[(T_double<<4)+T_double] = (Double2Double<<12)+(Double2Double<<4)+T_boolean; 693 table[(T_double<<4)+T_float] = (Double2Double<<12)+(Float2Double<<4)+T_boolean; 694 table[(T_double<<4)+T_char] = (Double2Double<<12)+(Char2Double<<4)+T_boolean; 696 table[(T_double<<4)+T_int] = (Double2Double<<12)+(Int2Double<<4)+T_boolean; 697 699 table[(T_float<<4)+T_byte] = (Float2Float<<12)+(Byte2Float<<4)+T_boolean; 701 table[(T_float<<4)+T_long] = (Float2Float<<12)+(Long2Float<<4)+T_boolean; 702 table[(T_float<<4)+T_short] = (Float2Float<<12)+(Short2Float<<4)+T_boolean; 703 table[(T_float<<4)+T_double] = (Float2Double<<12)+(Double2Double<<4)+T_boolean; 707 table[(T_float<<4)+T_float] = (Float2Float<<12)+(Float2Float<<4)+T_boolean; 708 table[(T_float<<4)+T_char] = (Float2Float<<12)+(Char2Float<<4)+T_boolean; 710 table[(T_float<<4)+T_int] = (Float2Float<<12)+(Int2Float<<4)+T_boolean; 711 713 table[(T_boolean<<4)+T_boolean] = (Boolean2Boolean<<12)+(Boolean2Boolean<<4)+T_boolean; 723 727 table[(T_char<<4)+T_byte] = (Char2Int<<12)+(Byte2Int<<4)+T_boolean; 729 table[(T_char<<4)+T_long] = (Char2Long<<12)+(Long2Long<<4)+T_boolean; 730 table[(T_char<<4)+T_short] = (Char2Int<<12)+(Short2Int<<4)+T_boolean; 731 table[(T_char<<4)+T_double] = (Char2Double<<12)+(Double2Double<<4)+T_boolean; 735 table[(T_char<<4)+T_float] = (Char2Float<<12)+(Float2Float<<4)+T_boolean; 736 table[(T_char<<4)+T_char] = (Char2Int<<12)+(Char2Int<<4)+T_boolean; 738 table[(T_char<<4)+T_int] = (Char2Int<<12)+(Int2Int<<4)+T_boolean; 739 741 table[(T_int<<4)+T_byte] = (Int2Int<<12)+(Byte2Int<<4)+T_boolean; 743 table[(T_int<<4)+T_long] = (Int2Long<<12)+(Long2Long<<4)+T_boolean; 744 table[(T_int<<4)+T_short] = (Int2Int<<12)+(Short2Int<<4)+T_boolean; 745 table[(T_int<<4)+T_double] = (Int2Double<<12)+(Double2Double<<4)+T_boolean; 749 table[(T_int<<4)+T_float] = (Int2Float<<12)+(Float2Float<<4)+T_boolean; 750 table[(T_int<<4)+T_char] = (Int2Int<<12)+(Char2Int<<4)+T_boolean; 752 table[(T_int<<4)+T_int] = (Int2Int<<12)+(Int2Int<<4)+T_boolean; 753 755 table[(T_null<<4)+T_JavaLangString] = 761 (T_JavaLangObject<<16)+(T_null<<12)+(T_JavaLangObject<<8)+(T_JavaLangString<<4)+T_boolean; 762 table[(T_null<<4)+T_JavaLangObject] = 763 (T_JavaLangObject<<16)+(T_null<<12)+(T_JavaLangObject<<8)+(T_JavaLangObject<<4)+T_boolean; 764 table[(T_null<<4)+T_null] = 770 (T_JavaLangObject<<16)+(T_null<<12)+(T_JavaLangObject<<8)+(T_null<<4)+T_boolean; 771 return table; 772 } 773 774 public static final int[] get_GREATER(){ 775 776 781 return get_LESS(); 783 } 784 785 public static final int[] get_GREATER_EQUAL(){ 786 787 792 return get_LESS(); 794 } 795 796 public static final int[] get_LEFT_SHIFT(){ 797 798 803 int[] table = new int[16*16]; 804 805 819 table[(T_byte<<4)+T_byte] = (Byte2Int<<12)+(Byte2Int<<4)+T_int; 821 table[(T_byte<<4)+T_long] = (Byte2Int<<12)+(Long2Int<<4)+T_int; 822 table[(T_byte<<4)+T_short] = (Byte2Int<<12)+(Short2Int<<4)+T_int; 823 table[(T_byte<<4)+T_char] = (Byte2Int<<12)+(Char2Int<<4)+T_int; 830 table[(T_byte<<4)+T_int] = (Byte2Int<<12)+(Int2Int<<4)+T_int; 831 833 table[(T_long<<4)+T_byte] = (Long2Long<<12)+(Byte2Int<<4)+T_long; 835 table[(T_long<<4)+T_long] = (Long2Long<<12)+(Long2Int<<4)+T_long; 836 table[(T_long<<4)+T_short] = (Long2Long<<12)+(Short2Int<<4)+T_long; 837 table[(T_long<<4)+T_char] = (Long2Long<<12)+(Char2Int<<4)+T_long; 844 table[(T_long<<4)+T_int] = (Long2Long<<12)+(Int2Int<<4)+T_long; 845 847 table[(T_short<<4)+T_byte] = (Short2Int<<12)+(Byte2Int<<4)+T_int; 849 table[(T_short<<4)+T_long] = (Short2Int<<12)+(Long2Int<<4)+T_int; 850 table[(T_short<<4)+T_short] = (Short2Int<<12)+(Short2Int<<4)+T_int; 851 table[(T_short<<4)+T_char] = (Short2Int<<12)+(Char2Int<<4)+T_int; 858 table[(T_short<<4)+T_int] = (Short2Int<<12)+(Int2Int<<4)+T_int; 859 861 875 889 903 917 931 945 table[(T_char<<4)+T_byte] = (Char2Int<<12)+(Byte2Int<<4)+T_int; 947 table[(T_char<<4)+T_long] = (Char2Int<<12)+(Long2Int<<4)+T_int; 948 table[(T_char<<4)+T_short] = (Char2Int<<12)+(Short2Int<<4)+T_int; 949 table[(T_char<<4)+T_char] = (Char2Int<<12)+(Char2Int<<4)+T_int; 956 table[(T_char<<4)+T_int] = (Char2Int<<12)+(Int2Int<<4)+T_int; 957 959 table[(T_int<<4)+T_byte] = (Int2Int<<12)+(Byte2Int<<4)+T_int; 961 table[(T_int<<4)+T_long] = (Int2Int<<12)+(Long2Int<<4)+T_int; 962 table[(T_int<<4)+T_short] = (Int2Int<<12)+(Short2Int<<4)+T_int; 963 table[(T_int<<4)+T_char] = (Int2Int<<12)+(Char2Int<<4)+T_int; 970 table[(T_int<<4)+T_int] = (Int2Int<<12)+(Int2Int<<4)+T_int; 971 973 987 return table; 988 } 989 990 public static final int[] get_LESS(){ 991 992 997 int[] table = new int[16*16]; 998 999 1013 table[(T_byte<<4)+T_byte] = (Byte2Int<<12)+(Byte2Int<<4)+T_boolean; 1015 table[(T_byte<<4)+T_long] = (Byte2Long<<12)+(Long2Long<<4)+T_boolean; 1016 table[(T_byte<<4)+T_short] = (Byte2Int<<12)+(Short2Int<<4)+T_boolean; 1017 table[(T_byte<<4)+T_double] = (Byte2Double<<12)+(Double2Double<<4)+T_boolean; 1021 table[(T_byte<<4)+T_float] = (Byte2Float<<12)+(Float2Float<<4)+T_boolean; 1022 table[(T_byte<<4)+T_char] = (Byte2Int<<12)+(Char2Int<<4)+T_boolean; 1024 table[(T_byte<<4)+T_int] = (Byte2Int<<12)+(Int2Int<<4)+T_boolean; 1025 1027 table[(T_long<<4)+T_byte] = (Long2Long<<12)+(Byte2Long<<4)+T_boolean; 1029 table[(T_long<<4)+T_long] = (Long2Long<<12)+(Long2Long<<4)+T_boolean; 1030 table[(T_long<<4)+T_short] = (Long2Long<<12)+(Short2Long<<4)+T_boolean; 1031 table[(T_long<<4)+T_double] = (Long2Double<<12)+(Double2Double<<4)+T_boolean; 1035 table[(T_long<<4)+T_float] = (Long2Float<<12)+(Float2Float<<4)+T_boolean; 1036 table[(T_long<<4)+T_char] = (Long2Long<<12)+(Char2Long<<4)+T_boolean; 1038 table[(T_long<<4)+T_int] = (Long2Long<<12)+(Int2Long<<4)+T_boolean; 1039 1041 table[(T_short<<4)+T_byte] = (Short2Int<<12)+(Byte2Int<<4)+T_boolean; 1043 table[(T_short<<4)+T_long] = (Short2Long<<12)+(Long2Long<<4)+T_boolean; 1044 table[(T_short<<4)+T_short] = (Short2Int<<12)+(Short2Int<<4)+T_boolean; 1045 table[(T_short<<4)+T_double] = (Short2Double<<12)+(Double2Double<<4)+T_boolean; 1049 table[(T_short<<4)+T_float] = (Short2Float<<12)+(Float2Float<<4)+T_boolean; 1050 table[(T_short<<4)+T_char] = (Short2Int<<12)+(Char2Int<<4)+T_boolean; 1052 table[(T_short<<4)+T_int] = (Short2Int<<12)+(Int2Int<<4)+T_boolean; 1053 1055 1069 1083 1097 table[(T_double<<4)+T_byte] = (Double2Double<<12)+(Byte2Double<<4)+T_boolean; 1099 table[(T_double<<4)+T_long] = (Double2Double<<12)+(Long2Double<<4)+T_boolean; 1100 table[(T_double<<4)+T_short] = (Double2Double<<12)+(Short2Double<<4)+T_boolean; 1101 table[(T_double<<4)+T_double] = (Double2Double<<12)+(Double2Double<<4)+T_boolean; 1105 table[(T_double<<4)+T_float] = (Double2Double<<12)+(Float2Double<<4)+T_boolean; 1106 table[(T_double<<4)+T_char] = (Double2Double<<12)+(Char2Double<<4)+T_boolean; 1108 table[(T_double<<4)+T_int] = (Double2Double<<12)+(Int2Double<<4)+T_boolean; 1109 1111 table[(T_float<<4)+T_byte] = (Float2Float<<12)+(Byte2Float<<4)+T_boolean; 1113 table[(T_float<<4)+T_long] = (Float2Float<<12)+(Long2Float<<4)+T_boolean; 1114 table[(T_float<<4)+T_short] = (Float2Float<<12)+(Short2Float<<4)+T_boolean; 1115 table[(T_float<<4)+T_double] = (Float2Double<<12)+(Double2Double<<4)+T_boolean; 1119 table[(T_float<<4)+T_float] = (Float2Float<<12)+(Float2Float<<4)+T_boolean; 1120 table[(T_float<<4)+T_char] = (Float2Float<<12)+(Char2Float<<4)+T_boolean; 1122 table[(T_float<<4)+T_int] = (Float2Float<<12)+(Int2Float<<4)+T_boolean; 1123 1125 1139 table[(T_char<<4)+T_byte] = (Char2Int<<12)+(Byte2Int<<4)+T_boolean; 1141 table[(T_char<<4)+T_long] = (Char2Long<<12)+(Long2Long<<4)+T_boolean; 1142 table[(T_char<<4)+T_short] = (Char2Int<<12)+(Short2Int<<4)+T_boolean; 1143 table[(T_char<<4)+T_double] = (Char2Double<<12)+(Double2Double<<4)+T_boolean; 1147 table[(T_char<<4)+T_float] = (Char2Float<<12)+(Float2Float<<4)+T_boolean; 1148 table[(T_char<<4)+T_char] = (Char2Int<<12)+(Char2Int<<4)+T_boolean; 1150 table[(T_char<<4)+T_int] = (Char2Int<<12)+(Int2Int<<4)+T_boolean; 1151 1153 table[(T_int<<4)+T_byte] = (Int2Int<<12)+(Byte2Int<<4)+T_boolean; 1155 table[(T_int<<4)+T_long] = (Int2Long<<12)+(Long2Long<<4)+T_boolean; 1156 table[(T_int<<4)+T_short] = (Int2Int<<12)+(Short2Int<<4)+T_boolean; 1157 table[(T_int<<4)+T_double] = (Int2Double<<12)+(Double2Double<<4)+T_boolean; 1161 table[(T_int<<4)+T_float] = (Int2Float<<12)+(Float2Float<<4)+T_boolean; 1162 table[(T_int<<4)+T_char] = (Int2Int<<12)+(Char2Int<<4)+T_boolean; 1164 table[(T_int<<4)+T_int] = (Int2Int<<12)+(Int2Int<<4)+T_boolean; 1165 1167 1181 return table; 1182 } 1183 1184 public static final int[] get_LESS_EQUAL(){ 1185 1186 1191 return get_LESS(); 1193 } 1194 1195 public static final int[] get_MINUS(){ 1196 1197 1202 int[] table = (int[]) get_PLUS().clone(); 1203 1204 table[(T_JavaLangString<<4)+T_byte] = T_undefined; 1206 table[(T_JavaLangString<<4)+T_long] = T_undefined; 1207 table[(T_JavaLangString<<4)+T_short] = T_undefined; 1208 table[(T_JavaLangString<<4)+T_void] = T_undefined; 1209 table[(T_JavaLangString<<4)+T_JavaLangString] = T_undefined; 1210 table[(T_JavaLangString<<4)+T_JavaLangObject] = T_undefined; 1211 table[(T_JavaLangString<<4)+T_double] = T_undefined; 1212 table[(T_JavaLangString<<4)+T_float] = T_undefined; 1213 table[(T_JavaLangString<<4)+T_boolean] = T_undefined; 1214 table[(T_JavaLangString<<4)+T_char] = T_undefined; 1215 table[(T_JavaLangString<<4)+T_int] = T_undefined; 1216 table[(T_JavaLangString<<4)+T_null] = T_undefined; 1217 1218 table[(T_byte<<4) +T_JavaLangString] = T_undefined; 1219 table[(T_long<<4) +T_JavaLangString] = T_undefined; 1220 table[(T_short<<4) +T_JavaLangString] = T_undefined; 1221 table[(T_void<<4) +T_JavaLangString] = T_undefined; 1222 table[(T_JavaLangObject<<4) +T_JavaLangString] = T_undefined; 1223 table[(T_double<<4) +T_JavaLangString] = T_undefined; 1224 table[(T_float<<4) +T_JavaLangString] = T_undefined; 1225 table[(T_boolean<<4)+T_JavaLangString] = T_undefined; 1226 table[(T_char<<4) +T_JavaLangString] = T_undefined; 1227 table[(T_int<<4) +T_JavaLangString] = T_undefined; 1228 table[(T_null<<4) +T_JavaLangString] = T_undefined; 1229 1230 table[(T_null<<4) +T_null] = T_undefined; 1231 1232 return table; 1233 } 1234 1235 public static final int[] get_MULTIPLY(){ 1236 1237 1242 return get_MINUS(); 1244 } 1245 1246 public static final int[] get_OR(){ 1247 1248 1253 1254 return get_AND(); 1256 } 1257 1258 public static final int[] get_OR_OR(){ 1259 1260 1265 return get_AND_AND(); 1267 } 1268 1269 public static final int[] get_PLUS(){ 1270 1271 1276 int[] table = new int[16*16]; 1277 1278 1292 table[(T_byte<<4)+T_byte] = (Byte2Int<<12)+(Byte2Int<<4)+T_int; 1294 table[(T_byte<<4)+T_long] = (Byte2Long<<12)+(Long2Long<<4)+T_long; 1295 table[(T_byte<<4)+T_short] = (Byte2Int<<12)+(Short2Int<<4)+T_int; 1296 table[(T_byte<<4)+T_JavaLangString] = (Byte2Byte<<12)+(String2String<<4)+T_JavaLangString; 1298 table[(T_byte<<4)+T_double] = (Byte2Double<<12)+(Double2Double<<4)+T_double; 1300 table[(T_byte<<4)+T_float] = (Byte2Float<<12)+(Float2Float<<4)+T_float; 1301 table[(T_byte<<4)+T_char] = (Byte2Int<<12)+(Char2Int<<4)+T_int; 1303 table[(T_byte<<4)+T_int] = (Byte2Int<<12)+(Int2Int<<4)+T_int; 1304 1306 table[(T_long<<4)+T_byte] = (Long2Long<<12)+(Byte2Long<<4)+T_long; 1308 table[(T_long<<4)+T_long] = (Long2Long<<12)+(Long2Long<<4)+T_long; 1309 table[(T_long<<4)+T_short] = (Long2Long<<12)+(Short2Long<<4)+T_long; 1310 table[(T_long<<4)+T_JavaLangString] = (Long2Long<<12)+(String2String<<4)+T_JavaLangString; 1312 table[(T_long<<4)+T_double] = (Long2Double<<12)+(Double2Double<<4)+T_double; 1314 table[(T_long<<4)+T_float] = (Long2Float<<12)+(Float2Float<<4)+T_float; 1315 table[(T_long<<4)+T_char] = (Long2Long<<12)+(Char2Long<<4)+T_long; 1317 table[(T_long<<4)+T_int] = (Long2Long<<12)+(Int2Long<<4)+T_long; 1318 1320 table[(T_short<<4)+T_byte] = (Short2Int<<12)+(Byte2Int<<4)+T_int; 1322 table[(T_short<<4)+T_long] = (Short2Long<<12)+(Long2Long<<4)+T_long; 1323 table[(T_short<<4)+T_short] = (Short2Int<<12)+(Short2Int<<4)+T_int; 1324 table[(T_short<<4)+T_JavaLangString] = (Short2Short<<12)+(String2String<<4)+T_JavaLangString; 1326 table[(T_short<<4)+T_double] = (Short2Double<<12)+(Double2Double<<4)+T_double; 1328 table[(T_short<<4)+T_float] = (Short2Float<<12)+(Float2Float<<4)+T_float; 1329 table[(T_short<<4)+T_char] = (Short2Int<<12)+(Char2Int<<4)+T_int; 1331 table[(T_short<<4)+T_int] = (Short2Int<<12)+(Int2Int<<4)+T_int; 1332 1334 1348 table[(T_JavaLangString<<4)+T_byte] = (String2String<<12)+(Byte2Byte<<4)+T_JavaLangString; 1350 table[(T_JavaLangString<<4)+T_long] = (String2String<<12)+(Long2Long<<4)+T_JavaLangString; 1351 table[(T_JavaLangString<<4)+T_short] = (String2String<<12)+(Short2Short<<4)+T_JavaLangString; 1352 table[(T_JavaLangString<<4)+T_JavaLangString] = (String2String<<12)+(String2String<<4)+T_JavaLangString; 1354 table[(T_JavaLangString<<4)+T_JavaLangObject] = (String2String<<12)+(Object2Object<<4)+T_JavaLangString; 1355 table[(T_JavaLangString<<4)+T_double] = (String2String<<12)+(Double2Double<<4)+T_JavaLangString; 1356 table[(T_JavaLangString<<4)+T_float] = (String2String<<12)+(Float2Float<<4)+T_JavaLangString; 1357 table[(T_JavaLangString<<4)+T_boolean] = (String2String<<12)+(Boolean2Boolean<<4)+T_JavaLangString; 1358 table[(T_JavaLangString<<4)+T_char] = (String2String<<12)+(Char2Char<<4)+T_JavaLangString; 1359 table[(T_JavaLangString<<4)+T_int] = (String2String<<12)+(Int2Int<<4)+T_JavaLangString; 1360 table[(T_JavaLangString<<4)+T_null] = (String2String<<12)+(T_null<<8)+(T_null<<4)+T_JavaLangString; 1361 1362 table[(T_JavaLangObject<<4)+T_JavaLangString] = (Object2Object<<12)+(String2String<<4)+T_JavaLangString; 1368 1376 table[(T_double<<4)+T_byte] = (Double2Double<<12)+(Byte2Double<<4)+T_double; 1378 table[(T_double<<4)+T_long] = (Double2Double<<12)+(Long2Double<<4)+T_double; 1379 table[(T_double<<4)+T_short] = (Double2Double<<12)+(Short2Double<<4)+T_double; 1380 table[(T_double<<4)+T_JavaLangString] = (Double2Double<<12)+(String2String<<4)+T_JavaLangString; 1382 table[(T_double<<4)+T_double] = (Double2Double<<12)+(Double2Double<<4)+T_double; 1384 table[(T_double<<4)+T_float] = (Double2Double<<12)+(Float2Double<<4)+T_double; 1385 table[(T_double<<4)+T_char] = (Double2Double<<12)+(Char2Double<<4)+T_double; 1387 table[(T_double<<4)+T_int] = (Double2Double<<12)+(Int2Double<<4)+T_double; 1388 1390 table[(T_float<<4)+T_byte] = (Float2Float<<12)+(Byte2Float<<4)+T_float; 1392 table[(T_float<<4)+T_long] = (Float2Float<<12)+(Long2Float<<4)+T_float; 1393 table[(T_float<<4)+T_short] = (Float2Float<<12)+(Short2Float<<4)+T_float; 1394 table[(T_float<<4)+T_JavaLangString] = (Float2Float<<12)+(String2String<<4)+T_JavaLangString; 1396 table[(T_float<<4)+T_double] = (Float2Double<<12)+(Double2Double<<4)+T_double; 1398 table[(T_float<<4)+T_float] = (Float2Float<<12)+(Float2Float<<4)+T_float; 1399 table[(T_float<<4)+T_char] = (Float2Float<<12)+(Char2Float<<4)+T_float; 1401 table[(T_float<<4)+T_int] = (Float2Float<<12)+(Int2Float<<4)+T_float; 1402 1404 table[(T_boolean<<4)+T_JavaLangString] = (Boolean2Boolean<<12)+(String2String<<4)+T_JavaLangString; 1410 1418 table[(T_char<<4)+T_byte] = (Char2Int<<12)+(Byte2Int<<4)+T_int; 1420 table[(T_char<<4)+T_long] = (Char2Long<<12)+(Long2Long<<4)+T_long; 1421 table[(T_char<<4)+T_short] = (Char2Int<<12)+(Short2Int<<4)+T_int; 1422 table[(T_char<<4)+T_JavaLangString] = (Char2Char<<12)+(String2String<<4)+T_JavaLangString; 1424 table[(T_char<<4)+T_double] = (Char2Double<<12)+(Double2Double<<4)+T_double; 1426 table[(T_char<<4)+T_float] = (Char2Float<<12)+(Float2Float<<4)+T_float; 1427 table[(T_char<<4)+T_char] = (Char2Int<<12)+(Char2Int<<4)+T_int; 1429 table[(T_char<<4)+T_int] = (Char2Int<<12)+(Int2Int<<4)+T_int; 1430 1432 table[(T_int<<4)+T_byte] = (Int2Int<<12)+(Byte2Int<<4)+T_int; 1434 table[(T_int<<4)+T_long] = (Int2Long<<12)+(Long2Long<<4)+T_long; 1435 table[(T_int<<4)+T_short] = (Int2Int<<12)+(Short2Int<<4)+T_int; 1436 table[(T_int<<4)+T_JavaLangString] = (Int2Int<<12)+(String2String<<4)+T_JavaLangString; 1438 table[(T_int<<4)+T_double] = (Int2Double<<12)+(Double2Double<<4)+T_double; 1440 table[(T_int<<4)+T_float] = (Int2Float<<12)+(Float2Float<<4)+T_float; 1441 table[(T_int<<4)+T_char] = (Int2Int<<12)+(Char2Int<<4)+T_int; 1443 table[(T_int<<4)+T_int] = (Int2Int<<12)+(Int2Int<<4)+T_int; 1444 1446 table[(T_null<<4)+T_JavaLangString] = (T_null<<16)+(T_null<<12)+(String2String<<4)+T_JavaLangString; 1452 1460 return table; 1461 } 1462 1463 public static final int[] get_REMAINDER(){ 1464 1465 1470 return get_MINUS(); 1472 } 1473 1474 public static final int[] get_RIGHT_SHIFT(){ 1475 1476 1481 return get_LEFT_SHIFT(); 1483 } 1484 1485 public static final int[] get_UNSIGNED_RIGHT_SHIFT(){ 1486 1487 1492 return get_LEFT_SHIFT(); 1494 } 1495 1496 public static final int[] get_XOR(){ 1497 1498 1503 return get_AND(); 1505 } 1506 1507 public String operatorToString() { 1508 switch ((bits & OperatorMASK) >> OperatorSHIFT) { 1509 case EQUAL_EQUAL : 1510 return "=="; case LESS_EQUAL : 1512 return "<="; case GREATER_EQUAL : 1514 return ">="; case NOT_EQUAL : 1516 return "!="; case LEFT_SHIFT : 1518 return "<<"; case RIGHT_SHIFT : 1520 return ">>"; case UNSIGNED_RIGHT_SHIFT : 1522 return ">>>"; case OR_OR : 1524 return "||"; case AND_AND : 1526 return "&&"; case PLUS : 1528 return "+"; case MINUS : 1530 return "-"; case NOT : 1532 return "!"; case REMAINDER : 1534 return "%"; case XOR : 1536 return "^"; case AND : 1538 return "&"; case MULTIPLY : 1540 return "*"; case OR : 1542 return "|"; case TWIDDLE : 1544 return "~"; case DIVIDE : 1546 return "/"; case GREATER : 1548 return ">"; case LESS : 1550 return "<"; case QUESTIONCOLON : 1552 return "?:"; case EQUAL : 1554 return "="; } 1556 return "unknown operator"; } 1558 1559 public int nullStatus(FlowInfo flowInfo) { 1560 return FlowInfo.NON_NULL; 1561 } 1562 1563 public StringBuffer printExpression(int indent, StringBuffer output){ 1564 1565 output.append('('); 1566 return printExpressionNoParenthesis(0, output).append(')'); 1567 } 1568 1569 public abstract StringBuffer printExpressionNoParenthesis(int indent, StringBuffer output); 1570} 1571 | Popular Tags |