Math2mat
|
00001 // $ANTLR 2.7.7 (20060906): "octaveParser.g" -> "OctaveLexer.java"$ 00002 00003 package m2m.backend.octaveparser; 00004 00005 //import org.eclipse.ui.IWorkbenchPage; 00006 //import org.eclipse.ui.PlatformUI; 00007 00008 //import m2mgui.view.Editor; 00009 00010 import m2m.backend.structure.*; 00011 import java.util.Vector; 00012 import java.util.HashMap; 00013 import java.util.Iterator; 00014 00015 00016 import java.io.InputStream; 00017 import antlr.TokenStreamException; 00018 import antlr.TokenStreamIOException; 00019 import antlr.TokenStreamRecognitionException; 00020 import antlr.CharStreamException; 00021 import antlr.CharStreamIOException; 00022 import antlr.ANTLRException; 00023 import java.io.Reader; 00024 import java.util.Hashtable; 00025 import antlr.CharScanner; 00026 import antlr.InputBuffer; 00027 import antlr.ByteBuffer; 00028 import antlr.CharBuffer; 00029 import antlr.Token; 00030 import antlr.CommonToken; 00031 import antlr.RecognitionException; 00032 import antlr.NoViableAltForCharException; 00033 import antlr.MismatchedCharException; 00034 import antlr.TokenStream; 00035 import antlr.ANTLRHashString; 00036 import antlr.LexerSharedInputState; 00037 import antlr.collections.impl.BitSet; 00038 import antlr.SemanticException; 00039 00040 public class OctaveLexer extends antlr.CharScanner implements OctaveParserTokenTypes, TokenStream 00041 { 00042 public OctaveLexer(InputStream in) { 00043 this(new ByteBuffer(in)); 00044 } 00045 public OctaveLexer(Reader in) { 00046 this(new CharBuffer(in)); 00047 } 00048 public OctaveLexer(InputBuffer ib) { 00049 this(new LexerSharedInputState(ib)); 00050 } 00051 public OctaveLexer(LexerSharedInputState state) { 00052 super(state); 00053 caseSensitiveLiterals = true; 00054 setCaseSensitive(true); 00055 literals = new Hashtable(); 00056 literals.put(new ANTLRHashString("switch", this), new Integer(50)); 00057 literals.put(new ANTLRHashString("error", this), new Integer(45)); 00058 literals.put(new ANTLRHashString("case", this), new Integer(51)); 00059 literals.put(new ANTLRHashString("endfunction", this), new Integer(29)); 00060 literals.put(new ANTLRHashString("for", this), new Integer(40)); 00061 literals.put(new ANTLRHashString("printf", this), new Integer(44)); 00062 literals.put(new ANTLRHashString("end", this), new Integer(28)); 00063 literals.put(new ANTLRHashString("endwhile", this), new Integer(42)); 00064 literals.put(new ANTLRHashString("endif", this), new Integer(31)); 00065 literals.put(new ANTLRHashString("function", this), new Integer(27)); 00066 literals.put(new ANTLRHashString("elseif", this), new Integer(33)); 00067 literals.put(new ANTLRHashString("while", this), new Integer(43)); 00068 literals.put(new ANTLRHashString("endfor", this), new Integer(39)); 00069 literals.put(new ANTLRHashString("break", this), new Integer(56)); 00070 literals.put(new ANTLRHashString("return", this), new Integer(47)); 00071 literals.put(new ANTLRHashString("if", this), new Integer(30)); 00072 literals.put(new ANTLRHashString("otherwise", this), new Integer(54)); 00073 literals.put(new ANTLRHashString("else", this), new Integer(34)); 00074 literals.put(new ANTLRHashString("then", this), new Integer(32)); 00075 } 00076 00077 public Token nextToken() throws TokenStreamException { 00078 Token theRetToken=null; 00079 tryAgain: 00080 for (;;) { 00081 Token _token = null; 00082 int _ttype = Token.INVALID_TYPE; 00083 resetText(); 00084 try { // for char stream error handling 00085 try { // for lexical error handling 00086 switch ( LA(1)) { 00087 case '0': case '1': case '2': case '3': 00088 case '4': case '5': case '6': case '7': 00089 case '8': case '9': 00090 { 00091 mNUMBER(true); 00092 theRetToken=_returnToken; 00093 break; 00094 } 00095 case 'A': case 'B': case 'C': case 'D': 00096 case 'E': case 'F': case 'G': case 'H': 00097 case 'I': case 'J': case 'K': case 'L': 00098 case 'M': case 'N': case 'O': case 'P': 00099 case 'Q': case 'R': case 'S': case 'T': 00100 case 'U': case 'V': case 'W': case 'X': 00101 case 'Y': case 'Z': case 'a': case 'b': 00102 case 'c': case 'd': case 'e': case 'f': 00103 case 'g': case 'h': case 'i': case 'j': 00104 case 'k': case 'l': case 'm': case 'n': 00105 case 'o': case 'p': case 'q': case 'r': 00106 case 's': case 't': case 'u': case 'v': 00107 case 'w': case 'x': case 'y': case 'z': 00108 { 00109 mSTRING(true); 00110 theRetToken=_returnToken; 00111 break; 00112 } 00113 case '(': 00114 { 00115 mLPAR(true); 00116 theRetToken=_returnToken; 00117 break; 00118 } 00119 case ')': 00120 { 00121 mRPAR(true); 00122 theRetToken=_returnToken; 00123 break; 00124 } 00125 case ';': 00126 { 00127 mSEMI(true); 00128 theRetToken=_returnToken; 00129 break; 00130 } 00131 case ',': 00132 { 00133 mCOMMA(true); 00134 theRetToken=_returnToken; 00135 break; 00136 } 00137 case '+': 00138 { 00139 mPLUS(true); 00140 theRetToken=_returnToken; 00141 break; 00142 } 00143 case '-': 00144 { 00145 mMINUS(true); 00146 theRetToken=_returnToken; 00147 break; 00148 } 00149 case ':': 00150 { 00151 mCOLON(true); 00152 theRetToken=_returnToken; 00153 break; 00154 } 00155 case '^': 00156 { 00157 mPWR1(true); 00158 theRetToken=_returnToken; 00159 break; 00160 } 00161 case '|': 00162 { 00163 mCOR(true); 00164 theRetToken=_returnToken; 00165 break; 00166 } 00167 case '&': 00168 { 00169 mCAND(true); 00170 theRetToken=_returnToken; 00171 break; 00172 } 00173 case '[': 00174 { 00175 mLBRAK(true); 00176 theRetToken=_returnToken; 00177 break; 00178 } 00179 case ']': 00180 { 00181 mRBRAK(true); 00182 theRetToken=_returnToken; 00183 break; 00184 } 00185 case '{': 00186 { 00187 mLBRAC(true); 00188 theRetToken=_returnToken; 00189 break; 00190 } 00191 case '}': 00192 { 00193 mRBRAC(true); 00194 theRetToken=_returnToken; 00195 break; 00196 } 00197 case '\t': case '\n': case '\r': case ' ': 00198 { 00199 mWS(true); 00200 theRetToken=_returnToken; 00201 break; 00202 } 00203 case '%': 00204 { 00205 mCOMMENT(true); 00206 theRetToken=_returnToken; 00207 break; 00208 } 00209 case '"': 00210 { 00211 mANY_STRING(true); 00212 theRetToken=_returnToken; 00213 break; 00214 } 00215 default: 00216 if ((LA(1)=='.') && (LA(2)=='+')) { 00217 mDPLUS(true); 00218 theRetToken=_returnToken; 00219 } 00220 else if ((LA(1)=='.') && (LA(2)=='-')) { 00221 mDMINUS(true); 00222 theRetToken=_returnToken; 00223 } 00224 else if ((LA(1)=='.') && (LA(2)=='*')) { 00225 mDMUL(true); 00226 theRetToken=_returnToken; 00227 } 00228 else if ((LA(1)=='.') && (LA(2)=='/')) { 00229 mDDIV(true); 00230 theRetToken=_returnToken; 00231 } 00232 else if ((LA(1)=='*') && (LA(2)=='*')) { 00233 mPWR2(true); 00234 theRetToken=_returnToken; 00235 } 00236 else if ((LA(1)=='=') && (LA(2)=='=')) { 00237 mCEQUAL(true); 00238 theRetToken=_returnToken; 00239 } 00240 else if ((LA(1)=='!') && (LA(2)=='=')) { 00241 mCNOTEQ(true); 00242 theRetToken=_returnToken; 00243 } 00244 else if ((LA(1)=='<') && (LA(2)=='=')) { 00245 mCLESEQ(true); 00246 theRetToken=_returnToken; 00247 } 00248 else if ((LA(1)=='>') && (LA(2)=='=')) { 00249 mCGREEQ(true); 00250 theRetToken=_returnToken; 00251 } 00252 else if ((LA(1)=='/') && (LA(2)=='*')) { 00253 mML_COMMENT(true); 00254 theRetToken=_returnToken; 00255 } 00256 else if ((LA(1)=='.') && (true)) { 00257 mDOT(true); 00258 theRetToken=_returnToken; 00259 } 00260 else if ((LA(1)=='=') && (true)) { 00261 mEQUAL(true); 00262 theRetToken=_returnToken; 00263 } 00264 else if ((LA(1)=='*') && (true)) { 00265 mMUL(true); 00266 theRetToken=_returnToken; 00267 } 00268 else if ((LA(1)=='/') && (true)) { 00269 mDIV(true); 00270 theRetToken=_returnToken; 00271 } 00272 else if ((LA(1)=='!') && (true)) { 00273 mNOT(true); 00274 theRetToken=_returnToken; 00275 } 00276 else if ((LA(1)=='<') && (true)) { 00277 mCLESS(true); 00278 theRetToken=_returnToken; 00279 } 00280 else if ((LA(1)=='>') && (true)) { 00281 mCGREAT(true); 00282 theRetToken=_returnToken; 00283 } 00284 else { 00285 if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);} 00286 else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 00287 } 00288 } 00289 if ( _returnToken==null ) continue tryAgain; // found SKIP token 00290 _ttype = _returnToken.getType(); 00291 _ttype = testLiteralsTable(_ttype); 00292 _returnToken.setType(_ttype); 00293 return _returnToken; 00294 } 00295 catch (RecognitionException e) { 00296 throw new TokenStreamRecognitionException(e); 00297 } 00298 } 00299 catch (CharStreamException cse) { 00300 if ( cse instanceof CharStreamIOException ) { 00301 throw new TokenStreamIOException(((CharStreamIOException)cse).io); 00302 } 00303 else { 00304 throw new TokenStreamException(cse.getMessage()); 00305 } 00306 } 00307 } 00308 } 00309 00310 protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00311 int _ttype; Token _token=null; int _begin=text.length(); 00312 _ttype = DIGIT; 00313 int _saveIndex; 00314 00315 matchRange('0','9'); 00316 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00317 _token = makeToken(_ttype); 00318 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00319 } 00320 _returnToken = _token; 00321 } 00322 00323 public final void mNUMBER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00324 int _ttype; Token _token=null; int _begin=text.length(); 00325 _ttype = NUMBER; 00326 int _saveIndex; 00327 00328 { 00329 int _cnt102=0; 00330 _loop102: 00331 do { 00332 if (((LA(1) >= '0' && LA(1) <= '9'))) { 00333 mDIGIT(false); 00334 } 00335 else { 00336 if ( _cnt102>=1 ) { break _loop102; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 00337 } 00338 00339 _cnt102++; 00340 } while (true); 00341 } 00342 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00343 _token = makeToken(_ttype); 00344 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00345 } 00346 _returnToken = _token; 00347 } 00348 00349 protected final void mCHAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00350 int _ttype; Token _token=null; int _begin=text.length(); 00351 _ttype = CHAR; 00352 int _saveIndex; 00353 00354 switch ( LA(1)) { 00355 case 'a': case 'b': case 'c': case 'd': 00356 case 'e': case 'f': case 'g': case 'h': 00357 case 'i': case 'j': case 'k': case 'l': 00358 case 'm': case 'n': case 'o': case 'p': 00359 case 'q': case 'r': case 's': case 't': 00360 case 'u': case 'v': case 'w': case 'x': 00361 case 'y': case 'z': 00362 { 00363 matchRange('a','z'); 00364 break; 00365 } 00366 case 'A': case 'B': case 'C': case 'D': 00367 case 'E': case 'F': case 'G': case 'H': 00368 case 'I': case 'J': case 'K': case 'L': 00369 case 'M': case 'N': case 'O': case 'P': 00370 case 'Q': case 'R': case 'S': case 'T': 00371 case 'U': case 'V': case 'W': case 'X': 00372 case 'Y': case 'Z': 00373 { 00374 matchRange('A','Z'); 00375 break; 00376 } 00377 default: 00378 { 00379 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 00380 } 00381 } 00382 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00383 _token = makeToken(_ttype); 00384 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00385 } 00386 _returnToken = _token; 00387 } 00388 00389 public final void mSTRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00390 int _ttype; Token _token=null; int _begin=text.length(); 00391 _ttype = STRING; 00392 int _saveIndex; 00393 00394 mCHAR(false); 00395 { 00396 _loop106: 00397 do { 00398 switch ( LA(1)) { 00399 case '0': case '1': case '2': case '3': 00400 case '4': case '5': case '6': case '7': 00401 case '8': case '9': 00402 { 00403 mDIGIT(false); 00404 break; 00405 } 00406 case 'A': case 'B': case 'C': case 'D': 00407 case 'E': case 'F': case 'G': case 'H': 00408 case 'I': case 'J': case 'K': case 'L': 00409 case 'M': case 'N': case 'O': case 'P': 00410 case 'Q': case 'R': case 'S': case 'T': 00411 case 'U': case 'V': case 'W': case 'X': 00412 case 'Y': case 'Z': case 'a': case 'b': 00413 case 'c': case 'd': case 'e': case 'f': 00414 case 'g': case 'h': case 'i': case 'j': 00415 case 'k': case 'l': case 'm': case 'n': 00416 case 'o': case 'p': case 'q': case 'r': 00417 case 's': case 't': case 'u': case 'v': 00418 case 'w': case 'x': case 'y': case 'z': 00419 { 00420 mCHAR(false); 00421 break; 00422 } 00423 case '_': 00424 { 00425 match('_'); 00426 break; 00427 } 00428 default: 00429 { 00430 break _loop106; 00431 } 00432 } 00433 } while (true); 00434 } 00435 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00436 _token = makeToken(_ttype); 00437 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00438 } 00439 _returnToken = _token; 00440 } 00441 00442 public final void mDOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00443 int _ttype; Token _token=null; int _begin=text.length(); 00444 _ttype = DOT; 00445 int _saveIndex; 00446 00447 match('.'); 00448 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00449 _token = makeToken(_ttype); 00450 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00451 } 00452 _returnToken = _token; 00453 } 00454 00455 public final void mEQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00456 int _ttype; Token _token=null; int _begin=text.length(); 00457 _ttype = EQUAL; 00458 int _saveIndex; 00459 00460 match('='); 00461 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00462 _token = makeToken(_ttype); 00463 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00464 } 00465 _returnToken = _token; 00466 } 00467 00468 public final void mLPAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00469 int _ttype; Token _token=null; int _begin=text.length(); 00470 _ttype = LPAR; 00471 int _saveIndex; 00472 00473 match('('); 00474 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00475 _token = makeToken(_ttype); 00476 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00477 } 00478 _returnToken = _token; 00479 } 00480 00481 public final void mRPAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00482 int _ttype; Token _token=null; int _begin=text.length(); 00483 _ttype = RPAR; 00484 int _saveIndex; 00485 00486 match(')'); 00487 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00488 _token = makeToken(_ttype); 00489 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00490 } 00491 _returnToken = _token; 00492 } 00493 00494 public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00495 int _ttype; Token _token=null; int _begin=text.length(); 00496 _ttype = SEMI; 00497 int _saveIndex; 00498 00499 match(';'); 00500 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00501 _token = makeToken(_ttype); 00502 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00503 } 00504 _returnToken = _token; 00505 } 00506 00507 public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00508 int _ttype; Token _token=null; int _begin=text.length(); 00509 _ttype = COMMA; 00510 int _saveIndex; 00511 00512 match(','); 00513 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00514 _token = makeToken(_ttype); 00515 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00516 } 00517 _returnToken = _token; 00518 } 00519 00520 public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00521 int _ttype; Token _token=null; int _begin=text.length(); 00522 _ttype = PLUS; 00523 int _saveIndex; 00524 00525 match('+'); 00526 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00527 _token = makeToken(_ttype); 00528 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00529 } 00530 _returnToken = _token; 00531 } 00532 00533 public final void mDPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00534 int _ttype; Token _token=null; int _begin=text.length(); 00535 _ttype = DPLUS; 00536 int _saveIndex; 00537 00538 match(".+"); 00539 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00540 _token = makeToken(_ttype); 00541 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00542 } 00543 _returnToken = _token; 00544 } 00545 00546 public final void mMINUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00547 int _ttype; Token _token=null; int _begin=text.length(); 00548 _ttype = MINUS; 00549 int _saveIndex; 00550 00551 match('-'); 00552 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00553 _token = makeToken(_ttype); 00554 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00555 } 00556 _returnToken = _token; 00557 } 00558 00559 public final void mDMINUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00560 int _ttype; Token _token=null; int _begin=text.length(); 00561 _ttype = DMINUS; 00562 int _saveIndex; 00563 00564 match(".-"); 00565 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00566 _token = makeToken(_ttype); 00567 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00568 } 00569 _returnToken = _token; 00570 } 00571 00572 public final void mMUL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00573 int _ttype; Token _token=null; int _begin=text.length(); 00574 _ttype = MUL; 00575 int _saveIndex; 00576 00577 match('*'); 00578 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00579 _token = makeToken(_ttype); 00580 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00581 } 00582 _returnToken = _token; 00583 } 00584 00585 public final void mDMUL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00586 int _ttype; Token _token=null; int _begin=text.length(); 00587 _ttype = DMUL; 00588 int _saveIndex; 00589 00590 match(".*"); 00591 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00592 _token = makeToken(_ttype); 00593 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00594 } 00595 _returnToken = _token; 00596 } 00597 00598 public final void mDIV(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00599 int _ttype; Token _token=null; int _begin=text.length(); 00600 _ttype = DIV; 00601 int _saveIndex; 00602 00603 match('/'); 00604 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00605 _token = makeToken(_ttype); 00606 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00607 } 00608 _returnToken = _token; 00609 } 00610 00611 public final void mDDIV(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00612 int _ttype; Token _token=null; int _begin=text.length(); 00613 _ttype = DDIV; 00614 int _saveIndex; 00615 00616 match("./"); 00617 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00618 _token = makeToken(_ttype); 00619 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00620 } 00621 _returnToken = _token; 00622 } 00623 00624 public final void mNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00625 int _ttype; Token _token=null; int _begin=text.length(); 00626 _ttype = NOT; 00627 int _saveIndex; 00628 00629 match('!'); 00630 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00631 _token = makeToken(_ttype); 00632 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00633 } 00634 _returnToken = _token; 00635 } 00636 00637 public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00638 int _ttype; Token _token=null; int _begin=text.length(); 00639 _ttype = COLON; 00640 int _saveIndex; 00641 00642 match(':'); 00643 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00644 _token = makeToken(_ttype); 00645 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00646 } 00647 _returnToken = _token; 00648 } 00649 00650 public final void mPWR1(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00651 int _ttype; Token _token=null; int _begin=text.length(); 00652 _ttype = PWR1; 00653 int _saveIndex; 00654 00655 match('^'); 00656 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00657 _token = makeToken(_ttype); 00658 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00659 } 00660 _returnToken = _token; 00661 } 00662 00663 public final void mPWR2(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00664 int _ttype; Token _token=null; int _begin=text.length(); 00665 _ttype = PWR2; 00666 int _saveIndex; 00667 00668 match("**"); 00669 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00670 _token = makeToken(_ttype); 00671 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00672 } 00673 _returnToken = _token; 00674 } 00675 00676 public final void mCEQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00677 int _ttype; Token _token=null; int _begin=text.length(); 00678 _ttype = CEQUAL; 00679 int _saveIndex; 00680 00681 match("=="); 00682 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00683 _token = makeToken(_ttype); 00684 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00685 } 00686 _returnToken = _token; 00687 } 00688 00689 public final void mCNOTEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00690 int _ttype; Token _token=null; int _begin=text.length(); 00691 _ttype = CNOTEQ; 00692 int _saveIndex; 00693 00694 match("!="); 00695 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00696 _token = makeToken(_ttype); 00697 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00698 } 00699 _returnToken = _token; 00700 } 00701 00702 public final void mCOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00703 int _ttype; Token _token=null; int _begin=text.length(); 00704 _ttype = COR; 00705 int _saveIndex; 00706 00707 match('|'); 00708 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00709 _token = makeToken(_ttype); 00710 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00711 } 00712 _returnToken = _token; 00713 } 00714 00715 public final void mCAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00716 int _ttype; Token _token=null; int _begin=text.length(); 00717 _ttype = CAND; 00718 int _saveIndex; 00719 00720 match('&'); 00721 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00722 _token = makeToken(_ttype); 00723 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00724 } 00725 _returnToken = _token; 00726 } 00727 00728 public final void mCLESS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00729 int _ttype; Token _token=null; int _begin=text.length(); 00730 _ttype = CLESS; 00731 int _saveIndex; 00732 00733 match('<'); 00734 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00735 _token = makeToken(_ttype); 00736 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00737 } 00738 _returnToken = _token; 00739 } 00740 00741 public final void mCGREAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00742 int _ttype; Token _token=null; int _begin=text.length(); 00743 _ttype = CGREAT; 00744 int _saveIndex; 00745 00746 match('>'); 00747 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00748 _token = makeToken(_ttype); 00749 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00750 } 00751 _returnToken = _token; 00752 } 00753 00754 public final void mCLESEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00755 int _ttype; Token _token=null; int _begin=text.length(); 00756 _ttype = CLESEQ; 00757 int _saveIndex; 00758 00759 match("<="); 00760 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00761 _token = makeToken(_ttype); 00762 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00763 } 00764 _returnToken = _token; 00765 } 00766 00767 public final void mCGREEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00768 int _ttype; Token _token=null; int _begin=text.length(); 00769 _ttype = CGREEQ; 00770 int _saveIndex; 00771 00772 match(">="); 00773 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00774 _token = makeToken(_ttype); 00775 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00776 } 00777 _returnToken = _token; 00778 } 00779 00780 public final void mLBRAK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00781 int _ttype; Token _token=null; int _begin=text.length(); 00782 _ttype = LBRAK; 00783 int _saveIndex; 00784 00785 match('['); 00786 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00787 _token = makeToken(_ttype); 00788 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00789 } 00790 _returnToken = _token; 00791 } 00792 00793 public final void mRBRAK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00794 int _ttype; Token _token=null; int _begin=text.length(); 00795 _ttype = RBRAK; 00796 int _saveIndex; 00797 00798 match(']'); 00799 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00800 _token = makeToken(_ttype); 00801 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00802 } 00803 _returnToken = _token; 00804 } 00805 00806 public final void mLBRAC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00807 int _ttype; Token _token=null; int _begin=text.length(); 00808 _ttype = LBRAC; 00809 int _saveIndex; 00810 00811 match('{'); 00812 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00813 _token = makeToken(_ttype); 00814 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00815 } 00816 _returnToken = _token; 00817 } 00818 00819 public final void mRBRAC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00820 int _ttype; Token _token=null; int _begin=text.length(); 00821 _ttype = RBRAC; 00822 int _saveIndex; 00823 00824 match('}'); 00825 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00826 _token = makeToken(_ttype); 00827 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00828 } 00829 _returnToken = _token; 00830 } 00831 00832 public final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00833 int _ttype; Token _token=null; int _begin=text.length(); 00834 _ttype = WS; 00835 int _saveIndex; 00836 00837 { 00838 switch ( LA(1)) { 00839 case ' ': 00840 { 00841 match(' '); 00842 break; 00843 } 00844 case '\t': 00845 { 00846 match('\t'); 00847 break; 00848 } 00849 case '\r': 00850 { 00851 match('\r'); 00852 match('\n'); 00853 newline(); 00854 break; 00855 } 00856 case '\n': 00857 { 00858 match('\n'); 00859 newline(); 00860 break; 00861 } 00862 default: 00863 { 00864 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 00865 } 00866 } 00867 } 00868 _ttype = Token.SKIP; 00869 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00870 _token = makeToken(_ttype); 00871 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00872 } 00873 _returnToken = _token; 00874 } 00875 00876 public final void mCOMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00877 int _ttype; Token _token=null; int _begin=text.length(); 00878 _ttype = COMMENT; 00879 int _saveIndex; 00880 00881 match('%'); 00882 { 00883 if ((LA(1)=='m') && (LA(2)=='2')) { 00884 match("m2m"); 00885 _ttype = M2M; 00886 } 00887 else if (((LA(1) >= '\u0000' && LA(1) <= '\u007f')) && (true)) { 00888 { 00889 _loop143: 00890 do { 00891 if ((_tokenSet_0.member(LA(1)))) { 00892 { 00893 match(_tokenSet_0); 00894 } 00895 } 00896 else { 00897 break _loop143; 00898 } 00899 00900 } while (true); 00901 } 00902 { 00903 switch ( LA(1)) { 00904 case '\n': 00905 { 00906 match('\n'); 00907 break; 00908 } 00909 case '\r': 00910 { 00911 match('\r'); 00912 { 00913 if ((LA(1)=='\n')) { 00914 match('\n'); 00915 } 00916 else { 00917 } 00918 00919 } 00920 break; 00921 } 00922 default: 00923 { 00924 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 00925 } 00926 } 00927 } 00928 _ttype = Token.SKIP; newline(); 00929 } 00930 else { 00931 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 00932 } 00933 00934 } 00935 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 00936 _token = makeToken(_ttype); 00937 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 00938 } 00939 _returnToken = _token; 00940 } 00941 00942 public final void mANY_STRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 00943 int _ttype; Token _token=null; int _begin=text.length(); 00944 _ttype = ANY_STRING; 00945 int _saveIndex; 00946 00947 match('"'); 00948 { 00949 _loop149: 00950 do { 00951 switch ( LA(1)) { 00952 case '\n': 00953 { 00954 match('\n'); 00955 newline(); 00956 break; 00957 } 00958 case '\u0000': case '\u0001': case '\u0002': case '\u0003': 00959 case '\u0004': case '\u0005': case '\u0006': case '\u0007': 00960 case '\u0008': case '\t': case '\u000b': case '\u000c': 00961 case '\u000e': case '\u000f': case '\u0010': case '\u0011': 00962 case '\u0012': case '\u0013': case '\u0014': case '\u0015': 00963 case '\u0016': case '\u0017': case '\u0018': case '\u0019': 00964 case '\u001a': case '\u001b': case '\u001c': case '\u001d': 00965 case '\u001e': case '\u001f': case ' ': case '!': 00966 case '#': case '$': case '%': case '&': 00967 case '\'': case '(': case ')': case '*': 00968 case '+': case ',': case '-': case '.': 00969 case '/': case '0': case '1': case '2': 00970 case '3': case '4': case '5': case '6': 00971 case '7': case '8': case '9': case ':': 00972 case ';': case '<': case '=': case '>': 00973 case '?': case '@': case 'A': case 'B': 00974 case 'C': case 'D': case 'E': case 'F': 00975 case 'G': case 'H': case 'I': case 'J': 00976 case 'K': case 'L': case 'M': case 'N': 00977 case 'O': case 'P': case 'Q': case 'R': 00978 case 'S': case 'T': case 'U': case 'V': 00979 case 'W': case 'X': case 'Y': case 'Z': 00980 case '[': case '\\': case ']': case '^': 00981 case '_': case '`': case 'a': case 'b': 00982 case 'c': case 'd': case 'e': case 'f': 00983 case 'g': case 'h': case 'i': case 'j': 00984 case 'k': case 'l': case 'm': case 'n': 00985 case 'o': case 'p': case 'q': case 'r': 00986 case 's': case 't': case 'u': case 'v': 00987 case 'w': case 'x': case 'y': case 'z': 00988 case '{': case '|': case '}': case '~': 00989 case '\u007f': 00990 { 00991 { 00992 match(_tokenSet_1); 00993 } 00994 break; 00995 } 00996 default: 00997 if ((LA(1)=='\r') && (LA(2)=='\n')) { 00998 match('\r'); 00999 match('\n'); 01000 newline(); 01001 } 01002 else if ((LA(1)=='\r') && ((LA(2) >= '\u0000' && LA(2) <= '\u007f'))) { 01003 match('\r'); 01004 newline(); 01005 } 01006 else { 01007 break _loop149; 01008 } 01009 } 01010 } while (true); 01011 } 01012 match('"'); 01013 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 01014 _token = makeToken(_ttype); 01015 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 01016 } 01017 _returnToken = _token; 01018 } 01019 01020 public final void mML_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 01021 int _ttype; Token _token=null; int _begin=text.length(); 01022 _ttype = ML_COMMENT; 01023 int _saveIndex; 01024 01025 match("/*"); 01026 { 01027 _loop153: 01028 do { 01029 switch ( LA(1)) { 01030 case '\n': 01031 { 01032 match('\n'); 01033 newline(); 01034 break; 01035 } 01036 case '\u0000': case '\u0001': case '\u0002': case '\u0003': 01037 case '\u0004': case '\u0005': case '\u0006': case '\u0007': 01038 case '\u0008': case '\t': case '\u000b': case '\u000c': 01039 case '\u000e': case '\u000f': case '\u0010': case '\u0011': 01040 case '\u0012': case '\u0013': case '\u0014': case '\u0015': 01041 case '\u0016': case '\u0017': case '\u0018': case '\u0019': 01042 case '\u001a': case '\u001b': case '\u001c': case '\u001d': 01043 case '\u001e': case '\u001f': case ' ': case '!': 01044 case '"': case '#': case '$': case '%': 01045 case '&': case '\'': case '(': case ')': 01046 case '+': case ',': case '-': case '.': 01047 case '/': case '0': case '1': case '2': 01048 case '3': case '4': case '5': case '6': 01049 case '7': case '8': case '9': case ':': 01050 case ';': case '<': case '=': case '>': 01051 case '?': case '@': case 'A': case 'B': 01052 case 'C': case 'D': case 'E': case 'F': 01053 case 'G': case 'H': case 'I': case 'J': 01054 case 'K': case 'L': case 'M': case 'N': 01055 case 'O': case 'P': case 'Q': case 'R': 01056 case 'S': case 'T': case 'U': case 'V': 01057 case 'W': case 'X': case 'Y': case 'Z': 01058 case '[': case '\\': case ']': case '^': 01059 case '_': case '`': case 'a': case 'b': 01060 case 'c': case 'd': case 'e': case 'f': 01061 case 'g': case 'h': case 'i': case 'j': 01062 case 'k': case 'l': case 'm': case 'n': 01063 case 'o': case 'p': case 'q': case 'r': 01064 case 's': case 't': case 'u': case 'v': 01065 case 'w': case 'x': case 'y': case 'z': 01066 case '{': case '|': case '}': case '~': 01067 case '\u007f': 01068 { 01069 { 01070 match(_tokenSet_2); 01071 } 01072 break; 01073 } 01074 default: 01075 if (((LA(1)=='*') && ((LA(2) >= '\u0000' && LA(2) <= '\u007f')))&&( LA(2)!='/' )) { 01076 match('*'); 01077 } 01078 else if ((LA(1)=='\r') && (LA(2)=='\n')) { 01079 match('\r'); 01080 match('\n'); 01081 newline(); 01082 } 01083 else if ((LA(1)=='\r') && ((LA(2) >= '\u0000' && LA(2) <= '\u007f'))) { 01084 match('\r'); 01085 newline(); 01086 } 01087 else { 01088 break _loop153; 01089 } 01090 } 01091 } while (true); 01092 } 01093 match("*/"); 01094 _ttype = Token.SKIP; 01095 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 01096 _token = makeToken(_ttype); 01097 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 01098 } 01099 _returnToken = _token; 01100 } 01101 01102 01103 private static final long[] mk_tokenSet_0() { 01104 long[] data = { -9217L, -1L, 0L, 0L}; 01105 return data; 01106 } 01107 public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); 01108 private static final long[] mk_tokenSet_1() { 01109 long[] data = { -17179878401L, -1L, 0L, 0L}; 01110 return data; 01111 } 01112 public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); 01113 private static final long[] mk_tokenSet_2() { 01114 long[] data = { -4398046520321L, -1L, 0L, 0L}; 01115 return data; 01116 } 01117 public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); 01118 01119 }