Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Lexer.java

00001 package edu.ksu.cis.bandera.abstraction.specification.lexer;
00002 
00003 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00004  * Bandera, a Java(TM) analysis and transformation toolkit           *
00005  * Copyright (C) 1998-2001 SAnToS Laboratories (santos@cis.ksu.edu)  *
00006 
00007  * All rights reserved.                                              *
00008  *                                                                   *
00009  * This work was done as a project in the SAnToS Laboratory,         *
00010  * Department of Computing and Information Sciences, Kansas State    *
00011  * University, USA (http://www.cis.ksu.edu/santos).                  *
00012  * It is understood that any modification not identified as such is  *
00013  * not covered by the preceding statement.                           *
00014  *                                                                   *
00015  * This work is free software; you can redistribute it and/or        *
00016  * modify it under the terms of the GNU Library General Public       *
00017  * License as published by the Free Software Foundation; either      *
00018  * version 2 of the License, or (at your option) any later version.  *
00019  *                                                                   *
00020  * This work is distributed in the hope that it will be useful,      *
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of    *
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU *
00023  * Library General Public License for more details.                  *
00024  *                                                                   *
00025  * You should have received a copy of the GNU Library General Public *
00026  * License along with this toolkit; if not, write to the             *
00027  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,      *
00028  * Boston, MA  02111-1307, USA.                                      *
00029  *                                                                   *
00030  * Java is a trademark of Sun Microsystems, Inc.                     *
00031  *                                                                   *
00032  * To submit a bug report, send a comment, or get the latest news on *
00033  * this project and other SAnToS projects, please visit the web-site *
00034  *                http://www.cis.ksu.edu/santos                      *
00035  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00036 /* This file was generated by SableCC (http://www.sable.mcgill.ca/sablecc/). */
00037 
00038 import java.io.*;
00039 import java.util.*;
00040 import edu.ksu.cis.bandera.abstraction.specification.node.*;
00041 
00042 public class Lexer
00043 {
00044     protected Token token;
00045     protected State state = State.INITIAL;
00046 
00047     private PushbackReader in;
00048     private int line;
00049     private int pos;
00050     private boolean cr;
00051     private boolean eof;
00052     private final StringBuffer text = new StringBuffer();
00053 
00054     private static int[][][][] gotoTable;
00055 /*  {
00056         { // INITIAL
00057             {{9, 9, 1}, {10, 10, 2}, {12, 12, 3}, {13, 13, 4}, {32, 32, 5}, {33, 33, 6}, {36, 36, 7}, {37, 37, 8}, {38, 38, 9}, {40, 40, 10}, {41, 41, 11}, {42, 42, 12}, {43, 43, 13}, {44, 44, 14}, {45, 45, 15}, {46, 46, 16}, {47, 47, 17}, {48, 48, 18}, {49, 57, 19}, {58, 58, 20}, {59, 59, 21}, {60, 60, 22}, {61, 61, 23}, {62, 62, 24}, {63, 63, 25}, {65, 67, 26}, {68, 68, 27}, {69, 78, 26}, {79, 79, 28}, {80, 83, 26}, {84, 84, 29}, {85, 90, 26}, {94, 94, 30}, {95, 95, 31}, {97, 97, 32}, {98, 98, 33}, {99, 100, 26}, {101, 101, 34}, {102, 104, 26}, {105, 105, 35}, {106, 110, 26}, {111, 111, 36}, {112, 113, 26}, {114, 114, 37}, {115, 115, 26}, {116, 116, 38}, {117, 122, 26}, {123, 123, 39}, {124, 124, 40}, {125, 125, 41}, {126, 126, 42}, },
00058             {{9, 32, -2}, },
00059             {{9, 32, -2}, },
00060             {{9, 32, -2}, },
00061             {{9, 9, 1}, {10, 10, 43}, {12, 32, -2}, },
00062             {{9, 32, -2}, },
00063             {{61, 61, 44}, },
00064             {{36, 36, 45}, {48, 57, 46}, {65, 90, 47}, {95, 95, 48}, {97, 122, 47}, },
00065             {},
00066             {{38, 38, 49}, },
00067             {},
00068             {},
00069             {},
00070             {},
00071             {},
00072             {{62, 62, 50}, },
00073             {{48, 57, 51}, },
00074             {{42, 42, 52}, {47, 47, 53}, },
00075             {{46, 46, 54}, {48, 55, 55}, {56, 57, 56}, {69, 69, 57}, {70, 70, 58}, {76, 76, 59}, {88, 88, 60}, {101, 101, 61}, {102, 102, 62}, {108, 108, 63}, {120, 120, 64}, },
00076             {{46, 46, 54}, {48, 57, 65}, {69, 76, -20}, {101, 108, -20}, },
00077             {},
00078             {},
00079             {{60, 60, 66}, {61, 61, 67}, },
00080             {{61, 61, 68}, },
00081             {{61, 61, 69}, {62, 62, 70}, },
00082             {},
00083             {{36, 122, -9}, },
00084             {{36, 57, -9}, {65, 68, 47}, {69, 69, 71}, {70, 90, 47}, {95, 122, -9}, },
00085             {{36, 57, -9}, {65, 77, 47}, {78, 78, 72}, {79, 90, 47}, {95, 122, -9}, },
00086             {{36, 57, -9}, {65, 78, 47}, {79, 79, 73}, {80, 90, 47}, {95, 122, -9}, },
00087             {},
00088             {{36, 122, -9}, },
00089             {{36, 95, -9}, {97, 97, 47}, {98, 98, 74}, {99, 122, 47}, },
00090             {{36, 95, -9}, {97, 100, 47}, {101, 101, 75}, {102, 122, 47}, },
00091             {{36, 95, -9}, {97, 109, 47}, {110, 110, 76}, {111, 119, 47}, {120, 120, 77}, {121, 122, 47}, },
00092             {{36, 109, -36}, {110, 110, 78}, {111, 122, 47}, },
00093             {{36, 95, -9}, {97, 111, 47}, {112, 112, 79}, {113, 122, 47}, },
00094             {{36, 100, -35}, {101, 101, 80}, {102, 122, 47}, },
00095             {{36, 100, -35}, {101, 101, 81}, {102, 122, 47}, },
00096             {},
00097             {{124, 124, 82}, },
00098             {},
00099             {},
00100             {{9, 32, -2}, },
00101             {},
00102             {{36, 122, -9}, },
00103             {{36, 122, -9}, },
00104             {{36, 122, -9}, },
00105             {{36, 122, -9}, },
00106             {},
00107             {},
00108             {{48, 57, 51}, {69, 69, 83}, {70, 70, 84}, {101, 101, 85}, {102, 102, 86}, },
00109             {{0, 9, 87}, {10, 10, 88}, {11, 12, 87}, {13, 13, 89}, {14, 41, 87}, {42, 42, 90}, {43, 255, 87}, },
00110             {{0, 9, 91}, {10, 10, 92}, {11, 12, 91}, {13, 13, 93}, {14, 255, 91}, },
00111             {{48, 57, 94}, {69, 69, 95}, {70, 70, 96}, {101, 101, 97}, {102, 102, 98}, },
00112             {{46, 70, -20}, {76, 76, 99}, {101, 102, -20}, {108, 108, 100}, },
00113             {{46, 46, 54}, {48, 57, 56}, {69, 70, -20}, {101, 102, -20}, },
00114             {{43, 43, 101}, {45, 45, 102}, {48, 57, 103}, },
00115             {},
00116             {},
00117             {{48, 57, 104}, {65, 70, 105}, {97, 102, 106}, },
00118             {{43, 57, -59}, },
00119             {},
00120             {},
00121             {{48, 102, -62}, },
00122             {{46, 108, -21}, },
00123             {},
00124             {},
00125             {},
00126             {},
00127             {{62, 62, 107}, },
00128             {{36, 57, -9}, {65, 69, 47}, {70, 70, 108}, {71, 90, 47}, {95, 122, -9}, },
00129             {{36, 68, -29}, {69, 69, 109}, {70, 122, -29}, },
00130             {{36, 57, -9}, {65, 74, 47}, {75, 75, 110}, {76, 90, 47}, {95, 122, -9}, },
00131             {{36, 95, -9}, {97, 114, 47}, {115, 115, 111}, {116, 122, 47}, },
00132             {{36, 95, -9}, {97, 102, 47}, {103, 103, 112}, {104, 122, 47}, },
00133             {{36, 95, -9}, {97, 99, 47}, {100, 100, 113}, {101, 122, 47}, },
00134             {{36, 95, -9}, {97, 115, 47}, {116, 116, 114}, {117, 122, 47}, },
00135             {{36, 115, -79}, {116, 116, 115}, {117, 122, 47}, },
00136             {{36, 100, -35}, {101, 101, 116}, {102, 122, 47}, },
00137             {{36, 95, -9}, {97, 97, 117}, {98, 122, 47}, },
00138             {{36, 114, -76}, {115, 115, 118}, {116, 122, 47}, },
00139             {},
00140             {{43, 43, 119}, {45, 45, 120}, {48, 57, 121}, },
00141             {},
00142             {{43, 57, -85}, },
00143             {},
00144             {{0, 41, -54}, {42, 42, 122}, {43, 255, 87}, },
00145             {{0, 255, -89}, },
00146             {{0, 9, 87}, {10, 10, 123}, {11, 255, -89}, },
00147             {{0, 9, 124}, {10, 10, 125}, {11, 12, 124}, {13, 13, 126}, {14, 41, 124}, {42, 42, 127}, {43, 46, 124}, {47, 47, 128}, {48, 255, 124}, },
00148             {{0, 255, -55}, },
00149             {},
00150             {{10, 10, 129}, },
00151             {{48, 102, -56}, },
00152             {{43, 43, 130}, {45, 45, 131}, {48, 57, 132}, },
00153             {},
00154             {{43, 57, -97}, },
00155             {},
00156             {},
00157             {},
00158             {{48, 57, 103}, },
00159             {{48, 57, 103}, },
00160             {{48, 57, 103}, {70, 70, 133}, {102, 102, 134}, },
00161             {{48, 70, -62}, {76, 76, 135}, {97, 102, 106}, {108, 108, 136}, },
00162             {{48, 108, -106}, },
00163             {{48, 108, -106}, },
00164             {},
00165             {{36, 57, -9}, {65, 65, 137}, {66, 90, 47}, {95, 122, -9}, },
00166             {{36, 36, 45}, {48, 49, 46}, {50, 50, 138}, {51, 57, 46}, {65, 122, -9}, },
00167             {{36, 68, -29}, {69, 69, 139}, {70, 122, -29}, },
00168             {{36, 115, -79}, {116, 116, 140}, {117, 122, 47}, },
00169             {{36, 95, -9}, {97, 104, 47}, {105, 105, 141}, {106, 122, 47}, },
00170             {{36, 122, -9}, },
00171             {{36, 100, -35}, {101, 101, 142}, {102, 122, 47}, },
00172             {{36, 100, -35}, {101, 101, 143}, {102, 122, 47}, },
00173             {{36, 95, -9}, {97, 113, 47}, {114, 114, 144}, {115, 122, 47}, },
00174             {{36, 95, -9}, {97, 107, 47}, {108, 108, 145}, {109, 122, 47}, },
00175             {{36, 115, -79}, {116, 116, 146}, {117, 122, 47}, },
00176             {{48, 57, 121}, },
00177             {{48, 57, 121}, },
00178             {{48, 57, 121}, {70, 70, 84}, {102, 102, 86}, },
00179             {{0, 9, 147}, {10, 10, 148}, {11, 12, 147}, {13, 13, 149}, {14, 41, 147}, {42, 42, 122}, {43, 46, 147}, {47, 47, 150}, {48, 255, 147}, },
00180             {{0, 255, -89}, },
00181             {{0, 9, 151}, {10, 10, 152}, {11, 12, 151}, {13, 13, 153}, {14, 41, 151}, {42, 42, 154}, {43, 255, 151}, },
00182             {{0, 255, -126}, },
00183             {{0, 9, 151}, {10, 10, 155}, {11, 255, -126}, },
00184             {{0, 255, -92}, },
00185             {},
00186             {},
00187             {{48, 57, 132}, },
00188             {{48, 57, 132}, },
00189             {{48, 57, 132}, {70, 70, 96}, {102, 102, 98}, },
00190             {},
00191             {},
00192             {},
00193             {},
00194             {{36, 57, -9}, {65, 84, 47}, {85, 85, 156}, {86, 90, 47}, {95, 122, -9}, },
00195             {{36, 78, -31}, {79, 79, 157}, {80, 122, -31}, },
00196             {{36, 77, -30}, {78, 78, 158}, {79, 122, -30}, },
00197             {{36, 113, -118}, {114, 114, 159}, {115, 122, 47}, },
00198             {{36, 109, -36}, {110, 110, 160}, {111, 122, 47}, },
00199             {{36, 109, -36}, {110, 110, 161}, {111, 122, 47}, },
00200             {{36, 102, -77}, {103, 103, 162}, {104, 122, 47}, },
00201             {{36, 95, -9}, {97, 97, 163}, {98, 122, 47}, },
00202             {{36, 122, -9}, },
00203             {{36, 122, -9}, },
00204             {{0, 9, 164}, {10, 10, 165}, {11, 12, 164}, {13, 13, 166}, {14, 41, 164}, {42, 42, 167}, {43, 255, 164}, },
00205             {{0, 255, -149}, },
00206             {{0, 9, 164}, {10, 10, 168}, {11, 255, -149}, },
00207             {},
00208             {{0, 255, -126}, },
00209             {{0, 255, -126}, },
00210             {{0, 9, 151}, {10, 10, 169}, {11, 255, -126}, },
00211             {{0, 41, -92}, {42, 42, 154}, {43, 255, -92}, },
00212             {{0, 255, -126}, },
00213             {{36, 57, -9}, {65, 75, 47}, {76, 76, 170}, {77, 90, 47}, {95, 122, -9}, },
00214             {{36, 77, -30}, {78, 78, 171}, {79, 122, -30}, },
00215             {{36, 57, -9}, {65, 82, 47}, {83, 83, 172}, {84, 90, 47}, {95, 122, -9}, },
00216             {{36, 95, -9}, {97, 97, 173}, {98, 122, 47}, },
00217             {{36, 122, -9}, },
00218             {{36, 99, -78}, {100, 100, 174}, {101, 122, 47}, },
00219             {{36, 113, -118}, {114, 114, 175}, {115, 122, 47}, },
00220             {{36, 115, -79}, {116, 116, 176}, {117, 122, 47}, },
00221             {{0, 255, -149}, },
00222             {{0, 255, -149}, },
00223             {{0, 9, 164}, {10, 10, 177}, {11, 255, -149}, },
00224             {{0, 41, -124}, {42, 42, 167}, {43, 255, -124}, },
00225             {{0, 255, -149}, },
00226             {{0, 255, -126}, },
00227             {{36, 57, -9}, {65, 83, 47}, {84, 84, 178}, {85, 90, 47}, {95, 122, -9}, },
00228             {{36, 68, -29}, {69, 69, 179}, {70, 122, -29}, },
00229             {{36, 122, -9}, },
00230             {{36, 95, -9}, {97, 98, 47}, {99, 99, 180}, {100, 122, 47}, },
00231             {{36, 114, -76}, {115, 115, 181}, {116, 122, 47}, },
00232             {{36, 95, -9}, {97, 97, 182}, {98, 122, 47}, },
00233             {{36, 95, -9}, {97, 110, 47}, {111, 111, 183}, {112, 122, 47}, },
00234             {{0, 255, -149}, },
00235             {{36, 122, -9}, },
00236             {{36, 122, -9}, },
00237             {{36, 115, -79}, {116, 116, 184}, {117, 122, 47}, },
00238             {{36, 122, -9}, },
00239             {{36, 107, -119}, {108, 108, 185}, {109, 122, 47}, },
00240             {{36, 113, -118}, {114, 114, 186}, {115, 122, 47}, },
00241             {{36, 104, -114}, {105, 105, 187}, {106, 122, 47}, },
00242             {{36, 122, -9}, },
00243             {{36, 122, -9}, },
00244             {{36, 110, -178}, {111, 111, 188}, {112, 122, 47}, },
00245             {{36, 109, -36}, {110, 110, 189}, {111, 122, 47}, },
00246             {{36, 122, -9}, },
00247         }
00248     };*/
00249 
00250     private static int[][] accept;
00251 /*  {
00252         // INITIAL
00253         {0, 0, 0, 0, 0, 0, 24, 58, 31, 34, 4, 5, 29, 27, 10, 28, 11, 30, 50, 50, 9, 8, 14, 13, 15, 26, 58, 58, 58, 58, 32, 36, 58, 58, 58, 58, 58, 58, 58, 6, 33, 7, 25, 0, 18, 58, 58, 58, 58, 19, 35, 56, -1, 3, 56, 52, 56, -1, 57, 53, -1, -1, 57, 53, -1, 50, 21, 16, 12, 17, 22, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 20, -1, 57, -1, 57, -1, -1, -1, -1, 3, 3, 3, 56, -1, 57, -1, 57, 55, 55, -1, -1, 56, 51, 51, 51, 23, 58, 58, 58, 58, 58, 40, 58, 58, 58, 58, 58, -1, -1, 56, -1, -1, -1, -1, -1, -1, 2, 3, -1, -1, 56, 57, 57, 54, 54, 58, 58, 58, 58, 58, 58, 58, 58, 47, 46, -1, -1, -1, 1, -1, -1, -1, -1, -1, 58, 58, 58, 58, 39, 58, 58, 58, -1, -1, -1, -1, -1, -1, 58, 58, 42, 58, 58, 58, 58, -1, 43, 44, 58, 37, 58, 58, 41, 48, 49, 58, 58, 38, },
00254 
00255     };*/
00256 
00257     public static class State
00258     {
00259         public final static State INITIAL = new State(0);
00260 
00261         private int id;
00262 
00263         private State(int id)
00264         {
00265             this.id = id;
00266         }
00267 
00268         public int id()
00269         {
00270             return id;
00271         }
00272     }
00273     public Lexer(PushbackReader in)
00274     {
00275         this.in = in;
00276 
00277         if(gotoTable == null)
00278         {
00279             try
00280             {
00281                 DataInputStream s = new DataInputStream(
00282                     new BufferedInputStream(
00283                     Lexer.class.getResourceAsStream("lexer.dat")));
00284 
00285                 // read gotoTable
00286                 int length = s.readInt();
00287                 gotoTable = new int[length][][][];
00288                 for(int i = 0; i < gotoTable.length; i++)
00289                 {
00290                     length = s.readInt();
00291                     gotoTable[i] = new int[length][][];
00292                     for(int j = 0; j < gotoTable[i].length; j++)
00293                     {
00294                         length = s.readInt();
00295                         gotoTable[i][j] = new int[length][3];
00296                         for(int k = 0; k < gotoTable[i][j].length; k++)
00297                         {
00298                             for(int l = 0; l < 3; l++)
00299                             {
00300                                 gotoTable[i][j][k][l] = s.readInt();
00301                             }
00302                         }
00303                     }
00304                 }
00305 
00306                 // read accept
00307                 length = s.readInt();
00308                 accept = new int[length][];
00309                 for(int i = 0; i < accept.length; i++)
00310                 {
00311                     length = s.readInt();
00312                     accept[i] = new int[length];
00313                     for(int j = 0; j < accept[i].length; j++)
00314                     {
00315                         accept[i][j] = s.readInt();
00316                     }
00317                 }
00318 
00319                 s.close();
00320             }
00321             catch(Exception e)
00322             {
00323                 throw new RuntimeException("Unable to read lexer.dat.");
00324             }
00325         }
00326     }
00327     protected void filter() throws LexerException, IOException
00328     {
00329     }
00330     private int getChar() throws IOException
00331     {
00332         if(eof)
00333         {
00334             return -1;
00335         }
00336 
00337         int result = in.read();
00338 
00339         if(result == -1)
00340         {
00341             eof = true;
00342         }
00343 
00344         return result;
00345     }
00346     private String getText(int acceptLength)
00347     {
00348         StringBuffer s = new StringBuffer(acceptLength);
00349         for(int i = 0; i < acceptLength; i++)
00350         {
00351             s.append(text.charAt(i));
00352         }
00353 
00354         return s.toString();
00355     }
00356     protected Token getToken() throws IOException, LexerException
00357     {
00358         int dfa_state = 0;
00359 
00360         int start_pos = pos;
00361         int start_line = line;
00362 
00363         int accept_state = -1;
00364         int accept_token = -1;
00365         int accept_length = -1;
00366         int accept_pos = -1;
00367         int accept_line = -1;
00368 
00369         int[][][] gotoTable = this.gotoTable[state.id()];
00370         int[] accept = this.accept[state.id()];
00371         text.setLength(0);
00372 
00373         while(true)
00374         {
00375             int c = getChar();
00376 
00377             if(c != -1)
00378             {
00379                 switch(c)
00380                 {
00381                 case 10:
00382                     if(cr)
00383                     {
00384                         cr = false;
00385                     }
00386                     else
00387                     {
00388                         line++;
00389                         pos = 0;
00390                     }
00391                     break;
00392                 case 13:
00393                     line++;
00394                     pos = 0;
00395                     cr = true;
00396                     break;
00397                 default:
00398                     pos++;
00399                     cr = false;
00400                     break;
00401                 };
00402 
00403                 text.append((char) c);
00404 
00405                 do
00406                 {
00407                     int oldState = (dfa_state < -1) ? (-2 -dfa_state) : dfa_state;
00408 
00409                     dfa_state = -1;
00410 
00411                     int[][] tmp1 =  gotoTable[oldState];
00412                     int low = 0;
00413                     int high = tmp1.length - 1;
00414 
00415                     while(low <= high)
00416                     {
00417                         int middle = (low + high) / 2;
00418                         int[] tmp2 = tmp1[middle];
00419 
00420                         if(c < tmp2[0])
00421                         {
00422                             high = middle - 1;
00423                         }
00424                         else if(c > tmp2[1])
00425                         {
00426                             low = middle + 1;
00427                         }
00428                         else
00429                         {
00430                             dfa_state = tmp2[2];
00431                             break;
00432                         }
00433                     }
00434                 }while(dfa_state < -1);
00435             }
00436             else
00437             {
00438                 dfa_state = -1;
00439             }
00440 
00441             if(dfa_state >= 0)
00442             {
00443                 if(accept[dfa_state] != -1)
00444                 {
00445                     accept_state = dfa_state;
00446                     accept_token = accept[dfa_state];
00447                     accept_length = text.length();
00448                     accept_pos = pos;
00449                     accept_line = line;
00450                 }
00451             }
00452             else
00453             {
00454                 if(accept_state != -1)
00455                 {
00456                     switch(accept_token)
00457                     {
00458                     case 0:
00459                         {
00460                             Token token = new0(
00461                                 getText(accept_length),
00462                                 start_line + 1,
00463                                 start_pos + 1);
00464                             pushBack(accept_length);
00465                             pos = accept_pos;
00466                             line = accept_line;
00467                             return token;
00468                         }
00469                     case 1:
00470                         {
00471                             Token token = new1(
00472                                 getText(accept_length),
00473                                 start_line + 1,
00474                                 start_pos + 1);
00475                             pushBack(accept_length);
00476                             pos = accept_pos;
00477                             line = accept_line;
00478                             return token;
00479                         }
00480                     case 2:
00481                         {
00482                             Token token = new2(
00483                                 getText(accept_length),
00484                                 start_line + 1,
00485                                 start_pos + 1);
00486                             pushBack(accept_length);
00487                             pos = accept_pos;
00488                             line = accept_line;
00489                             return token;
00490                         }
00491                     case 3:
00492                         {
00493                             Token token = new3(
00494                                 getText(accept_length),
00495                                 start_line + 1,
00496                                 start_pos + 1);
00497                             pushBack(accept_length);
00498                             pos = accept_pos;
00499                             line = accept_line;
00500                             return token;
00501                         }
00502                     case 4:
00503                         {
00504                             Token token = new4(
00505                                 start_line + 1,
00506                                 start_pos + 1);
00507                             pushBack(accept_length);
00508                             pos = accept_pos;
00509                             line = accept_line;
00510                             return token;
00511                         }
00512                     case 5:
00513                         {
00514                             Token token = new5(
00515                                 start_line + 1,
00516                                 start_pos + 1);
00517                             pushBack(accept_length);
00518                             pos = accept_pos;
00519                             line = accept_line;
00520                             return token;
00521                         }
00522                     case 6:
00523                         {
00524                             Token token = new6(
00525                                 start_line + 1,
00526                                 start_pos + 1);
00527                             pushBack(accept_length);
00528                             pos = accept_pos;
00529                             line = accept_line;
00530                             return token;
00531                         }
00532                     case 7:
00533                         {
00534                             Token token = new7(
00535                                 start_line + 1,
00536                                 start_pos + 1);
00537                             pushBack(accept_length);
00538                             pos = accept_pos;
00539                             line = accept_line;
00540                             return token;
00541                         }
00542                     case 8:
00543                         {
00544                             Token token = new8(
00545                                 start_line + 1,
00546                                 start_pos + 1);
00547                             pushBack(accept_length);
00548                             pos = accept_pos;
00549                             line = accept_line;
00550                             return token;
00551                         }
00552                     case 9:
00553                         {
00554                             Token token = new9(
00555                                 start_line + 1,
00556                                 start_pos + 1);
00557                             pushBack(accept_length);
00558                             pos = accept_pos;
00559                             line = accept_line;
00560                             return token;
00561                         }
00562                     case 10:
00563                         {
00564                             Token token = new10(
00565                                 start_line + 1,
00566                                 start_pos + 1);
00567                             pushBack(accept_length);
00568                             pos = accept_pos;
00569                             line = accept_line;
00570                             return token;
00571                         }
00572                     case 11:
00573                         {
00574                             Token token = new11(
00575                                 start_line + 1,
00576                                 start_pos + 1);
00577                             pushBack(accept_length);
00578                             pos = accept_pos;
00579                             line = accept_line;
00580                             return token;
00581                         }
00582                     case 12:
00583                         {
00584                             Token token = new12(
00585                                 start_line + 1,
00586                                 start_pos + 1);
00587                             pushBack(accept_length);
00588                             pos = accept_pos;
00589                             line = accept_line;
00590                             return token;
00591                         }
00592                     case 13:
00593                         {
00594                             Token token = new13(
00595                                 start_line + 1,
00596                                 start_pos + 1);
00597                             pushBack(accept_length);
00598                             pos = accept_pos;
00599                             line = accept_line;
00600                             return token;
00601                         }
00602                     case 14:
00603                         {
00604                             Token token = new14(
00605                                 start_line + 1,
00606                                 start_pos + 1);
00607                             pushBack(accept_length);
00608                             pos = accept_pos;
00609                             line = accept_line;
00610                             return token;
00611                         }
00612                     case 15:
00613                         {
00614                             Token token = new15(
00615                                 start_line + 1,
00616                                 start_pos + 1);
00617                             pushBack(accept_length);
00618                             pos = accept_pos;
00619                             line = accept_line;
00620                             return token;
00621                         }
00622                     case 16:
00623                         {
00624                             Token token = new16(
00625                                 start_line + 1,
00626                                 start_pos + 1);
00627                             pushBack(accept_length);
00628                             pos = accept_pos;
00629                             line = accept_line;
00630                             return token;
00631                         }
00632                     case 17:
00633                         {
00634                             Token token = new17(
00635                                 start_line + 1,
00636                                 start_pos + 1);
00637                             pushBack(accept_length);
00638                             pos = accept_pos;
00639                             line = accept_line;
00640                             return token;
00641                         }
00642                     case 18:
00643                         {
00644                             Token token = new18(
00645                                 start_line + 1,
00646                                 start_pos + 1);
00647                             pushBack(accept_length);
00648                             pos = accept_pos;
00649                             line = accept_line;
00650                             return token;
00651                         }
00652                     case 19:
00653                         {
00654                             Token token = new19(
00655                                 start_line + 1,
00656                                 start_pos + 1);
00657                             pushBack(accept_length);
00658                             pos = accept_pos;
00659                             line = accept_line;
00660                             return token;
00661                         }
00662                     case 20:
00663                         {
00664                             Token token = new20(
00665                                 start_line + 1,
00666                                 start_pos + 1);
00667                             pushBack(accept_length);
00668                             pos = accept_pos;
00669                             line = accept_line;
00670                             return token;
00671                         }
00672                     case 21:
00673                         {
00674                             Token token = new21(
00675                                 start_line + 1,
00676                                 start_pos + 1);
00677                             pushBack(accept_length);
00678                             pos = accept_pos;
00679                             line = accept_line;
00680                             return token;
00681                         }
00682                     case 22:
00683                         {
00684                             Token token = new22(
00685                                 start_line + 1,
00686                                 start_pos + 1);
00687                             pushBack(accept_length);
00688                             pos = accept_pos;
00689                             line = accept_line;
00690                             return token;
00691                         }
00692                     case 23:
00693                         {
00694                             Token token = new23(
00695                                 start_line + 1,
00696                                 start_pos + 1);
00697                             pushBack(accept_length);
00698                             pos = accept_pos;
00699                             line = accept_line;
00700                             return token;
00701                         }
00702                     case 24:
00703                         {
00704                             Token token = new24(
00705                                 start_line + 1,
00706                                 start_pos + 1);
00707                             pushBack(accept_length);
00708                             pos = accept_pos;
00709                             line = accept_line;
00710                             return token;
00711                         }
00712                     case 25:
00713                         {
00714                             Token token = new25(
00715                                 start_line + 1,
00716                                 start_pos + 1);
00717                             pushBack(accept_length);
00718                             pos = accept_pos;
00719                             line = accept_line;
00720                             return token;
00721                         }
00722                     case 26:
00723                         {
00724                             Token token = new26(
00725                                 start_line + 1,
00726                                 start_pos + 1);
00727                             pushBack(accept_length);
00728                             pos = accept_pos;
00729                             line = accept_line;
00730                             return token;
00731                         }
00732                     case 27:
00733                         {
00734                             Token token = new27(
00735                                 start_line + 1,
00736                                 start_pos + 1);
00737                             pushBack(accept_length);
00738                             pos = accept_pos;
00739                             line = accept_line;
00740                             return token;
00741                         }
00742                     case 28:
00743                         {
00744                             Token token = new28(
00745                                 start_line + 1,
00746                                 start_pos + 1);
00747                             pushBack(accept_length);
00748                             pos = accept_pos;
00749                             line = accept_line;
00750                             return token;
00751                         }
00752                     case 29:
00753                         {
00754                             Token token = new29(
00755                                 start_line + 1,
00756                                 start_pos + 1);
00757                             pushBack(accept_length);
00758                             pos = accept_pos;
00759                             line = accept_line;
00760                             return token;
00761                         }
00762                     case 30:
00763                         {
00764                             Token token = new30(
00765                                 start_line + 1,
00766                                 start_pos + 1);
00767                             pushBack(accept_length);
00768                             pos = accept_pos;
00769                             line = accept_line;
00770                             return token;
00771                         }
00772                     case 31:
00773                         {
00774                             Token token = new31(
00775                                 start_line + 1,
00776                                 start_pos + 1);
00777                             pushBack(accept_length);
00778                             pos = accept_pos;
00779                             line = accept_line;
00780                             return token;
00781                         }
00782                     case 32:
00783                         {
00784                             Token token = new32(
00785                                 start_line + 1,
00786                                 start_pos + 1);
00787                             pushBack(accept_length);
00788                             pos = accept_pos;
00789                             line = accept_line;
00790                             return token;
00791                         }
00792                     case 33:
00793                         {
00794                             Token token = new33(
00795                                 start_line + 1,
00796                                 start_pos + 1);
00797                             pushBack(accept_length);
00798                             pos = accept_pos;
00799                             line = accept_line;
00800                             return token;
00801                         }
00802                     case 34:
00803                         {
00804                             Token token = new34(
00805                                 start_line + 1,
00806                                 start_pos + 1);
00807                             pushBack(accept_length);
00808                             pos = accept_pos;
00809                             line = accept_line;
00810                             return token;
00811                         }
00812                     case 35:
00813                         {
00814                             Token token = new35(
00815                                 start_line + 1,
00816                                 start_pos + 1);
00817                             pushBack(accept_length);
00818                             pos = accept_pos;
00819                             line = accept_line;
00820                             return token;
00821                         }
00822                     case 36:
00823                         {
00824                             Token token = new36(
00825                                 start_line + 1,
00826                                 start_pos + 1);
00827                             pushBack(accept_length);
00828                             pos = accept_pos;
00829                             line = accept_line;
00830                             return token;
00831                         }
00832                     case 37:
00833                         {
00834                             Token token = new37(
00835                                 start_line + 1,
00836                                 start_pos + 1);
00837                             pushBack(accept_length);
00838                             pos = accept_pos;
00839                             line = accept_line;
00840                             return token;
00841                         }
00842                     case 38:
00843                         {
00844                             Token token = new38(
00845                                 start_line + 1,
00846                                 start_pos + 1);
00847                             pushBack(accept_length);
00848                             pos = accept_pos;
00849                             line = accept_line;
00850                             return token;
00851                         }
00852                     case 39:
00853                         {
00854                             Token token = new39(
00855                                 start_line + 1,
00856                                 start_pos + 1);
00857                             pushBack(accept_length);
00858                             pos = accept_pos;
00859                             line = accept_line;
00860                             return token;
00861                         }
00862                     case 40:
00863                         {
00864                             Token token = new40(
00865                                 start_line + 1,
00866                                 start_pos + 1);
00867                             pushBack(accept_length);
00868                             pos = accept_pos;
00869                             line = accept_line;
00870                             return token;
00871                         }
00872                     case 41:
00873                         {
00874                             Token token = new41(
00875                                 start_line + 1,
00876                                 start_pos + 1);
00877                             pushBack(accept_length);
00878                             pos = accept_pos;
00879                             line = accept_line;
00880                             return token;
00881                         }
00882                     case 42:
00883                         {
00884                             Token token = new42(
00885                                 start_line + 1,
00886                                 start_pos + 1);
00887                             pushBack(accept_length);
00888                             pos = accept_pos;
00889                             line = accept_line;
00890                             return token;
00891                         }
00892                     case 43:
00893                         {
00894                             Token token = new43(
00895                                 start_line + 1,
00896                                 start_pos + 1);
00897                             pushBack(accept_length);
00898                             pos = accept_pos;
00899                             line = accept_line;
00900                             return token;
00901                         }
00902                     case 44:
00903                         {
00904                             Token token = new44(
00905                                 start_line + 1,
00906                                 start_pos + 1);
00907                             pushBack(accept_length);
00908                             pos = accept_pos;
00909                             line = accept_line;
00910                             return token;
00911                         }
00912                     case 45:
00913                         {
00914                             Token token = new45(
00915                                 start_line + 1,
00916                                 start_pos + 1);
00917                             pushBack(accept_length);
00918                             pos = accept_pos;
00919                             line = accept_line;
00920                             return token;
00921                         }
00922                     case 46:
00923                         {
00924                             Token token = new46(
00925                                 start_line + 1,
00926                                 start_pos + 1);
00927                             pushBack(accept_length);
00928                             pos = accept_pos;
00929                             line = accept_line;
00930                             return token;
00931                         }
00932                     case 47:
00933                         {
00934                             Token token = new47(
00935                                 start_line + 1,
00936                                 start_pos + 1);
00937                             pushBack(accept_length);
00938                             pos = accept_pos;
00939                             line = accept_line;
00940                             return token;
00941                         }
00942                     case 48:
00943                         {
00944                             Token token = new48(
00945                                 start_line + 1,
00946                                 start_pos + 1);
00947                             pushBack(accept_length);
00948                             pos = accept_pos;
00949                             line = accept_line;
00950                             return token;
00951                         }
00952                     case 49:
00953                         {
00954                             Token token = new49(
00955                                 start_line + 1,
00956                                 start_pos + 1);
00957                             pushBack(accept_length);
00958                             pos = accept_pos;
00959                             line = accept_line;
00960                             return token;
00961                         }
00962                     case 50:
00963                         {
00964                             Token token = new50(
00965                                 getText(accept_length),
00966                                 start_line + 1,
00967                                 start_pos + 1);
00968                             pushBack(accept_length);
00969                             pos = accept_pos;
00970                             line = accept_line;
00971                             return token;
00972                         }
00973                     case 51:
00974                         {
00975                             Token token = new51(
00976                                 getText(accept_length),
00977                                 start_line + 1,
00978                                 start_pos + 1);
00979                             pushBack(accept_length);
00980                             pos = accept_pos;
00981                             line = accept_line;
00982                             return token;
00983                         }
00984                     case 52:
00985                         {
00986                             Token token = new52(
00987                                 getText(accept_length),
00988                                 start_line + 1,
00989                                 start_pos + 1);
00990                             pushBack(accept_length);
00991                             pos = accept_pos;
00992                             line = accept_line;
00993                             return token;
00994                         }
00995                     case 53:
00996                         {
00997                             Token token = new53(
00998                                 getText(accept_length),
00999                                 start_line + 1,
01000                                 start_pos + 1);
01001                             pushBack(accept_length);
01002                             pos = accept_pos;
01003                             line = accept_line;
01004                             return token;
01005                         }
01006                     case 54:
01007                         {
01008                             Token token = new54(
01009                                 getText(accept_length),
01010                                 start_line + 1,
01011                                 start_pos + 1);
01012                             pushBack(accept_length);
01013                             pos = accept_pos;
01014                             line = accept_line;
01015                             return token;
01016                         }
01017                     case 55:
01018                         {
01019                             Token token = new55(
01020                                 getText(accept_length),
01021                                 start_line + 1,
01022                                 start_pos + 1);
01023                             pushBack(accept_length);
01024                             pos = accept_pos;
01025                             line = accept_line;
01026                             return token;
01027                         }
01028                     case 56:
01029                         {
01030                             Token token = new56(
01031                                 getText(accept_length),
01032                                 start_line + 1,
01033                                 start_pos + 1);
01034                             pushBack(accept_length);
01035                             pos = accept_pos;
01036                             line = accept_line;
01037                             return token;
01038                         }
01039                     case 57:
01040                         {
01041                             Token token = new57(
01042                                 getText(accept_length),
01043                                 start_line + 1,
01044                                 start_pos + 1);
01045                             pushBack(accept_length);
01046                             pos = accept_pos;
01047                             line = accept_line;
01048                             return token;
01049                         }
01050                     case 58:
01051                         {
01052                             Token token = new58(
01053                                 getText(accept_length),
01054                                 start_line + 1,
01055                                 start_pos + 1);
01056                             pushBack(accept_length);
01057                             pos = accept_pos;
01058                             line = accept_line;
01059                             return token;
01060                         }
01061                     }
01062                 }
01063                 else
01064                 {
01065                     if(text.length() > 0)
01066                     {
01067                         throw new LexerException(
01068                             "[" + (start_line + 1) + "," + (start_pos + 1) + "]" +
01069                             " Unknown token: " + text);
01070                     }
01071                     else
01072                     {
01073                         EOF token = new EOF(
01074                             start_line + 1,
01075                             start_pos + 1);
01076                         return token;
01077                     }
01078                 }
01079             }
01080         }
01081     }
01082     Token new0(String text, int line, int pos) { return new TWhiteSpace(text, line, pos); }
01083     Token new1(String text, int line, int pos) { return new TTraditionalComment(text, line, pos); }
01084     Token new10(int line, int pos) { return new TComma(line, pos); }
01085     Token new11(int line, int pos) { return new TDot(line, pos); }
01086     Token new12(int line, int pos) { return new TEqual(line, pos); }
01087     Token new13(int line, int pos) { return new TEq(line, pos); }
01088     Token new14(int line, int pos) { return new TLess(line, pos); }
01089     Token new15(int line, int pos) { return new TGreater(line, pos); }
01090     Token new16(int line, int pos) { return new TLessEqual(line, pos); }
01091     Token new17(int line, int pos) { return new TGreaterEqual(line, pos); }
01092     Token new18(int line, int pos) { return new TNotEqual(line, pos); }
01093     Token new19(int line, int pos) { return new TAnd(line, pos); }
01094     Token new2(String text, int line, int pos) { return new TDocumentationComment(text, line, pos); }
01095     Token new20(int line, int pos) { return new TOr(line, pos); }
01096     Token new21(int line, int pos) { return new TShiftLeft(line, pos); }
01097     Token new22(int line, int pos) { return new TSignedShiftRight(line, pos); }
01098     Token new23(int line, int pos) { return new TUnsignedShiftRight(line, pos); }
01099     Token new24(int line, int pos) { return new TNot(line, pos); }
01100     Token new25(int line, int pos) { return new TBitComplement(line, pos); }
01101     Token new26(int line, int pos) { return new TQuestion(line, pos); }
01102     Token new27(int line, int pos) { return new TPlus(line, pos); }
01103     Token new28(int line, int pos) { return new TMinus(line, pos); }
01104     Token new29(int line, int pos) { return new TTimes(line, pos); }
01105     Token new3(String text, int line, int pos) { return new TEndOfLineComment(text, line, pos); }
01106     Token new30(int line, int pos) { return new TDiv(line, pos); }
01107     Token new31(int line, int pos) { return new TMod(line, pos); }
01108     Token new32(int line, int pos) { return new TBitXor(line, pos); }
01109     Token new33(int line, int pos) { return new TBitOr(line, pos); }
01110     Token new34(int line, int pos) { return new TBitAnd(line, pos); }
01111     Token new35(int line, int pos) { return new TRightarrow(line, pos); }
01112     Token new36(int line, int pos) { return new TAny(line, pos); }
01113     Token new37(int line, int pos) { return new TExtends(line, pos); }
01114     Token new38(int line, int pos) { return new TAbstraction(line, pos); }
01115     Token new39(int line, int pos) { return new TBegin(line, pos); }
01116     Token new4(int line, int pos) { return new TLParen(line, pos); }
01117     Token new40(int line, int pos) { return new TEnd(line, pos); }
01118     Token new41(int line, int pos) { return new TAbstract(line, pos); }
01119     Token new42(int line, int pos) { return new TTokens(line, pos); }
01120     Token new43(int line, int pos) { return new TDefault(line, pos); }
01121     Token new44(int line, int pos) { return new TOne2one(line, pos); }
01122     Token new45(int line, int pos) { return new TAbtract(line, pos); }
01123     Token new46(int line, int pos) { return new TTest(line, pos); }
01124     Token new47(int line, int pos) { return new TReal(line, pos); }
01125     Token new48(int line, int pos) { return new TIntegral(line, pos); }
01126     Token new49(int line, int pos) { return new TOperator(line, pos); }
01127     Token new5(int line, int pos) { return new TRParen(line, pos); }
01128     Token new50(String text, int line, int pos) { return new TDecIntLiteral(text, line, pos); }
01129     Token new51(String text, int line, int pos) { return new THexIntLiteral(text, line, pos); }
01130     Token new52(String text, int line, int pos) { return new TOctIntLiteral(text, line, pos); }
01131     Token new53(String text, int line, int pos) { return new TDecLongLiteral(text, line, pos); }
01132     Token new54(String text, int line, int pos) { return new THexLongLiteral(text, line, pos); }
01133     Token new55(String text, int line, int pos) { return new TOctLongLiteral(text, line, pos); }
01134     Token new56(String text, int line, int pos) { return new TDoubleLiteral(text, line, pos); }
01135     Token new57(String text, int line, int pos) { return new TFloatLiteral(text, line, pos); }
01136     Token new58(String text, int line, int pos) { return new TId(text, line, pos); }
01137     Token new6(int line, int pos) { return new TLBrace(line, pos); }
01138     Token new7(int line, int pos) { return new TRBrace(line, pos); }
01139     Token new8(int line, int pos) { return new TSemicolon(line, pos); }
01140     Token new9(int line, int pos) { return new TColon(line, pos); }
01141     public Token next() throws LexerException, IOException
01142     {
01143         while(token == null)
01144         {
01145             token = getToken();
01146             filter();
01147         }
01148 
01149         Token result = token;
01150         token = null;
01151         return result;
01152     }
01153     public Token peek() throws LexerException, IOException
01154     {
01155         while(token == null)
01156         {
01157             token = getToken();
01158             filter();
01159         }
01160 
01161         return token;
01162     }
01163     private void pushBack(int acceptLength) throws IOException
01164     {
01165         int length = text.length();
01166         for(int i = length - 1; i >= acceptLength; i--)
01167         {
01168             eof = false;
01169 
01170             in.unread(text.charAt(i));
01171         }
01172     }
01173     protected void unread(Token token) throws IOException
01174     {
01175         String text = token.getText();
01176         int length = text.length();
01177 
01178         for(int i = length - 1; i >= 0; i--)
01179         {
01180             eof = false;
01181 
01182             in.unread(text.charAt(i));
01183         }
01184 
01185         pos = token.getPos() - 1;
01186         line = token.getLine() - 1;
01187     }
01188 }

Generated at Thu Feb 7 06:49:17 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001