Exemplo n.º 1
0
 public void ReInit(CharStream stream) {
   token_source.ReInit(stream);
   token = new Token();
   token.next = jj_nt = token_source.getNextToken();
   jj_gen = 0;
   for (int i = 0; i < 4; i++) jj_la1[i] = -1;
 }
Exemplo n.º 2
0
 public void ReInit(ManifestParserTokenManager tm) {
   token_source = tm;
   token = new Token();
   token.next = jj_nt = token_source.getNextToken();
   jj_gen = 0;
   for (int i = 0; i < 4; i++) jj_la1[i] = -1;
 }
Exemplo n.º 3
0
 public final Token getNextToken() {
   if (token.next != null) token = token.next;
   else token = token.next = token_source.getNextToken();
   jj_ntk = -1;
   jj_gen++;
   return token;
 }
Exemplo n.º 4
0
 public ManifestParser(CharStream stream) {
   token_source = new ManifestParserTokenManager(stream);
   token = new Token();
   token.next = jj_nt = token_source.getNextToken();
   jj_gen = 0;
   for (int i = 0; i < 4; i++) jj_la1[i] = -1;
 }
Exemplo n.º 5
0
 public final Token getToken(int index) {
   Token t = token;
   for (int i = 0; i < index; i++) {
     if (t.next != null) t = t.next;
     else t = t.next = token_source.getNextToken();
   }
   return t;
 }
Exemplo n.º 6
0
 /** Reinitialise. */
 public void ReInit(ISEParserTokenManager tm) {
   token_source = tm;
   token = new Token();
   token.next = jj_nt = token_source.getNextToken();
   jj_gen = 0;
   for (int i = 0; i < 3; i++) jj_la1[i] = -1;
   for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
 }
Exemplo n.º 7
0
 /** Reinitialise. */
 public void ReInit(java.io.Reader stream) {
   jj_input_stream.ReInit(stream, 1, 1);
   token_source.ReInit(jj_input_stream);
   token = new Token();
   token.next = jj_nt = token_source.getNextToken();
   jj_gen = 0;
   for (int i = 0; i < 3; i++) jj_la1[i] = -1;
   for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
 }
Exemplo n.º 8
0
 /** Constructor. */
 public ISEParser(java.io.Reader stream) {
   jj_input_stream = new JavaCharStream(stream, 1, 1);
   token_source = new ISEParserTokenManager(jj_input_stream);
   token = new Token();
   token.next = jj_nt = token_source.getNextToken();
   jj_gen = 0;
   for (int i = 0; i < 3; i++) jj_la1[i] = -1;
   for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
 }
Exemplo n.º 9
0
 private final Token jj_consume_token(int kind) throws ParseException {
   Token oldToken = token;
   if ((token = jj_nt).next != null) jj_nt = jj_nt.next;
   else jj_nt = jj_nt.next = token_source.getNextToken();
   if (token.kind == kind) {
     jj_gen++;
     return token;
   }
   jj_nt = token;
   token = oldToken;
   jj_kind = kind;
   throw generateParseException();
 }
Exemplo n.º 10
0
 /** Reinitialise. */
 public void ReInit(java.io.InputStream stream, String encoding) {
   try {
     jj_input_stream.ReInit(stream, encoding, 1, 1);
   } catch (java.io.UnsupportedEncodingException e) {
     throw new RuntimeException(e);
   }
   token_source.ReInit(jj_input_stream);
   token = new Token();
   token.next = jj_nt = token_source.getNextToken();
   jj_gen = 0;
   for (int i = 0; i < 3; i++) jj_la1[i] = -1;
   for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
 }
Exemplo n.º 11
0
 private Token jj_consume_token(int kind) throws ParseException {
   Token oldToken;
   if ((oldToken = token).next != null) token = token.next;
   else token = token.next = token_source.getNextToken();
   jj_ntk = -1;
   if (token.kind == kind) {
     jj_gen++;
     return token;
   }
   token = oldToken;
   jj_kind = kind;
   throw generateParseException();
 }
