home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 November / PCONLINE_11_99.ISO / filesbbs / OS2 / APCHSSL2.ZIP / OS2HTTPD / jserv / com / netscape / javascript / TokenStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-04-09  |  13.0 KB  |  869 lines

  1. package com.netscape.javascript;
  2.  
  3. import java.io.IOException;
  4. import java.io.Reader;
  5. import java.util.Hashtable;
  6.  
  7. public class TokenStream {
  8.    public static final int TSF_ERROR = 1;
  9.    public static final int TSF_NEWLINES = 4;
  10.    public static final int TSF_FUNCTION = 8;
  11.    public static final int TSF_RETURN_EXPR = 16;
  12.    public static final int TSF_RETURN_VOID = 32;
  13.    public static final int TSF_REGEXP = 512;
  14.    private static final int EOF_CHAR = -1;
  15.    public static final int ERROR = -1;
  16.    public static final int EOF = 0;
  17.    public static final int EOL = 1;
  18.    public static final int POPV = 2;
  19.    public static final int ENTERWITH = 3;
  20.    public static final int LEAVEWITH = 4;
  21.    public static final int RETURN = 5;
  22.    public static final int GOTO = 6;
  23.    public static final int IFEQ = 7;
  24.    public static final int IFNE = 8;
  25.    public static final int DUP = 9;
  26.    public static final int SETNAME = 10;
  27.    public static final int BITOR = 11;
  28.    public static final int BITXOR = 12;
  29.    public static final int BITAND = 13;
  30.    // $FF: renamed from: EQ int
  31.    public static final int field_0 = 14;
  32.    // $FF: renamed from: NE int
  33.    public static final int field_1 = 15;
  34.    // $FF: renamed from: LT int
  35.    public static final int field_2 = 16;
  36.    // $FF: renamed from: LE int
  37.    public static final int field_3 = 17;
  38.    // $FF: renamed from: GT int
  39.    public static final int field_4 = 18;
  40.    // $FF: renamed from: GE int
  41.    public static final int field_5 = 19;
  42.    public static final int LSH = 20;
  43.    public static final int RSH = 21;
  44.    public static final int URSH = 22;
  45.    public static final int ADD = 23;
  46.    public static final int SUB = 24;
  47.    public static final int MUL = 25;
  48.    public static final int DIV = 26;
  49.    public static final int MOD = 27;
  50.    public static final int BITNOT = 28;
  51.    public static final int NEG = 29;
  52.    public static final int NEW = 30;
  53.    public static final int DELPROP = 31;
  54.    public static final int TYPEOF = 32;
  55.    public static final int NAMEINC = 33;
  56.    public static final int PROPINC = 34;
  57.    public static final int ELEMINC = 35;
  58.    public static final int NAMEDEC = 36;
  59.    public static final int PROPDEC = 37;
  60.    public static final int ELEMDEC = 38;
  61.    public static final int GETPROP = 39;
  62.    public static final int SETPROP = 40;
  63.    public static final int GETELEM = 41;
  64.    public static final int SETELEM = 42;
  65.    public static final int CALL = 43;
  66.    public static final int NAME = 44;
  67.    public static final int NUMBER = 45;
  68.    public static final int STRING = 46;
  69.    public static final int ZERO = 47;
  70.    public static final int ONE = 48;
  71.    public static final int NULL = 49;
  72.    public static final int THIS = 50;
  73.    public static final int FALSE = 51;
  74.    public static final int TRUE = 52;
  75.    public static final int SHEQ = 53;
  76.    public static final int SHNE = 54;
  77.    public static final int CLOSURE = 55;
  78.    public static final int OBJECT = 56;
  79.    public static final int POP = 57;
  80.    public static final int POS = 58;
  81.    public static final int VARINC = 59;
  82.    public static final int VARDEC = 60;
  83.    public static final int BINDNAME = 61;
  84.    public static final int THROW = 62;
  85.    // $FF: renamed from: IN int
  86.    public static final int field_6 = 63;
  87.    public static final int INSTANCEOF = 64;
  88.    public static final int GOSUB = 65;
  89.    public static final int RETSUB = 66;
  90.    public static final int CALLSPECIAL = 67;
  91.    public static final int GETTHIS = 68;
  92.    public static final int NEWTEMP = 69;
  93.    public static final int USETEMP = 70;
  94.    public static final int GETBASE = 71;
  95.    public static final int GETVAR = 72;
  96.    public static final int SETVAR = 73;
  97.    public static final int UNDEFINED = 74;
  98.    public static final int TRY = 75;
  99.    public static final int ENDTRY = 76;
  100.    public static final int NEWSCOPE = 77;
  101.    public static final int TYPEOFNAME = 78;
  102.    public static final int ENUMINIT = 79;
  103.    public static final int ENUMNEXT = 80;
  104.    public static final int GETPROTO = 81;
  105.    public static final int GETPARENT = 82;
  106.    public static final int SETPROTO = 83;
  107.    public static final int SETPARENT = 84;
  108.    public static final int SCOPE = 85;
  109.    public static final int GETSCOPEPARENT = 86;
  110.    public static final int JTHROW = 87;
  111.    public static final int SEMI = 88;
  112.    // $FF: renamed from: LB int
  113.    public static final int field_7 = 89;
  114.    // $FF: renamed from: RB int
  115.    public static final int field_8 = 90;
  116.    // $FF: renamed from: LC int
  117.    public static final int field_9 = 91;
  118.    // $FF: renamed from: RC int
  119.    public static final int field_10 = 92;
  120.    // $FF: renamed from: LP int
  121.    public static final int field_11 = 93;
  122.    // $FF: renamed from: RP int
  123.    public static final int field_12 = 94;
  124.    public static final int COMMA = 95;
  125.    public static final int ASSIGN = 96;
  126.    public static final int HOOK = 97;
  127.    public static final int COLON = 98;
  128.    // $FF: renamed from: OR int
  129.    public static final int field_13 = 99;
  130.    public static final int AND = 100;
  131.    public static final int EQOP = 101;
  132.    public static final int RELOP = 102;
  133.    public static final int SHOP = 103;
  134.    public static final int UNARYOP = 104;
  135.    public static final int INC = 105;
  136.    public static final int DEC = 106;
  137.    public static final int DOT = 107;
  138.    public static final int PRIMARY = 108;
  139.    public static final int FUNCTION = 109;
  140.    public static final int EXPORT = 110;
  141.    public static final int IMPORT = 111;
  142.    // $FF: renamed from: IF int
  143.    public static final int field_14 = 112;
  144.    public static final int ELSE = 113;
  145.    public static final int SWITCH = 114;
  146.    public static final int CASE = 115;
  147.    public static final int DEFAULT = 116;
  148.    public static final int WHILE = 117;
  149.    // $FF: renamed from: DO int
  150.    public static final int field_15 = 118;
  151.    public static final int FOR = 119;
  152.    public static final int BREAK = 120;
  153.    public static final int CONTINUE = 121;
  154.    public static final int VAR = 122;
  155.    public static final int WITH = 123;
  156.    public static final int CATCH = 124;
  157.    public static final int FINALLY = 125;
  158.    public static final int RESERVED = 126;
  159.    public static final int NOP = 127;
  160.    public static final int NOT = 128;
  161.    public static final int PRE = 129;
  162.    public static final int POST = 130;
  163.    public static final int VOID = 131;
  164.    public static final int BLOCK = 132;
  165.    public static final int ARRAYLIT = 133;
  166.    public static final int OBJLIT = 134;
  167.    public static final int LABEL = 135;
  168.    public static final int TARGET = 136;
  169.    public static final int LOOP = 137;
  170.    public static final int ENUMDONE = 138;
  171.    public static final int EXPRSTMT = 139;
  172.    public static final int PARENT = 140;
  173.    public static final int CONVERT = 141;
  174.    public static final int JSR = 142;
  175.    public static final int NEWLOCAL = 143;
  176.    public static final int USELOCAL = 144;
  177.    public static final int SCRIPT = 145;
  178.    private static String[] names;
  179.    private static Hashtable keywords;
  180.    // $FF: renamed from: in com.netscape.javascript.LineBuffer
  181.    private LineBuffer field_16;
  182.    public int flags;
  183.    public String regExpFlags;
  184.    private String sourceName;
  185.    private String line;
  186.    private int pushbackToken;
  187.    private int tokenno;
  188.    // $FF: renamed from: op int
  189.    private int field_17;
  190.    private String string = "";
  191.    private Number number;
  192.  
  193.    static boolean isJSSpace(int var0) {
  194.       return var0 == 9 || var0 == 11 || var0 == 12 || var0 == 32;
  195.    }
  196.  
  197.    public Number getNumber() {
  198.       return this.number;
  199.    }
  200.  
  201.    private static void checkNames() {
  202.    }
  203.  
  204.    public boolean matchToken(int var1) throws IOException {
  205.       int var2 = this.getToken();
  206.       if (var2 == var1) {
  207.          return true;
  208.       } else {
  209.          this.tokenno += -1;
  210.          this.pushbackToken = var2;
  211.          return false;
  212.       }
  213.    }
  214.  
  215.    public int getToken() throws IOException {
  216.       ++this.tokenno;
  217.       if ((this.flags & 1) != 0) {
  218.          return -1;
  219.       } else if (this.pushbackToken != 0) {
  220.          int var26 = this.pushbackToken;
  221.          this.pushbackToken = 0;
  222.          return var26;
  223.       } else {
  224.          int var1;
  225.          do {
  226.             var1 = this.field_16.read();
  227.          } while((var1 != 10 || (this.flags & 4) == 0) && (isJSSpace(var1) || var1 == 10));
  228.  
  229.          if (var1 == -1) {
  230.             return 0;
  231.          } else if (isJSIdentifierStart(var1)) {
  232.             this.field_16.startString();
  233.  
  234.             do {
  235.                var1 = this.field_16.read();
  236.             } while(isJSIdentifierPart(var1));
  237.  
  238.             this.field_16.unread();
  239.             String var30 = this.field_16.getString();
  240.             int var25;
  241.             if ((var25 = this.stringToKeyword(var30)) != 0) {
  242.                return var25;
  243.             } else {
  244.                this.string = var30;
  245.                return 44;
  246.             }
  247.          } else if (isDigit(var1) || var1 == 46 && isDigit(this.field_16.peek())) {
  248.             byte var24 = 10;
  249.             this.field_16.startString();
  250.             double var28 = ScriptRuntime.NaN;
  251.             long var39 = 0L;
  252.             boolean var41 = true;
  253.             if (var1 == 48) {
  254.                var1 = this.field_16.read();
  255.                if (var1 != 120 && var1 != 88) {
  256.                   if (isDigit(var1)) {
  257.                      if (var1 < 56) {
  258.                         var24 = 8;
  259.                         this.field_16.startString();
  260.                      } else {
  261.                         Object[] var42 = new Object[]{String.valueOf((char)var1)};
  262.                         Context.reportWarning(Context.getMessage("msg.bad.octal.literal", var42), this.getSourceName(), this.field_16.getLineno(), this.getLine(), this.getOffset());
  263.                      }
  264.                   }
  265.                } else {
  266.                   var1 = this.field_16.read();
  267.                   var24 = 16;
  268.                   this.field_16.startString();
  269.                }
  270.             }
  271.  
  272.             while(isXDigit(var1) && (var24 >= 16 || !isAlpha(var1) && (var24 != 8 || var1 < 56))) {
  273.                var1 = this.field_16.read();
  274.             }
  275.  
  276.             if (var24 == 10 && (var1 == 46 || var1 == 101 || var1 == 69)) {
  277.                var41 = false;
  278.                if (var1 == 46) {
  279.                   do {
  280.                      var1 = this.field_16.read();
  281.                   } while(isDigit(var1));
  282.                }
  283.  
  284.                if (var1 == 101 || var1 == 69) {
  285.                   var1 = this.field_16.read();
  286.                   if (var1 == 43 || var1 == 45) {
  287.                      var1 = this.field_16.read();
  288.                   }
  289.  
  290.                   if (!isDigit(var1)) {
  291.                      this.field_16.getString();
  292.                      this.reportError("msg.missing.exponent", (Object[])null);
  293.                      return -1;
  294.                   }
  295.  
  296.                   do {
  297.                      var1 = this.field_16.read();
  298.                   } while(isDigit(var1));
  299.                }
  300.             }
  301.  
  302.             this.field_16.unread();
  303.             String var43 = this.field_16.getString();
  304.             if (var24 == 10 && !var41) {
  305.                try {
  306.                   var28 = Double.valueOf(var43);
  307.                } catch (NumberFormatException var11) {
  308.                   Object[] var10 = new Object[]{((Throwable)var11).getMessage()};
  309.                   this.reportError("msg.caught.nfe", var10);
  310.                   return -1;
  311.                }
  312.             } else {
  313.                var28 = ScriptRuntime.stringToNumber(var43, 0, var24);
  314.                var39 = (long)var28;
  315.                if ((double)var39 != var28) {
  316.                   var41 = false;
  317.                }
  318.             }
  319.  
  320.             if (!var41) {
  321.                this.number = new Double(var28);
  322.             } else if (-128L <= var39 && var39 <= 127L) {
  323.                this.number = new Byte((byte)((int)var39));
  324.             } else if (-32768L <= var39 && var39 <= 32767L) {
  325.                this.number = new Short((short)((int)var39));
  326.             } else if (-2147483648L <= var39 && var39 <= 2147483647L) {
  327.                this.number = new Integer((int)var39);
  328.             } else {
  329.                this.number = new Double((double)var39);
  330.             }
  331.  
  332.             return 45;
  333.          } else if (var1 != 34 && var1 != 39) {
  334.             switch (var1) {
  335.                case 10:
  336.                   return 1;
  337.                case 33:
  338.                   if (this.field_16.match('=')) {
  339.                      if (this.field_16.match('=')) {
  340.                         this.field_17 = 54;
  341.                      } else {
  342.                         this.field_17 = 15;
  343.                      }
  344.  
  345.                      return 101;
  346.                   }
  347.  
  348.                   this.field_17 = 128;
  349.                   return 104;
  350.                case 37:
  351.                   this.field_17 = 27;
  352.                   if (this.field_16.match('=')) {
  353.                      return 96;
  354.                   }
  355.  
  356.                   return 27;
  357.                case 38:
  358.                   if (this.field_16.match('&')) {
  359.                      return 100;
  360.                   } else {
  361.                      if (this.field_16.match('=')) {
  362.                         this.field_17 = 13;
  363.                         return 96;
  364.                      }
  365.  
  366.                      return 13;
  367.                   }
  368.                case 40:
  369.                   return 93;
  370.                case 41:
  371.                   return 94;
  372.                case 42:
  373.                   if (this.field_16.match('=')) {
  374.                      this.field_17 = 25;
  375.                      return 96;
  376.                   }
  377.  
  378.                   return 25;
  379.                case 43:
  380.                case 45:
  381.                   if (this.field_16.match('=')) {
  382.                      if (var1 == 43) {
  383.                         this.field_17 = 23;
  384.                         return 96;
  385.                      }
  386.  
  387.                      this.field_17 = 24;
  388.                      return 96;
  389.                   } else if (this.field_16.match((char)var1)) {
  390.                      if (var1 == 43) {
  391.                         return 105;
  392.                      }
  393.  
  394.                      return 106;
  395.                   } else {
  396.                      if (var1 == 45) {
  397.                         return 24;
  398.                      }
  399.  
  400.                      return 23;
  401.                   }
  402.                case 44:
  403.                   return 95;
  404.                case 46:
  405.                   return 107;
  406.                case 47:
  407.                   if (this.field_16.match('/')) {
  408.                      while((var1 = this.field_16.read()) != -1 && var1 != 10) {
  409.                      }
  410.  
  411.                      this.field_16.unread();
  412.                      return this.getToken();
  413.                   } else if (this.field_16.match('*')) {
  414.                      while((var1 = this.field_16.read()) != -1 && (var1 != 42 || !this.field_16.match('/'))) {
  415.                         if (var1 != 10 && var1 == 47 && this.field_16.match('*')) {
  416.                            if (this.field_16.match('/')) {
  417.                               return this.getToken();
  418.                            }
  419.  
  420.                            this.reportError("msg.nested.comment", (Object[])null);
  421.                            return -1;
  422.                         }
  423.                      }
  424.  
  425.                      if (var1 == -1) {
  426.                         this.reportError("msg.unterminated.comment", (Object[])null);
  427.                         return -1;
  428.                      } else {
  429.                         return this.getToken();
  430.                      }
  431.                   } else if ((this.flags & 512) == 0) {
  432.                      if (this.field_16.match('=')) {
  433.                         this.field_17 = 26;
  434.                         return 96;
  435.                      } else {
  436.                         return 26;
  437.                      }
  438.                   } else {
  439.                      StringBuffer var23;
  440.                      for(var23 = new StringBuffer(); (var1 = this.field_16.read()) != 47; var23.append((char)var1)) {
  441.                         if (var1 == 10 || var1 == -1) {
  442.                            this.field_16.unread();
  443.                            this.reportError("msg.unterminated.re.lit", (Object[])null);
  444.                            return -1;
  445.                         }
  446.  
  447.                         if (var1 == 92) {
  448.                            var23.append((char)var1);
  449.                            var1 = this.field_16.read();
  450.                         }
  451.                      }
  452.  
  453.                      StringBuffer var27 = new StringBuffer();
  454.  
  455.                      while(true) {
  456.                         while(!this.field_16.match('g')) {
  457.                            if (!this.field_16.match('i')) {
  458.                               if (isAlpha(this.field_16.peek())) {
  459.                                  this.reportError("msg.invalid.re.flag", (Object[])null);
  460.                                  return -1;
  461.                               }
  462.  
  463.                               this.string = var23.toString();
  464.                               this.regExpFlags = var27.toString();
  465.                               return 56;
  466.                            }
  467.  
  468.                            var27.append('i');
  469.                         }
  470.  
  471.                         var27.append('g');
  472.                      }
  473.                   }
  474.                case 58:
  475.                   return 98;
  476.                case 59:
  477.                   return 88;
  478.                case 60:
  479.                   if (this.field_16.match('!')) {
  480.                      if (this.field_16.match('-')) {
  481.                         if (this.field_16.match('-')) {
  482.                            while((var1 = this.field_16.read()) != -1 && var1 != 10) {
  483.                            }
  484.  
  485.                            this.field_16.unread();
  486.                            return this.getToken();
  487.                         }
  488.  
  489.                         this.field_16.unread();
  490.                      }
  491.  
  492.                      this.field_16.unread();
  493.                   }
  494.  
  495.                   if (this.field_16.match('<')) {
  496.                      if (this.field_16.match('=')) {
  497.                         this.field_17 = 20;
  498.                         return 96;
  499.                      }
  500.  
  501.                      this.field_17 = 20;
  502.                      return 103;
  503.                   } else {
  504.                      if (this.field_16.match('=')) {
  505.                         this.field_17 = 17;
  506.                         return 102;
  507.                      }
  508.  
  509.                      this.field_17 = 16;
  510.                      return 102;
  511.                   }
  512.                case 61:
  513.                   if (this.field_16.match('=')) {
  514.                      if (this.field_16.match('=')) {
  515.                         this.field_17 = 53;
  516.                      } else {
  517.                         this.field_17 = 14;
  518.                      }
  519.  
  520.                      return 101;
  521.                   }
  522.  
  523.                   this.field_17 = 127;
  524.                   return 96;
  525.                case 62:
  526.                   if (this.field_16.match('>')) {
  527.                      if (this.field_16.match('>')) {
  528.                         if (this.field_16.match('=')) {
  529.                            this.field_17 = 22;
  530.                            return 96;
  531.                         }
  532.  
  533.                         this.field_17 = 22;
  534.                         return 103;
  535.                      } else {
  536.                         if (this.field_16.match('=')) {
  537.                            this.field_17 = 21;
  538.                            return 96;
  539.                         }
  540.  
  541.                         this.field_17 = 21;
  542.                         return 103;
  543.                      }
  544.                   } else {
  545.                      if (this.field_16.match('=')) {
  546.                         this.field_17 = 19;
  547.                         return 102;
  548.                      }
  549.  
  550.                      this.field_17 = 18;
  551.                      return 102;
  552.                   }
  553.                case 63:
  554.                   return 97;
  555.                case 91:
  556.                   return 89;
  557.                case 93:
  558.                   return 90;
  559.                case 94:
  560.                   if (this.field_16.match('=')) {
  561.                      this.field_17 = 12;
  562.                      return 96;
  563.                   }
  564.  
  565.                   return 12;
  566.                case 123:
  567.                   return 91;
  568.                case 124:
  569.                   if (this.field_16.match('|')) {
  570.                      return 99;
  571.                   } else {
  572.                      if (this.field_16.match('=')) {
  573.                         this.field_17 = 11;
  574.                         return 96;
  575.                      }
  576.  
  577.                      return 11;
  578.                   }
  579.                case 125:
  580.                   return 92;
  581.                case 126:
  582.                   this.field_17 = 28;
  583.                   return 104;
  584.                default:
  585.                   this.reportError("msg.illegal.character", (Object[])null);
  586.                   return -1;
  587.             }
  588.          } else {
  589.             StringBuffer var2 = null;
  590.             int var3 = var1;
  591.             int var4 = 0;
  592.             var1 = this.field_16.read();
  593.             this.field_16.startString();
  594.  
  595.             for(; var1 != var3; var1 = this.field_16.read()) {
  596.                if (var1 == 10 || var1 == -1) {
  597.                   this.field_16.unread();
  598.                   this.field_16.getString();
  599.                   this.reportError("msg.unterminated.string.lit", (Object[])null);
  600.                   return -1;
  601.                }
  602.  
  603.                if (var1 == 92) {
  604.                   if (var2 == null) {
  605.                      this.field_16.unread();
  606.                      var2 = new StringBuffer(this.field_16.getString());
  607.                      this.field_16.read();
  608.                   }
  609.  
  610.                   switch (var1 = this.field_16.read()) {
  611.                      case 98:
  612.                         var1 = 8;
  613.                         break;
  614.                      case 102:
  615.                         var1 = 12;
  616.                         break;
  617.                      case 110:
  618.                         var1 = 10;
  619.                         break;
  620.                      case 114:
  621.                         var1 = 13;
  622.                         break;
  623.                      case 116:
  624.                         var1 = 9;
  625.                         break;
  626.                      case 118:
  627.                         var1 = 11;
  628.                         break;
  629.                      default:
  630.                         if (isDigit(var1) && var1 < 56) {
  631.                            var4 = var1 - 48;
  632.                            var1 = this.field_16.read();
  633.                            if (isDigit(var1) && var1 < 56) {
  634.                               var4 = 8 * var4 + var1 - 48;
  635.                               var1 = this.field_16.read();
  636.                               if (isDigit(var1) && var1 < 56) {
  637.                                  var4 = 8 * var4 + var1 - 48;
  638.                                  var1 = this.field_16.read();
  639.                               }
  640.                            }
  641.  
  642.                            this.field_16.unread();
  643.                            if (var4 > 255) {
  644.                               this.reportError("msg.oct.esc.too.large", (Object[])null);
  645.                               return -1;
  646.                            }
  647.  
  648.                            var1 = var4;
  649.                         } else if (var1 == 117) {
  650.                            int var5 = this.field_16.read();
  651.                            if (!isXDigit(var5)) {
  652.                               this.field_16.unread();
  653.                               var1 = 117;
  654.                            } else {
  655.                               var4 = Character.digit((char)var5, 16);
  656.                               int var6 = this.field_16.read();
  657.                               if (!isXDigit(var6)) {
  658.                                  this.field_16.unread();
  659.                                  var2.append('u');
  660.                                  var1 = var5;
  661.                               } else {
  662.                                  var4 = 16 * var4 + Character.digit((char)var6, 16);
  663.                                  int var7 = this.field_16.read();
  664.                                  if (!isXDigit(var7)) {
  665.                                     this.field_16.unread();
  666.                                     var2.append('u');
  667.                                     var2.append((char)var5);
  668.                                     var1 = var6;
  669.                                  } else {
  670.                                     var4 = 16 * var4 + Character.digit((char)var7, 16);
  671.                                     int var8 = this.field_16.read();
  672.                                     if (!isXDigit(var8)) {
  673.                                        this.field_16.unread();
  674.                                        var2.append('u');
  675.                                        var2.append((char)var5);
  676.                                        var2.append((char)var6);
  677.                                        var1 = var7;
  678.                                     } else {
  679.                                        var4 = 16 * var4 + Character.digit((char)var8, 16);
  680.                                        var1 = var4;
  681.                                     }
  682.                                  }
  683.                               }
  684.                            }
  685.                         } else if (var1 == 120) {
  686.                            int var38 = this.field_16.read();
  687.                            if (!isXDigit(var38)) {
  688.                               this.field_16.unread();
  689.                               var1 = 120;
  690.                            } else {
  691.                               var4 = Character.digit((char)var38, 16);
  692.                               int var40 = this.field_16.read();
  693.                               if (!isXDigit(var40)) {
  694.                                  this.field_16.unread();
  695.                                  var2.append('x');
  696.                                  var1 = var38;
  697.                               } else {
  698.                                  var4 = 16 * var4 + Character.digit((char)var40, 16);
  699.                                  var1 = var4;
  700.                               }
  701.                            }
  702.                         }
  703.                   }
  704.                }
  705.  
  706.                if (var2 != null) {
  707.                   var2.append((char)var1);
  708.                }
  709.             }
  710.  
  711.             if (var2 != null) {
  712.                this.string = var2.toString();
  713.             } else {
  714.                this.field_16.unread();
  715.                this.string = this.field_16.getString();
  716.                this.field_16.read();
  717.             }
  718.  
  719.             return 46;
  720.          }
  721.       }
  722.    }
  723.  
  724.    public String getLine() {
  725.       return this.field_16.getLine();
  726.    }
  727.  
  728.    public String tokenToString(int var1) {
  729.       return "";
  730.    }
  731.  
  732.    public TokenStream(Reader var1, String var2, int var3) {
  733.       this.field_16 = new LineBuffer(var1, var3);
  734.       this.pushbackToken = 0;
  735.       this.sourceName = var2;
  736.       this.flags = 0;
  737.    }
  738.  
  739.    public int peekToken() throws IOException {
  740.       int var1 = this.getToken();
  741.       this.pushbackToken = var1;
  742.       this.tokenno += -1;
  743.       return var1;
  744.    }
  745.  
  746.    public int peekTokenSameLine() throws IOException {
  747.       this.flags |= 4;
  748.       int var1 = this.peekToken();
  749.       this.flags &= -5;
  750.       if (this.pushbackToken == 1) {
  751.          this.pushbackToken = 0;
  752.       }
  753.  
  754.       return var1;
  755.    }
  756.  
  757.    static boolean isDigit(int var0) {
  758.       return var0 >= 48 && var0 <= 57;
  759.    }
  760.  
  761.    static boolean isXDigit(int var0) {
  762.       return var0 >= 48 && var0 <= 57 || var0 >= 97 && var0 <= 102 || var0 >= 65 && var0 <= 70;
  763.    }
  764.  
  765.    public String getString() {
  766.       return this.string;
  767.    }
  768.  
  769.    public String getSourceName() {
  770.       return this.sourceName;
  771.    }
  772.  
  773.    private int stringToKeyword(String var1) {
  774.       Integer var2 = (Integer)keywords.get(var1);
  775.       if (var2 == null) {
  776.          return 0;
  777.       } else {
  778.          int var3 = var2;
  779.          this.field_17 = var3 >> 8;
  780.          return var3 & 255;
  781.       }
  782.    }
  783.  
  784.    public int getOp() {
  785.       return this.field_17;
  786.    }
  787.  
  788.    public boolean eof() {
  789.       return this.field_16.eof();
  790.    }
  791.  
  792.    public static String tokenToName(int var0) {
  793.       checkNames();
  794.       return names == null ? "" : names[var0 + 1];
  795.    }
  796.  
  797.    public int getLineno() {
  798.       return this.field_16.getLineno();
  799.    }
  800.  
  801.    public int getTokenno() {
  802.       return this.tokenno;
  803.    }
  804.  
  805.    private void reportError(String var1, Object[] var2) {
  806.       this.flags |= 1;
  807.       String var3 = Context.getMessage(var1, var2);
  808.       Context.reportError(var3, this.getSourceName(), this.getLineno(), this.getLine(), this.getOffset());
  809.    }
  810.  
  811.    static {
  812.       String[] var0 = new String[]{"break", "case", "continue", "default", "delete", "do", "else", "export", "false", "for", "function", "if", "in", "new", "null", "return", "switch", "this", "true", "typeof", "var", "void", "while", "with", "abstract", "boolean", "byte", "catch", "char", "class", "const", "debugger", "double", "enum", "extends", "final", "finally", "float", "goto", "implements", "import", "instanceof", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "super", "synchronized", "throw", "throws", "transient", "try", "volatile"};
  813.       int[] var1 = new int[]{120, 115, 121, 116, 31, 118, 113, 110, 13164, 119, 109, 112, 16230, 30, 12652, 5, 114, 12908, 13420, 8296, 122, 33640, 117, 123, 126, 126, 126, 124, 126, 126, 126, 126, 126, 126, 126, 126, 125, 126, 126, 126, 111, 16486, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 32620, 126, 62, 126, 126, 75, 126};
  814.       keywords = new Hashtable(var0.length);
  815.       Integer var2 = new Integer(126);
  816.  
  817.       for(int var3 = 0; var3 < var0.length; ++var3) {
  818.          keywords.put(var0[var3], var1[var3] == 126 ? var2 : new Integer(var1[var3]));
  819.       }
  820.  
  821.    }
  822.  
  823.    protected static boolean isJSIdentifierStart(int var0) {
  824.       return var0 >= 97 && var0 <= 122 || var0 >= 65 && var0 <= 90 || var0 == 95 || var0 == 36;
  825.    }
  826.  
  827.    protected static boolean isJSIdentifier(String var0) {
  828.       int var1 = var0.length();
  829.       if (var1 != 0 && isJSIdentifierStart(var0.charAt(0))) {
  830.          for(int var2 = 1; var2 < var1; ++var2) {
  831.             if (!isJSIdentifierPart(var0.charAt(var2))) {
  832.                return false;
  833.             }
  834.          }
  835.  
  836.          return true;
  837.       } else {
  838.          return false;
  839.       }
  840.    }
  841.  
  842.    public void clearPushback() {
  843.       this.pushbackToken = 0;
  844.    }
  845.  
  846.    public void ungetToken(int var1) {
  847.       if (this.pushbackToken != 0 && var1 != -1) {
  848.          Object[] var2 = new Object[]{this.tokenToString(var1), this.tokenToString(this.pushbackToken)};
  849.          String var3 = Context.getMessage("msg.token.replaces.pushback", var2);
  850.          throw new RuntimeException(var3);
  851.       } else {
  852.          this.pushbackToken = var1;
  853.          this.tokenno += -1;
  854.       }
  855.    }
  856.  
  857.    public int getOffset() {
  858.       return this.field_16.getOffset();
  859.    }
  860.  
  861.    protected static boolean isJSIdentifierPart(int var0) {
  862.       return var0 >= 97 && var0 <= 122 || var0 >= 65 && var0 <= 90 || var0 >= 48 && var0 <= 57 || var0 == 95 || var0 == 36;
  863.    }
  864.  
  865.    private static boolean isAlpha(int var0) {
  866.       return var0 >= 97 && var0 <= 122 || var0 >= 65 && var0 <= 90;
  867.    }
  868. }
  869.