Logo Search packages:      
Sourcecode: tau version File versions

java_cup.runtime.Symbol TauIL::lexer::Lexer::next_token (  )  throws java.io.IOException [inline]

Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs.

Returns:
the next token
Exceptions:
IOException if any I/O-Error occurs

Implements java_cup::runtime::Scanner.

Definition at line 838 of file Lexer.java.

References EXPAND, yy_atEOF, YY_ATTRIBUTE, yy_buffer, yy_currentPos, yy_do_eof(), yy_endRead, yy_lexical_state, yy_markedPos, yy_refill(), yy_rowMap, yy_ScanError(), yy_startRead, yy_state, yybegin(), yycmap, yycolumn, YYEOF, yylength(), yyline, yypushback(), yystate(), yytext(), and yytrans.

Referenced by debug_next_token().

                                                                         {
    int yy_input;
    int yy_action;

    // cached fields:
    int yy_currentPos_l;
    int yy_startRead_l;
    int yy_markedPos_l;
    int yy_endRead_l = yy_endRead;
    char [] yy_buffer_l = yy_buffer;
    char [] yycmap_l = yycmap;

    int [] yytrans_l = yytrans;
    int [] yy_rowMap_l = yy_rowMap;
    byte [] yy_attr_l = YY_ATTRIBUTE;

    while (true) {
      yy_markedPos_l = yy_markedPos;

      boolean yy_r = false;
      for (yy_currentPos_l = yy_startRead; yy_currentPos_l < yy_markedPos_l;
                                                             yy_currentPos_l++) {
        switch (yy_buffer_l[yy_currentPos_l]) {
        case '\u000B':
        case '\u000C':
        case '\u0085':
        case '\u2028':
        case '\u2029':
          yyline++;
          yycolumn = 0;
          yy_r = false;
          break;
        case '\r':
          yyline++;
          yycolumn = 0;
          yy_r = true;
          break;
        case '\n':
          if (yy_r)
            yy_r = false;
          else {
            yyline++;
            yycolumn = 0;
          }
          break;
        default:
          yy_r = false;
          yycolumn++;
        }
      }

      if (yy_r) {
        // peek one character ahead if it is \n (if we have counted one line too much)
        boolean yy_peek;
        if (yy_markedPos_l < yy_endRead_l)
          yy_peek = yy_buffer_l[yy_markedPos_l] == '\n';
        else if (yy_atEOF)
          yy_peek = false;
        else {
          boolean eof = yy_refill();
          yy_markedPos_l = yy_markedPos;
          yy_buffer_l = yy_buffer;
          if (eof) 
            yy_peek = false;
          else 
            yy_peek = yy_buffer_l[yy_markedPos_l] == '\n';
        }
        if (yy_peek) yyline--;
      }
      yy_action = -1;

      yy_startRead_l = yy_currentPos_l = yy_currentPos = 
                       yy_startRead = yy_markedPos_l;

      yy_state = yy_lexical_state;


      yy_forAction: {
        while (true) {

          if (yy_currentPos_l < yy_endRead_l)
            yy_input = yy_buffer_l[yy_currentPos_l++];
          else if (yy_atEOF) {
            yy_input = YYEOF;
            break yy_forAction;
          }
          else {
            // store back cached positions
            yy_currentPos  = yy_currentPos_l;
            yy_markedPos   = yy_markedPos_l;
            boolean eof = yy_refill();
            // get translated positions and possibly new buffer
            yy_currentPos_l  = yy_currentPos;
            yy_markedPos_l   = yy_markedPos;
            yy_buffer_l      = yy_buffer;
            yy_endRead_l     = yy_endRead;
            if (eof) {
              yy_input = YYEOF;
              break yy_forAction;
            }
            else {
              yy_input = yy_buffer_l[yy_currentPos_l++];
            }
          }
          int yy_next = yytrans_l[ yy_rowMap_l[yy_state] + yycmap_l[yy_input] ];
          if (yy_next == -1) break yy_forAction;
          yy_state = yy_next;

          int yy_attributes = yy_attr_l[yy_state];
          if ( (yy_attributes & 1) == 1 ) {
            yy_action = yy_state; 
            yy_markedPos_l = yy_currentPos_l; 
            if ( (yy_attributes & 8) == 8 ) break yy_forAction;
          }

        }
      }

      // store back cached position
      yy_markedPos = yy_markedPos_l;

      switch (yy_action) {

        case 263: 
          {  return token(sym.CONDS);  }
        case 286: break;
        case 207: 
          {  return token(sym.STATIC);  }
        case 287: break;
        case 206: 
          {  return token(sym.STDDEV);  }
        case 288: break;
        case 204: 
          {  return token(sym.TARGET);  }
        case 289: break;
        case 184: 
          {  return token(sym.GROUP);  }
        case 290: break;
        case 174: 
          {  return token(sym.EVENT);  }
        case 291: break;
        case 169: 
          {  return token(sym.COUNT);  }
        case 292: break;
        case 39: 
          {  /* return token(sym.UNION); */  }
        case 293: break;
        case 38: 
          {  /* return token(sym.KLEENE); */  }
        case 294: break;
        case 28: 
          {  return token(sym.LBRACE);  }
        case 295: break;
        case 29: 
          {  return token(sym.COLON);  }
        case 296: break;
        case 30: 
          {  return token(sym.RBRACE);  }
        case 297: break;
        case 261: 
          {  debug("Processed version variable.");
                          debug("VERSION = " + yytext().substring(8, yylength() - 1)); 
                          yybegin(COMMENT);  }
        case 298: break;
        case 249: 
          {  String key = yytext().substring(7);
                                yybegin(MACROVAL);
                          debug("Calling next_token");
                                  Symbol value = next_token();
                          table.put(key, value);
                                yybegin(COMMENT); 
                          debug("Processed define.");  }
        case 299: break;
        case 214: 
          {  yybegin(COMMENT); 
                                debug("Processed endif.");  }
        case 300: break;
        case 8: 
        case 9: 
          {  /* Ignore all whitespace */  }
        case 301: break;
        case 49: 
        case 50: 
        case 51: 
        case 52: 
          {  yybegin(COMMENT); 
                          yypushback(yylength());  }
        case 302: break;
        case 55: 
        case 56: 
          {   }
        case 303: break;
        case 284: 
          {  return token(sym.ANTICONDS);  }
        case 304: break;
        case 283: 
          {  return token(sym.INSTRUMENT);  }
        case 305: break;
        case 265: 
          {  return token(sym.USECS_CALL);  }
        case 306: break;
        case 13: 
          {  /* return token(sym.NON_EMPTY); */  }
        case 307: break;
        case 87: 
          {  return token(sym.LCOLBRACE);  }
        case 308: break;
        case 88: 
          {  return token(sym.RCOLBRACE);  }
        case 309: break;
        case 14: 
        case 43: 
          {  return_state = yystate(); debug("Expanding Macro"); yybegin(EXPAND);  }
        case 310: break;
        case 45: 
          {  /* Eat up comment text up to end of line */  }
        case 311: break;
        case 270: 
          {  return token(sym.TOTCOUNT);  }
        case 312: break;
        case 238: 
          {  return token(sym.NUMSUBRS);  }
        case 313: break;
        case 237: 
          {  return token(sym.NUMCALLS);  }
        case 314: break;
        case 231: 
          {  return token(sym.PROFILE);  }
        case 315: break;
        case 230: 
          {  return token(sym.PERCENT);  }
        case 316: break;
        case 227: 
          {  return token(sym.RUNTIME);  }
        case 317: break;
        case 225: 
          {  return token(sym.EXCLUDE);  }
        case 318: break;
        case 219: 
          {  return token(sym.CUMUSEC);  }
        case 319: break;
        case 215: 
          {  return token(sym.INCLUDE);  }
        case 320: break;
        case 277: 
          {  return token(sym.DECS);  }
        case 321: break;
        case 266: 
          {  return token(sym.DIRS);  }
        case 322: break;
        case 155: 
          {  return token(sym.FILE);  }
        case 323: break;
        case 150: 
          {  return token(sym.TYPE);  }
        case 324: break;
        case 140: 
          {  return token(sym.USEC);  }
        case 325: break;
        case 122: 
          {  return token(sym.PDT);  }
        case 326: break;
        case 111: 
          {  return token(sym.END);  }
        case 327: break;
        case 108: 
          {  return token(sym.USE);  }
        case 328: break;
        case 37: 
          {  debug("Found a String"); yybegin(STRING); string.setLength(0);  }
        case 329: break;
        case 31: 
          {  return token(sym.AND);  }
        case 330: break;
        case 11: 
        case 61: 
        case 99: 
          {  return token(sym.NUM, new Double(yytext()));  }
        case 331: break;
        case 89: 
          {  return token(sym.LTEQ);  }
        case 332: break;
        case 90: 
          {  return token(sym.GTEQ);  }
        case 333: break;
        case 91: 
          {  return token(sym.NEQ);  }
        case 334: break;
        case 275: 
          {  return token(sym.TAU_PROFILE);  }
        case 335: break;
        case 272: 
          {  return token(sym.COUNTS_CALL);  }
        case 336: break;
        case 10: 
        case 12: 
        case 15: 
        case 16: 
        case 17: 
        case 18: 
        case 19: 
        case 20: 
        case 21: 
        case 22: 
        case 23: 
        case 24: 
        case 25: 
        case 26: 
        case 27: 
        case 63: 
        case 64: 
        case 65: 
        case 66: 
        case 67: 
        case 68: 
        case 69: 
        case 70: 
        case 72: 
        case 73: 
        case 74: 
        case 75: 
        case 77: 
        case 78: 
        case 79: 
        case 80: 
        case 81: 
        case 82: 
        case 83: 
        case 84: 
        case 85: 
        case 86: 
        case 101: 
        case 102: 
        case 103: 
        case 104: 
        case 105: 
        case 106: 
        case 107: 
        case 109: 
        case 110: 
        case 112: 
        case 113: 
        case 114: 
        case 115: 
        case 116: 
        case 117: 
        case 118: 
        case 119: 
        case 120: 
        case 121: 
        case 123: 
        case 124: 
        case 125: 
        case 126: 
        case 133: 
        case 134: 
        case 135: 
        case 136: 
        case 137: 
        case 138: 
        case 139: 
        case 141: 
        case 142: 
        case 143: 
        case 144: 
        case 145: 
        case 146: 
        case 147: 
        case 148: 
        case 149: 
        case 151: 
        case 152: 
        case 153: 
        case 154: 
        case 156: 
        case 163: 
        case 164: 
        case 165: 
        case 166: 
        case 167: 
        case 168: 
        case 170: 
        case 171: 
        case 172: 
        case 173: 
        case 176: 
        case 177: 
        case 178: 
        case 179: 
        case 180: 
        case 181: 
        case 182: 
        case 183: 
        case 190: 
        case 191: 
        case 192: 
        case 193: 
        case 194: 
        case 195: 
        case 196: 
        case 198: 
        case 199: 
        case 200: 
        case 202: 
        case 203: 
        case 205: 
        case 208: 
        case 209: 
        case 216: 
        case 217: 
        case 218: 
        case 220: 
        case 223: 
        case 224: 
        case 228: 
        case 229: 
        case 236: 
        case 239: 
        case 242: 
        case 243: 
        case 245: 
        case 246: 
        case 251: 
        case 252: 
        case 255: 
        case 256: 
        case 258: 
        case 259: 
        case 262: 
        case 267: 
        case 269: 
        case 273: 
          {  return token(sym.ID, yytext());  }
        case 337: break;
        case 44: 
          {  yybegin(YYINITIAL);
                          return token(sym.STRING, string.toString());  }
        case 338: break;
        case 260: 
          {  String key = yytext().substring(8);
                                if (table.containsKey(key))
                            yybegin(IGNORE);
                          else 
                            yybegin(COMMENT);
                                debug("Processed ifndef.");  }
        case 339: break;
        case 58: 
          {  yybegin(return_state);
                          debug("MACRO = $" + yytext());
                              debug("MACRO TABLE = " + table.toString());
                          Symbol macro = (Symbol) table.get(yytext()); 
                          if (macro != null) 
                            return (Symbol) table.get(yytext());  }
        case 340: break;
        case 59: 
        case 60: 
          {  yypushback(yylength()); return null;  }
        case 341: break;
        case 248: 
          {  String key = yytext().substring(7);
                          System.out.println("key : " + key);
                                if (table.containsKey(key))
                            yybegin(COMMENT);
                          else
                            yybegin(IGNORE);
                                debug("Processed ifdef.");  }
        case 342: break;
        case 34: 
          {  return token(sym.GT);  }
        case 343: break;
        case 33: 
          {  return token(sym.EQ);  }
        case 344: break;
        case 32: 
          {  return token(sym.LT);  }
        case 345: break;
        case 46: 
        case 47: 
          {  if (extra_comment_line)
                              extra_comment_line = false;
                          else
                              yybegin(YYINITIAL);  }
        case 346: break;
        case 71: 
          {  return token(sym.DB);  }
        case 347: break;
        case 76: 
          {  return token(sym.AS);  }
        case 348: break;
        case 93: 
          {  errors.report(new ErrorMessage(yyline + ":Illegal escape sequence \"" + yytext() + "\""));  }
        case 349: break;
        case 41: 
          {  string.append(yytext());  }
        case 350: break;
        case 54: 
        case 57: 
          {  /* Do Nothing until endif directive found */  }
        case 351: break;
        case 48: 
          {  extra_comment_line = true;  }
        case 352: break;
        case 157: 
          {  yybegin(ENVIRONMENT);  }
        case 353: break;
        case 40: 
          {  yybegin(PREPROCESS);  }
        case 354: break;
        case 92: 
          {  yybegin(COMMENT);  }
        case 355: break;
        default: 
          if (yy_input == YYEOF && yy_startRead == yy_currentPos) {
            yy_atEOF = true;
            yy_do_eof();
              { return new java_cup.runtime.Symbol(sym.EOF); }
          } 
          else {
            yy_ScanError(YY_NO_MATCH);
          }
      }
    }
  }


Generated by  Doxygen 1.6.0   Back to index