示例#1
0
 @DSGenerator(
     tool_name = "Doppelganger",
     tool_version = "2.0",
     generated_on = "2013-12-30 12:55:50.956 -0500",
     hash_original_method = "E053A5C6A0917BEE124D59DA4B3EBFD6",
     hash_generated_method = "992E1330C1CE9A9FF2C91E4A293DC434")
 public Token[] peekNextToken(int ntokens) throws ParseException {
   int old = ptr;
   Token[] retval = new Token[ntokens];
   for (int i = 0; i < ntokens; i++) {
     Token tok = new Token();
     if (startsId()) {
       String id = ttoken();
       tok.tokenValue = id;
       String idUppercase = id.toUpperCase();
       if (currentLexer.containsKey(idUppercase)) {
         Integer type = (Integer) currentLexer.get(idUppercase);
         tok.tokenType = type.intValue();
       } else tok.tokenType = ID;
     } else {
       char nextChar = getNextChar();
       tok.tokenValue = String.valueOf(nextChar);
       if (isAlpha(nextChar)) {
         tok.tokenType = ALPHA;
       } else if (isDigit(nextChar)) {
         tok.tokenType = DIGIT;
       } else tok.tokenType = (int) nextChar;
     }
     retval[i] = tok;
   }
   savedPtr = ptr;
   ptr = old;
   return retval;
 }