Beispiel #1
0
 public Token getNextToken() {
   if (token.next != null) token = token.next;
   else token = token.next = token_source.getNextToken();
   jj_ntk = -1;
   jj_gen++;
   return token;
 }
Beispiel #2
0
 private void jj_rescan_token() {
   jj_rescan = true;
   for (int i = 0; i < 22; i++) {
     JJCalls p = jj_2_rtns[i];
     do {
       if (p.gen > jj_gen) {
         jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
         switch (i) {
           case 0: jj_3_1(); break;
           case 1: jj_3_2(); break;
           case 2: jj_3_3(); break;
           case 3: jj_3_4(); break;
           case 4: jj_3_5(); break;
           case 5: jj_3_6(); break;
           case 6: jj_3_7(); break;
           case 7: jj_3_8(); break;
           case 8: jj_3_9(); break;
           case 9: jj_3_10(); break;
           case 10: jj_3_11(); break;
           case 11: jj_3_12(); break;
           case 12: jj_3_13(); break;
           case 13: jj_3_14(); break;
           case 14: jj_3_15(); break;
           case 15: jj_3_16(); break;
           case 16: jj_3_17(); break;
           case 17: jj_3_18(); break;
           case 18: jj_3_19(); break;
           case 19: jj_3_20(); break;
           case 20: jj_3_21(); break;
           case 21: jj_3_22(); break;
         }
       }
       p = p.next;
     } while (p != null);
   }
   jj_rescan = false;
 }
Beispiel #3
0
 private bool jj_scan_token(int kind) {
   if (jj_scanpos == jj_lastpos) {
     jj_la--;
     if (jj_scanpos.next == null) {
       jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
     } else {
       jj_lastpos = jj_scanpos = jj_scanpos.next;
     }
   } else {
     jj_scanpos = jj_scanpos.next;
   }
   if (jj_rescan) {
     int i = 0; Token tok = token;
     while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
     if (tok != null) jj_add_error_token(kind, i);
   }
   if (jj_scanpos.kind != kind) return true;
   if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
   return false;
 }
Beispiel #4
0
 private Token jj_consume_token(int kind) {
   Token oldToken = null;
   if ((oldToken = token).next != null) token = token.next;
   else token = token.next = token_source.getNextToken();
   jj_ntk = -1;
   if (token.kind == kind) {
     jj_gen++;
     if (++jj_gc > 100) {
       jj_gc = 0;
       for (int i = 0; i < jj_2_rtns.Length; i++) {
         JJCalls c = jj_2_rtns[i];
         while (c != null) {
           if (c.gen < jj_gen) c.first = null;
           c = c.next;
         }
       }
     }
     return token;
   }
   token = oldToken;
   jj_kind = kind;
   throw generateParseException();
 }
Beispiel #5
0
 public void ReInit(IDLParserTokenManager tm) {
   token_source = tm;
   token = new Token();
   jj_ntk = -1;
   jjtree.reset();
   jj_gen = 0;
   for (int i = 0; i < 88; i++) jj_la1[i] = -1;
   for (int i = 0; i < jj_2_rtns.Length; i++) jj_2_rtns[i] = new JJCalls();
 }
Beispiel #6
0
 public void ReInit(System.IO.StreamReader stream) {
   jj_input_stream.ReInit(stream, 1, 1);
   token_source.ReInit(jj_input_stream);
   token = new Token();
   jj_ntk = -1;
   jjtree.reset();
   jj_gen = 0;
   for (int i = 0; i < 88; i++) jj_la1[i] = -1;
   for (int i = 0; i < jj_2_rtns.Length; i++) jj_2_rtns[i] = new JJCalls();
 }
Beispiel #7
0
 public IDLParser(System.IO.StreamReader stream) {
   jj_input_stream = new SimpleCharStream(stream, 1, 1);
   token_source = new IDLParserTokenManager(jj_input_stream);
   token = new Token();
   jj_ntk = -1;
   jj_gen = 0;
   for (int i = 0; i < 88; i++) jj_la1[i] = -1;
   for (int i = 0; i < jj_2_rtns.Length; i++) jj_2_rtns[i] = new JJCalls();
 }