JavaOperators.java


//  JavaOperators.java

//  Interface JavaOperators
//  ------------------------------------------------------------------
/**
  *   Names and hashcodes for Java operators.
  *
  *   @author   C. Vickery
  *   @version  1.0 - Spring, 2000
  */
  public interface JavaOperators
  {
    //  Manifest Constants
    //  ----------------------------------------------------------------
    int OP_undefined       = 0;
    int OP_equal           = 1;    //  =
    int OP_greater         = 2;    //  >
    int OP_less            = 3;    //  <
    int OP_not             = 4;    //  !
    int OP_bitnot          = 5;    //  ~
    int OP_if              = 6;    //  ?
    int OP_else            = 7;    //  :
    int OP_equalequal      = 8;    //  ==
    int OP_lessequal       = 9;    //  <=
    int OP_greaterequal    = 10;   //  >=
    int OP_notequal        = 11;   //  !=
    int OP_and             = 12;   //  &&
    int OP_or              = 13;   //  ||
    int OP_plusplus        = 14;   //  ++
    int OP_minusminus      = 15;   //  --
    int OP_plus            = 16;   //  +
    int OP_minus           = 17;   //  -
    int OP_multiply        = 18;   //  *
    int OP_divide          = 19;   //  /
    int OP_bitand          = 20;   //  &
    int OP_bitor           = 21;   //  |
    int OP_xor             = 22;   //  ^
    int OP_modulo          = 23;   //  %
    int OP_lshift          = 24;   //  <<
    int OP_rshift          = 25;   //  >>
    int OP_arshift         = 26;   //  >>>
    int OP_plusequal       = 27;   //  +=
    int OP_minusequal      = 28;   //  -=
    int OP_multiplyequal   = 29;   //  *=
    int OP_divideequal     = 30;   //  /=
    int OP_andequal        = 31;   //  &=
    int OP_orequal         = 32;   //  |=
    int OP_xorequal        = 33;   //  ^=
    int OP_moduloequal     = 34;   //  %=
    int OP_lshiftequal     = 35;   //  <<=
    int OP_rshiftequal     = 36;   //  >>=
    int OP_arshiftequal    = 37;   //  >>>=
   
    /** List of operators.                                            */
    String[] operatorNames =
    {
       "=",    ">",    "<",    "!",    "~",    "?",    ":",    "==",
       "<=",   ">=",   "!=",   "&&",   "||",   "++",   "--",   "+",
       "-",    "*",    "/",    "&",    "|",    "^",    "%",    "<<",
       ">>",   ">>>",  "+=",   "-=",   "*=",   "/=",   "&=",   "|=",
       "^=",   "%=",   "<<=",  ">>=",  ">>>="
    };

    /** List of hashcodes.                                            */
    int[] operatorHashCodes =
    {
       "=".hashCode(),    ">".hashCode(),    "<".hashCode(),
       "!".hashCode(),    "~".hashCode(),    "?".hashCode(),
       ":".hashCode(),    "==".hashCode(),   "<=".hashCode(),
       ">=".hashCode(),   "!=".hashCode(),   "&&".hashCode(),
       "||".hashCode(),   "++".hashCode(),   "--".hashCode(),
       "+".hashCode(),    "-".hashCode(),    "*".hashCode(),
       "/".hashCode(),    "&".hashCode(),    "|".hashCode(),
       "^".hashCode(),    "%".hashCode(),    "<<".hashCode(),
       ">>".hashCode(),   ">>>".hashCode(),  "+=".hashCode(),
       "-=".hashCode(),   "*=".hashCode(),   "/=".hashCode(),
       "&=".hashCode(),   "|=".hashCode(),   "^=".hashCode(),
       "%=".hashCode(),   "<<=".hashCode(),  ">>=".hashCode(),
       ">>>=".hashCode()
    };

  }