Exemplo n.º 12
0
 private final Token jj_consume_token(int kind) throws ParseException {
   Token oldToken;
   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();
 }
Exemplo n.º 13
0
 private final boolean 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;
 }
Exemplo n.º 14
0
 public final Token getNextToken() {
   if ((token = jj_nt).next != null) jj_nt = jj_nt.next;
   else jj_nt = jj_nt.next = token_source.getNextToken();
   jj_gen++;
   return token;
 }
Exemplo n.º 15
0
 private final int jj_ntk() {
   if ((jj_nt = token.next) == null)
     return (jj_ntk = (token.next = token_source.getNextToken()).kind);
   else return (jj_ntk = jj_nt.kind);
 }
  /** Get the next Token. */
  public Token getNextToken() {
    Token specialToken = null;
    Token matchedToken;
    int curPos = 0;

    EOFLoop:
    for (; ; ) {
      try {
        curChar = input_stream.BeginToken();
      } catch (java.io.IOException e) {
        jjmatchedKind = 0;
        matchedToken = jjFillToken();
        matchedToken.specialToken = specialToken;
        return matchedToken;
      }
      image = jjimage;
      image.setLength(0);
      jjimageLen = 0;

      for (; ; ) {
        switch (curLexState) {
          case 0:
            try {
              input_stream.backup(0);
              while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L)
                curChar = input_stream.BeginToken();
            } catch (java.io.IOException e1) {
              continue EOFLoop;
            }
            jjmatchedKind = 0x7fffffff;
            jjmatchedPos = 0;
            curPos = jjMoveStringLiteralDfa0_0();
            break;
          case 1:
            jjmatchedKind = 0x7fffffff;
            jjmatchedPos = 0;
            curPos = jjMoveStringLiteralDfa0_1();
            if (jjmatchedPos == 0 && jjmatchedKind > 10) {
              jjmatchedKind = 10;
            }
            break;
          case 2:
            jjmatchedKind = 0x7fffffff;
            jjmatchedPos = 0;
            curPos = jjMoveStringLiteralDfa0_2();
            if (jjmatchedPos == 0 && jjmatchedKind > 10) {
              jjmatchedKind = 10;
            }
            break;
        }
        if (jjmatchedKind != 0x7fffffff) {
          if (jjmatchedPos + 1 < curPos) input_stream.backup(curPos - jjmatchedPos - 1);
          if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) {
            matchedToken = jjFillToken();
            matchedToken.specialToken = specialToken;
            if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind];
            return matchedToken;
          } else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) {
            if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) {
              matchedToken = jjFillToken();
              if (specialToken == null) specialToken = matchedToken;
              else {
                matchedToken.specialToken = specialToken;
                specialToken = (specialToken.next = matchedToken);
              }
              SkipLexicalActions(matchedToken);
            } else SkipLexicalActions(null);
            if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind];
            continue EOFLoop;
          }
          jjimageLen += jjmatchedPos + 1;
          if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind];
          curPos = 0;
          jjmatchedKind = 0x7fffffff;
          try {
            curChar = input_stream.readChar();
            continue;
          } catch (java.io.IOException e1) {
          }
        }
        int error_line = input_stream.getEndLine();
        int error_column = input_stream.getEndColumn();
        String error_after = null;
        boolean EOFSeen = false;
        try {
          input_stream.readChar();
          input_stream.backup(1);
        } catch (java.io.IOException e1) {
          EOFSeen = true;
          error_after = curPos <= 1 ? "" : input_stream.GetImage();
          if (curChar == '\n' || curChar == '\r') {
            error_line++;
            error_column = 0;
          } else error_column++;
        }
        if (!EOFSeen) {
          input_stream.backup(1);
          error_after = curPos <= 1 ? "" : input_stream.GetImage();
        }
        throw new TokenMgrError(
            EOFSeen,
            curLexState,
            error_line,
            error_column,
            error_after,
            curChar,
            TokenMgrError.LEXICAL_ERROR);
      }
    }
  }