00001
00002
00003 import sys
00004 from antlr3 import *
00005 from antlr3.compat import set, frozenset
00006
00007
00008
00009 HIDDEN = BaseRecognizer.HIDDEN
00010
00011
00012 CLOSEPAREN=9
00013 LETTER=17
00014 ATTRIBUTE=5
00015 OPENBRACKET=6
00016 WHITESPACE=4
00017 SEMICOLON=10
00018 ID=18
00019 EOF=-1
00020 CLOSEBRACKET=7
00021 SLASH=12
00022 COMMA=11
00023 MESSAGE=14
00024 INTERFACE=13
00025 DIGIT=16
00026 OPENPAREN=8
00027 COMMENT=19
00028 RETURNS=15
00029
00030
00031 class InterfaceLexer(Lexer):
00032
00033 grammarFileName = "/wg/bvu/jfaust/ros/dev/visualization-2.0/visualization/rve_interface_gen/antlr/InterfaceLexer.g"
00034 antlr_version = version_str_to_tuple("3.1.2")
00035 antlr_version_str = "3.1.2"
00036
00037 def __init__(self, input=None, state=None):
00038 if state is None:
00039 state = RecognizerSharedState()
00040 Lexer.__init__(self, input, state)
00041
00042 self.dfa7 = self.DFA7(
00043 self, 7,
00044 eot = self.DFA7_eot,
00045 eof = self.DFA7_eof,
00046 min = self.DFA7_min,
00047 max = self.DFA7_max,
00048 accept = self.DFA7_accept,
00049 special = self.DFA7_special,
00050 transition = self.DFA7_transition
00051 )
00052
00053
00054
00055
00056
00057
00058
00059 def mWHITESPACE(self, ):
00060
00061 try:
00062 _type = WHITESPACE
00063 _channel = DEFAULT_CHANNEL
00064
00065
00066
00067 pass
00068
00069 cnt1 = 0
00070 while True:
00071 alt1 = 2
00072 LA1_0 = self.input.LA(1)
00073
00074 if ((9 <= LA1_0 <= 10) or (12 <= LA1_0 <= 13) or LA1_0 == 32) :
00075 alt1 = 1
00076
00077
00078 if alt1 == 1:
00079
00080 pass
00081 if (9 <= self.input.LA(1) <= 10) or (12 <= self.input.LA(1) <= 13) or self.input.LA(1) == 32:
00082 self.input.consume()
00083 else:
00084 mse = MismatchedSetException(None, self.input)
00085 self.recover(mse)
00086 raise mse
00087
00088
00089
00090 else:
00091 if cnt1 >= 1:
00092 break
00093
00094 eee = EarlyExitException(1, self.input)
00095 raise eee
00096
00097 cnt1 += 1
00098
00099
00100
00101 _channel = HIDDEN;
00102
00103
00104
00105
00106 self._state.type = _type
00107 self._state.channel = _channel
00108
00109 finally:
00110
00111 pass
00112
00113
00114
00115
00116
00117
00118 def mATTRIBUTE(self, ):
00119
00120 try:
00121 _type = ATTRIBUTE
00122 _channel = DEFAULT_CHANNEL
00123
00124
00125
00126 pass
00127
00128
00129 pass
00130 self.match("dummy")
00131
00132
00133
00134
00135
00136
00137 self._state.type = _type
00138 self._state.channel = _channel
00139
00140 finally:
00141
00142 pass
00143
00144
00145
00146
00147
00148
00149 def mOPENBRACKET(self, ):
00150
00151 try:
00152 _type = OPENBRACKET
00153 _channel = DEFAULT_CHANNEL
00154
00155
00156
00157 pass
00158 self.match(123)
00159
00160
00161
00162 self._state.type = _type
00163 self._state.channel = _channel
00164
00165 finally:
00166
00167 pass
00168
00169
00170
00171
00172
00173
00174 def mCLOSEBRACKET(self, ):
00175
00176 try:
00177 _type = CLOSEBRACKET
00178 _channel = DEFAULT_CHANNEL
00179
00180
00181
00182 pass
00183 self.match(125)
00184
00185
00186
00187 self._state.type = _type
00188 self._state.channel = _channel
00189
00190 finally:
00191
00192 pass
00193
00194
00195
00196
00197
00198
00199 def mOPENPAREN(self, ):
00200
00201 try:
00202 _type = OPENPAREN
00203 _channel = DEFAULT_CHANNEL
00204
00205
00206
00207 pass
00208 self.match(40)
00209
00210
00211
00212 self._state.type = _type
00213 self._state.channel = _channel
00214
00215 finally:
00216
00217 pass
00218
00219
00220
00221
00222
00223
00224 def mCLOSEPAREN(self, ):
00225
00226 try:
00227 _type = CLOSEPAREN
00228 _channel = DEFAULT_CHANNEL
00229
00230
00231
00232 pass
00233 self.match(41)
00234
00235
00236
00237 self._state.type = _type
00238 self._state.channel = _channel
00239
00240 finally:
00241
00242 pass
00243
00244
00245
00246
00247
00248
00249 def mSEMICOLON(self, ):
00250
00251 try:
00252 _type = SEMICOLON
00253 _channel = DEFAULT_CHANNEL
00254
00255
00256
00257 pass
00258 self.match(59)
00259
00260
00261
00262 self._state.type = _type
00263 self._state.channel = _channel
00264
00265 finally:
00266
00267 pass
00268
00269
00270
00271
00272
00273
00274 def mCOMMA(self, ):
00275
00276 try:
00277 _type = COMMA
00278 _channel = DEFAULT_CHANNEL
00279
00280
00281
00282 pass
00283 self.match(44)
00284
00285
00286
00287 self._state.type = _type
00288 self._state.channel = _channel
00289
00290 finally:
00291
00292 pass
00293
00294
00295
00296
00297
00298
00299 def mSLASH(self, ):
00300
00301 try:
00302 _type = SLASH
00303 _channel = DEFAULT_CHANNEL
00304
00305
00306
00307 pass
00308 self.match(47)
00309
00310
00311
00312 self._state.type = _type
00313 self._state.channel = _channel
00314
00315 finally:
00316
00317 pass
00318
00319
00320
00321
00322
00323
00324 def mINTERFACE(self, ):
00325
00326 try:
00327 _type = INTERFACE
00328 _channel = DEFAULT_CHANNEL
00329
00330
00331
00332 pass
00333 self.match("interface")
00334
00335
00336
00337 self._state.type = _type
00338 self._state.channel = _channel
00339
00340 finally:
00341
00342 pass
00343
00344
00345
00346
00347
00348
00349 def mMESSAGE(self, ):
00350
00351 try:
00352 _type = MESSAGE
00353 _channel = DEFAULT_CHANNEL
00354
00355
00356
00357 pass
00358 self.match("message")
00359
00360
00361
00362 self._state.type = _type
00363 self._state.channel = _channel
00364
00365 finally:
00366
00367 pass
00368
00369
00370
00371
00372
00373
00374 def mRETURNS(self, ):
00375
00376 try:
00377 _type = RETURNS
00378 _channel = DEFAULT_CHANNEL
00379
00380
00381
00382 pass
00383 self.match("returns")
00384
00385
00386
00387 self._state.type = _type
00388 self._state.channel = _channel
00389
00390 finally:
00391
00392 pass
00393
00394
00395
00396
00397
00398
00399 def mDIGIT(self, ):
00400
00401 try:
00402
00403
00404 pass
00405
00406
00407 pass
00408 self.matchRange(48, 57)
00409
00410
00411
00412
00413
00414
00415
00416 finally:
00417
00418 pass
00419
00420
00421
00422
00423
00424
00425 def mLETTER(self, ):
00426
00427 try:
00428
00429
00430 pass
00431 if (65 <= self.input.LA(1) <= 90) or (97 <= self.input.LA(1) <= 122):
00432 self.input.consume()
00433 else:
00434 mse = MismatchedSetException(None, self.input)
00435 self.recover(mse)
00436 raise mse
00437
00438
00439
00440
00441
00442 finally:
00443
00444 pass
00445
00446
00447
00448
00449
00450
00451 def mID(self, ):
00452
00453 try:
00454 _type = ID
00455 _channel = DEFAULT_CHANNEL
00456
00457
00458
00459 pass
00460 if (65 <= self.input.LA(1) <= 90) or self.input.LA(1) == 95 or (97 <= self.input.LA(1) <= 122):
00461 self.input.consume()
00462 else:
00463 mse = MismatchedSetException(None, self.input)
00464 self.recover(mse)
00465 raise mse
00466
00467
00468 while True:
00469 alt2 = 4
00470 LA2 = self.input.LA(1)
00471 if LA2 == 65 or LA2 == 66 or LA2 == 67 or LA2 == 68 or LA2 == 69 or LA2 == 70 or LA2 == 71 or LA2 == 72 or LA2 == 73 or LA2 == 74 or LA2 == 75 or LA2 == 76 or LA2 == 77 or LA2 == 78 or LA2 == 79 or LA2 == 80 or LA2 == 81 or LA2 == 82 or LA2 == 83 or LA2 == 84 or LA2 == 85 or LA2 == 86 or LA2 == 87 or LA2 == 88 or LA2 == 89 or LA2 == 90 or LA2 == 97 or LA2 == 98 or LA2 == 99 or LA2 == 100 or LA2 == 101 or LA2 == 102 or LA2 == 103 or LA2 == 104 or LA2 == 105 or LA2 == 106 or LA2 == 107 or LA2 == 108 or LA2 == 109 or LA2 == 110 or LA2 == 111 or LA2 == 112 or LA2 == 113 or LA2 == 114 or LA2 == 115 or LA2 == 116 or LA2 == 117 or LA2 == 118 or LA2 == 119 or LA2 == 120 or LA2 == 121 or LA2 == 122:
00472 alt2 = 1
00473 elif LA2 == 48 or LA2 == 49 or LA2 == 50 or LA2 == 51 or LA2 == 52 or LA2 == 53 or LA2 == 54 or LA2 == 55 or LA2 == 56 or LA2 == 57:
00474 alt2 = 2
00475 elif LA2 == 95:
00476 alt2 = 3
00477
00478 if alt2 == 1:
00479
00480 pass
00481 self.mLETTER()
00482
00483
00484 elif alt2 == 2:
00485
00486 pass
00487 self.mDIGIT()
00488
00489
00490 elif alt2 == 3:
00491
00492 pass
00493 self.match(95)
00494
00495
00496 else:
00497 break
00498
00499
00500
00501
00502
00503 self._state.type = _type
00504 self._state.channel = _channel
00505
00506 finally:
00507
00508 pass
00509
00510
00511
00512
00513
00514
00515 def mCOMMENT(self, ):
00516
00517 try:
00518 _type = COMMENT
00519 _channel = DEFAULT_CHANNEL
00520
00521
00522 alt6 = 2
00523 LA6_0 = self.input.LA(1)
00524
00525 if (LA6_0 == 47) :
00526 LA6_1 = self.input.LA(2)
00527
00528 if (LA6_1 == 47) :
00529 alt6 = 1
00530 elif (LA6_1 == 42) :
00531 alt6 = 2
00532 else:
00533 nvae = NoViableAltException("", 6, 1, self.input)
00534
00535 raise nvae
00536
00537 else:
00538 nvae = NoViableAltException("", 6, 0, self.input)
00539
00540 raise nvae
00541
00542 if alt6 == 1:
00543
00544 pass
00545 self.match("//")
00546
00547 while True:
00548 alt3 = 2
00549 LA3_0 = self.input.LA(1)
00550
00551 if ((0 <= LA3_0 <= 9) or (11 <= LA3_0 <= 12) or (14 <= LA3_0 <= 65535)) :
00552 alt3 = 1
00553
00554
00555 if alt3 == 1:
00556
00557 pass
00558 if (0 <= self.input.LA(1) <= 9) or (11 <= self.input.LA(1) <= 12) or (14 <= self.input.LA(1) <= 65535):
00559 self.input.consume()
00560 else:
00561 mse = MismatchedSetException(None, self.input)
00562 self.recover(mse)
00563 raise mse
00564
00565
00566
00567 else:
00568 break
00569
00570
00571
00572 alt4 = 2
00573 LA4_0 = self.input.LA(1)
00574
00575 if (LA4_0 == 13) :
00576 alt4 = 1
00577 if alt4 == 1:
00578
00579 pass
00580 self.match(13)
00581
00582
00583
00584 self.match(10)
00585
00586 _channel=HIDDEN;
00587
00588
00589
00590 elif alt6 == 2:
00591
00592 pass
00593 self.match("/*")
00594
00595 while True:
00596 alt5 = 2
00597 LA5_0 = self.input.LA(1)
00598
00599 if (LA5_0 == 42) :
00600 LA5_1 = self.input.LA(2)
00601
00602 if (LA5_1 == 47) :
00603 alt5 = 2
00604 elif ((0 <= LA5_1 <= 46) or (48 <= LA5_1 <= 65535)) :
00605 alt5 = 1
00606
00607
00608 elif ((0 <= LA5_0 <= 41) or (43 <= LA5_0 <= 65535)) :
00609 alt5 = 1
00610
00611
00612 if alt5 == 1:
00613
00614 pass
00615 self.matchAny()
00616
00617
00618 else:
00619 break
00620
00621
00622 self.match("*/")
00623
00624 _channel=HIDDEN;
00625
00626
00627
00628 self._state.type = _type
00629 self._state.channel = _channel
00630
00631 finally:
00632
00633 pass
00634
00635
00636
00637
00638
00639 def mTokens(self):
00640
00641 alt7 = 14
00642 alt7 = self.dfa7.predict(self.input)
00643 if alt7 == 1:
00644
00645 pass
00646 self.mWHITESPACE()
00647
00648
00649 elif alt7 == 2:
00650
00651 pass
00652 self.mATTRIBUTE()
00653
00654
00655 elif alt7 == 3:
00656
00657 pass
00658 self.mOPENBRACKET()
00659
00660
00661 elif alt7 == 4:
00662
00663 pass
00664 self.mCLOSEBRACKET()
00665
00666
00667 elif alt7 == 5:
00668
00669 pass
00670 self.mOPENPAREN()
00671
00672
00673 elif alt7 == 6:
00674
00675 pass
00676 self.mCLOSEPAREN()
00677
00678
00679 elif alt7 == 7:
00680
00681 pass
00682 self.mSEMICOLON()
00683
00684
00685 elif alt7 == 8:
00686
00687 pass
00688 self.mCOMMA()
00689
00690
00691 elif alt7 == 9:
00692
00693 pass
00694 self.mSLASH()
00695
00696
00697 elif alt7 == 10:
00698
00699 pass
00700 self.mINTERFACE()
00701
00702
00703 elif alt7 == 11:
00704
00705 pass
00706 self.mMESSAGE()
00707
00708
00709 elif alt7 == 12:
00710
00711 pass
00712 self.mRETURNS()
00713
00714
00715 elif alt7 == 13:
00716
00717 pass
00718 self.mID()
00719
00720
00721 elif alt7 == 14:
00722
00723 pass
00724 self.mCOMMENT()
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734 DFA7_eot = DFA.unpack(
00735 u"\2\uffff\1\15\6\uffff\1\20\3\15\1\uffff\1\15\2\uffff\13\15\1\40"
00736 u"\3\15\1\uffff\4\15\1\50\1\51\1\15\2\uffff\1\53\1\uffff"
00737 )
00738
00739 DFA7_eof = DFA.unpack(
00740 u"\54\uffff"
00741 )
00742
00743 DFA7_min = DFA.unpack(
00744 u"\1\11\1\uffff\1\165\6\uffff\1\52\1\156\2\145\1\uffff\1\155\2\uffff"
00745 u"\1\164\1\163\1\164\1\155\1\145\1\163\1\165\1\171\1\162\1\141\1"
00746 u"\162\1\60\1\146\1\147\1\156\1\uffff\1\141\1\145\1\163\1\143\2\60"
00747 u"\1\145\2\uffff\1\60\1\uffff"
00748 )
00749
00750 DFA7_max = DFA.unpack(
00751 u"\1\175\1\uffff\1\165\6\uffff\1\57\1\156\2\145\1\uffff\1\155\2\uffff"
00752 u"\1\164\1\163\1\164\1\155\1\145\1\163\1\165\1\171\1\162\1\141\1"
00753 u"\162\1\172\1\146\1\147\1\156\1\uffff\1\141\1\145\1\163\1\143\2"
00754 u"\172\1\145\2\uffff\1\172\1\uffff"
00755 )
00756
00757 DFA7_accept = DFA.unpack(
00758 u"\1\uffff\1\1\1\uffff\1\3\1\4\1\5\1\6\1\7\1\10\4\uffff\1\15\1\uffff"
00759 u"\1\16\1\11\17\uffff\1\2\7\uffff\1\13\1\14\1\uffff\1\12"
00760 )
00761
00762 DFA7_special = DFA.unpack(
00763 u"\54\uffff"
00764 )
00765
00766
00767 DFA7_transition = [
00768 DFA.unpack(u"\2\1\1\uffff\2\1\22\uffff\1\1\7\uffff\1\5\1\6\2\uffff"
00769 u"\1\10\2\uffff\1\11\13\uffff\1\7\5\uffff\32\15\4\uffff\1\15\1\uffff"
00770 u"\3\15\1\2\4\15\1\12\3\15\1\13\4\15\1\14\10\15\1\3\1\uffff\1\4"),
00771 DFA.unpack(u""),
00772 DFA.unpack(u"\1\16"),
00773 DFA.unpack(u""),
00774 DFA.unpack(u""),
00775 DFA.unpack(u""),
00776 DFA.unpack(u""),
00777 DFA.unpack(u""),
00778 DFA.unpack(u""),
00779 DFA.unpack(u"\1\17\4\uffff\1\17"),
00780 DFA.unpack(u"\1\21"),
00781 DFA.unpack(u"\1\22"),
00782 DFA.unpack(u"\1\23"),
00783 DFA.unpack(u""),
00784 DFA.unpack(u"\1\24"),
00785 DFA.unpack(u""),
00786 DFA.unpack(u""),
00787 DFA.unpack(u"\1\25"),
00788 DFA.unpack(u"\1\26"),
00789 DFA.unpack(u"\1\27"),
00790 DFA.unpack(u"\1\30"),
00791 DFA.unpack(u"\1\31"),
00792 DFA.unpack(u"\1\32"),
00793 DFA.unpack(u"\1\33"),
00794 DFA.unpack(u"\1\34"),
00795 DFA.unpack(u"\1\35"),
00796 DFA.unpack(u"\1\36"),
00797 DFA.unpack(u"\1\37"),
00798 DFA.unpack(u"\12\15\7\uffff\32\15\4\uffff\1\15\1\uffff\32\15"),
00799 DFA.unpack(u"\1\41"),
00800 DFA.unpack(u"\1\42"),
00801 DFA.unpack(u"\1\43"),
00802 DFA.unpack(u""),
00803 DFA.unpack(u"\1\44"),
00804 DFA.unpack(u"\1\45"),
00805 DFA.unpack(u"\1\46"),
00806 DFA.unpack(u"\1\47"),
00807 DFA.unpack(u"\12\15\7\uffff\32\15\4\uffff\1\15\1\uffff\32\15"),
00808 DFA.unpack(u"\12\15\7\uffff\32\15\4\uffff\1\15\1\uffff\32\15"),
00809 DFA.unpack(u"\1\52"),
00810 DFA.unpack(u""),
00811 DFA.unpack(u""),
00812 DFA.unpack(u"\12\15\7\uffff\32\15\4\uffff\1\15\1\uffff\32\15"),
00813 DFA.unpack(u"")
00814 ]
00815
00816
00817
00818 DFA7 = DFA
00819
00820
00821
00822
00823 def main(argv, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr):
00824 from antlr3.main import LexerMain
00825 main = LexerMain(InterfaceLexer)
00826 main.stdin = stdin
00827 main.stdout = stdout
00828 main.stderr = stderr
00829 main.execute(argv)
00830
00831
00832 if __name__ == '__main__':
00833 main(sys.argv)