예제 #1
0
 //
 // Advanced the input by one character
 //
 protected void advance() throws java.io.IOException {
   next_char = inp.read();
   switch (next_char) {
     case -1: // EOF
       if (char_num == 0) {
         char_num = -1;
         break;
       }
       next_char = '\n';
       // pass thru
     case '\n': // a new line
       line_num++;
       char_num = 0;
       break;
     default:
       line.append((char) next_char);
       char_num++;
       return;
   }
   line.setLength(0);
 }