PageRenderTime 55ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/antlr-3.4/runtime/CSharp3/Sources/Antlr3.Runtime.Test/BuildOptions/DebugGrammarLexer.cs

https://bitbucket.org/cyanogenmod/android_external_antlr
C# | 693 lines | 522 code | 97 blank | 74 comment | 19 complexity | e02770614c70e93e0bb6f4e8f42c9904 MD5 | raw file
  1. // $ANTLR 3.1.2 BuildOptions\\DebugGrammar.g3 2009-09-30 13:18:14
  2. // The variable 'variable' is assigned but its value is never used.
  3. #pragma warning disable 219
  4. // Unreachable code detected.
  5. #pragma warning disable 162
  6. using System.Collections.Generic;
  7. using Antlr.Runtime;
  8. using Stack = System.Collections.Generic.Stack<object>;
  9. using List = System.Collections.IList;
  10. using ArrayList = System.Collections.Generic.List<object>;
  11. [System.CodeDom.Compiler.GeneratedCode("ANTLR", "3.1.2")]
  12. [System.CLSCompliant(false)]
  13. public partial class DebugGrammarLexer : Lexer
  14. {
  15. public const int EOF=-1;
  16. public const int T__10=10;
  17. public const int T__11=11;
  18. public const int T__12=12;
  19. public const int T__13=13;
  20. public const int T__14=14;
  21. public const int T__15=15;
  22. public const int T__16=16;
  23. public const int T__17=17;
  24. public const int CALL=4;
  25. public const int FUNC=5;
  26. public const int ID=6;
  27. public const int INT=7;
  28. public const int NEWLINE=8;
  29. public const int WS=9;
  30. // delegates
  31. // delegators
  32. public DebugGrammarLexer() {}
  33. public DebugGrammarLexer( ICharStream input )
  34. : this( input, new RecognizerSharedState() )
  35. {
  36. }
  37. public DebugGrammarLexer( ICharStream input, RecognizerSharedState state )
  38. : base( input, state )
  39. {
  40. }
  41. public override string GrammarFileName { get { return "BuildOptions\\DebugGrammar.g3"; } }
  42. // $ANTLR start "T__10"
  43. private void mT__10()
  44. {
  45. try
  46. {
  47. int _type = T__10;
  48. int _channel = DefaultTokenChannel;
  49. // BuildOptions\\DebugGrammar.g3:7:9: ( '-' )
  50. // BuildOptions\\DebugGrammar.g3:7:9: '-'
  51. {
  52. Match('-');
  53. }
  54. state.type = _type;
  55. state.channel = _channel;
  56. }
  57. finally
  58. {
  59. }
  60. }
  61. // $ANTLR end "T__10"
  62. // $ANTLR start "T__11"
  63. private void mT__11()
  64. {
  65. try
  66. {
  67. int _type = T__11;
  68. int _channel = DefaultTokenChannel;
  69. // BuildOptions\\DebugGrammar.g3:8:9: ( '%' )
  70. // BuildOptions\\DebugGrammar.g3:8:9: '%'
  71. {
  72. Match('%');
  73. }
  74. state.type = _type;
  75. state.channel = _channel;
  76. }
  77. finally
  78. {
  79. }
  80. }
  81. // $ANTLR end "T__11"
  82. // $ANTLR start "T__12"
  83. private void mT__12()
  84. {
  85. try
  86. {
  87. int _type = T__12;
  88. int _channel = DefaultTokenChannel;
  89. // BuildOptions\\DebugGrammar.g3:9:9: ( '(' )
  90. // BuildOptions\\DebugGrammar.g3:9:9: '('
  91. {
  92. Match('(');
  93. }
  94. state.type = _type;
  95. state.channel = _channel;
  96. }
  97. finally
  98. {
  99. }
  100. }
  101. // $ANTLR end "T__12"
  102. // $ANTLR start "T__13"
  103. private void mT__13()
  104. {
  105. try
  106. {
  107. int _type = T__13;
  108. int _channel = DefaultTokenChannel;
  109. // BuildOptions\\DebugGrammar.g3:10:9: ( ')' )
  110. // BuildOptions\\DebugGrammar.g3:10:9: ')'
  111. {
  112. Match(')');
  113. }
  114. state.type = _type;
  115. state.channel = _channel;
  116. }
  117. finally
  118. {
  119. }
  120. }
  121. // $ANTLR end "T__13"
  122. // $ANTLR start "T__14"
  123. private void mT__14()
  124. {
  125. try
  126. {
  127. int _type = T__14;
  128. int _channel = DefaultTokenChannel;
  129. // BuildOptions\\DebugGrammar.g3:11:9: ( '*' )
  130. // BuildOptions\\DebugGrammar.g3:11:9: '*'
  131. {
  132. Match('*');
  133. }
  134. state.type = _type;
  135. state.channel = _channel;
  136. }
  137. finally
  138. {
  139. }
  140. }
  141. // $ANTLR end "T__14"
  142. // $ANTLR start "T__15"
  143. private void mT__15()
  144. {
  145. try
  146. {
  147. int _type = T__15;
  148. int _channel = DefaultTokenChannel;
  149. // BuildOptions\\DebugGrammar.g3:12:9: ( '/' )
  150. // BuildOptions\\DebugGrammar.g3:12:9: '/'
  151. {
  152. Match('/');
  153. }
  154. state.type = _type;
  155. state.channel = _channel;
  156. }
  157. finally
  158. {
  159. }
  160. }
  161. // $ANTLR end "T__15"
  162. // $ANTLR start "T__16"
  163. private void mT__16()
  164. {
  165. try
  166. {
  167. int _type = T__16;
  168. int _channel = DefaultTokenChannel;
  169. // BuildOptions\\DebugGrammar.g3:13:9: ( '+' )
  170. // BuildOptions\\DebugGrammar.g3:13:9: '+'
  171. {
  172. Match('+');
  173. }
  174. state.type = _type;
  175. state.channel = _channel;
  176. }
  177. finally
  178. {
  179. }
  180. }
  181. // $ANTLR end "T__16"
  182. // $ANTLR start "T__17"
  183. private void mT__17()
  184. {
  185. try
  186. {
  187. int _type = T__17;
  188. int _channel = DefaultTokenChannel;
  189. // BuildOptions\\DebugGrammar.g3:14:9: ( '=' )
  190. // BuildOptions\\DebugGrammar.g3:14:9: '='
  191. {
  192. Match('=');
  193. }
  194. state.type = _type;
  195. state.channel = _channel;
  196. }
  197. finally
  198. {
  199. }
  200. }
  201. // $ANTLR end "T__17"
  202. // $ANTLR start "ID"
  203. private void mID()
  204. {
  205. try
  206. {
  207. int _type = ID;
  208. int _channel = DefaultTokenChannel;
  209. // BuildOptions\\DebugGrammar.g3:88:9: ( ( 'a' .. 'z' | 'A' .. 'Z' )+ )
  210. // BuildOptions\\DebugGrammar.g3:88:9: ( 'a' .. 'z' | 'A' .. 'Z' )+
  211. {
  212. // BuildOptions\\DebugGrammar.g3:88:9: ( 'a' .. 'z' | 'A' .. 'Z' )+
  213. int cnt1=0;
  214. for ( ; ; )
  215. {
  216. int alt1=2;
  217. int LA1_0 = input.LA(1);
  218. if ( ((LA1_0>='A' && LA1_0<='Z')||(LA1_0>='a' && LA1_0<='z')) )
  219. {
  220. alt1=1;
  221. }
  222. switch ( alt1 )
  223. {
  224. case 1:
  225. // BuildOptions\\DebugGrammar.g3:
  226. {
  227. input.Consume();
  228. }
  229. break;
  230. default:
  231. if ( cnt1 >= 1 )
  232. goto loop1;
  233. EarlyExitException eee1 = new EarlyExitException( 1, input );
  234. throw eee1;
  235. }
  236. cnt1++;
  237. }
  238. loop1:
  239. ;
  240. }
  241. state.type = _type;
  242. state.channel = _channel;
  243. }
  244. finally
  245. {
  246. }
  247. }
  248. // $ANTLR end "ID"
  249. // $ANTLR start "INT"
  250. private void mINT()
  251. {
  252. try
  253. {
  254. int _type = INT;
  255. int _channel = DefaultTokenChannel;
  256. // BuildOptions\\DebugGrammar.g3:91:9: ( ( '0' .. '9' )+ )
  257. // BuildOptions\\DebugGrammar.g3:91:9: ( '0' .. '9' )+
  258. {
  259. // BuildOptions\\DebugGrammar.g3:91:9: ( '0' .. '9' )+
  260. int cnt2=0;
  261. for ( ; ; )
  262. {
  263. int alt2=2;
  264. int LA2_0 = input.LA(1);
  265. if ( ((LA2_0>='0' && LA2_0<='9')) )
  266. {
  267. alt2=1;
  268. }
  269. switch ( alt2 )
  270. {
  271. case 1:
  272. // BuildOptions\\DebugGrammar.g3:
  273. {
  274. input.Consume();
  275. }
  276. break;
  277. default:
  278. if ( cnt2 >= 1 )
  279. goto loop2;
  280. EarlyExitException eee2 = new EarlyExitException( 2, input );
  281. throw eee2;
  282. }
  283. cnt2++;
  284. }
  285. loop2:
  286. ;
  287. }
  288. state.type = _type;
  289. state.channel = _channel;
  290. }
  291. finally
  292. {
  293. }
  294. }
  295. // $ANTLR end "INT"
  296. // $ANTLR start "NEWLINE"
  297. private void mNEWLINE()
  298. {
  299. try
  300. {
  301. int _type = NEWLINE;
  302. int _channel = DefaultTokenChannel;
  303. // BuildOptions\\DebugGrammar.g3:95:7: ( ( '\\r' )? '\\n' )
  304. // BuildOptions\\DebugGrammar.g3:95:7: ( '\\r' )? '\\n'
  305. {
  306. // BuildOptions\\DebugGrammar.g3:95:7: ( '\\r' )?
  307. int alt3=2;
  308. int LA3_0 = input.LA(1);
  309. if ( (LA3_0=='\r') )
  310. {
  311. alt3=1;
  312. }
  313. switch ( alt3 )
  314. {
  315. case 1:
  316. // BuildOptions\\DebugGrammar.g3:95:0: '\\r'
  317. {
  318. Match('\r');
  319. }
  320. break;
  321. }
  322. Match('\n');
  323. }
  324. state.type = _type;
  325. state.channel = _channel;
  326. }
  327. finally
  328. {
  329. }
  330. }
  331. // $ANTLR end "NEWLINE"
  332. // $ANTLR start "WS"
  333. private void mWS()
  334. {
  335. try
  336. {
  337. int _type = WS;
  338. int _channel = DefaultTokenChannel;
  339. // BuildOptions\\DebugGrammar.g3:98:9: ( ( ' ' | '\\t' )+ )
  340. // BuildOptions\\DebugGrammar.g3:98:9: ( ' ' | '\\t' )+
  341. {
  342. // BuildOptions\\DebugGrammar.g3:98:9: ( ' ' | '\\t' )+
  343. int cnt4=0;
  344. for ( ; ; )
  345. {
  346. int alt4=2;
  347. int LA4_0 = input.LA(1);
  348. if ( (LA4_0=='\t'||LA4_0==' ') )
  349. {
  350. alt4=1;
  351. }
  352. switch ( alt4 )
  353. {
  354. case 1:
  355. // BuildOptions\\DebugGrammar.g3:
  356. {
  357. input.Consume();
  358. }
  359. break;
  360. default:
  361. if ( cnt4 >= 1 )
  362. goto loop4;
  363. EarlyExitException eee4 = new EarlyExitException( 4, input );
  364. throw eee4;
  365. }
  366. cnt4++;
  367. }
  368. loop4:
  369. ;
  370. Skip();
  371. }
  372. state.type = _type;
  373. state.channel = _channel;
  374. }
  375. finally
  376. {
  377. }
  378. }
  379. // $ANTLR end "WS"
  380. public override void mTokens()
  381. {
  382. // BuildOptions\\DebugGrammar.g3:1:10: ( T__10 | T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | ID | INT | NEWLINE | WS )
  383. int alt5=12;
  384. switch ( input.LA(1) )
  385. {
  386. case '-':
  387. {
  388. alt5=1;
  389. }
  390. break;
  391. case '%':
  392. {
  393. alt5=2;
  394. }
  395. break;
  396. case '(':
  397. {
  398. alt5=3;
  399. }
  400. break;
  401. case ')':
  402. {
  403. alt5=4;
  404. }
  405. break;
  406. case '*':
  407. {
  408. alt5=5;
  409. }
  410. break;
  411. case '/':
  412. {
  413. alt5=6;
  414. }
  415. break;
  416. case '+':
  417. {
  418. alt5=7;
  419. }
  420. break;
  421. case '=':
  422. {
  423. alt5=8;
  424. }
  425. break;
  426. case 'A':
  427. case 'B':
  428. case 'C':
  429. case 'D':
  430. case 'E':
  431. case 'F':
  432. case 'G':
  433. case 'H':
  434. case 'I':
  435. case 'J':
  436. case 'K':
  437. case 'L':
  438. case 'M':
  439. case 'N':
  440. case 'O':
  441. case 'P':
  442. case 'Q':
  443. case 'R':
  444. case 'S':
  445. case 'T':
  446. case 'U':
  447. case 'V':
  448. case 'W':
  449. case 'X':
  450. case 'Y':
  451. case 'Z':
  452. case 'a':
  453. case 'b':
  454. case 'c':
  455. case 'd':
  456. case 'e':
  457. case 'f':
  458. case 'g':
  459. case 'h':
  460. case 'i':
  461. case 'j':
  462. case 'k':
  463. case 'l':
  464. case 'm':
  465. case 'n':
  466. case 'o':
  467. case 'p':
  468. case 'q':
  469. case 'r':
  470. case 's':
  471. case 't':
  472. case 'u':
  473. case 'v':
  474. case 'w':
  475. case 'x':
  476. case 'y':
  477. case 'z':
  478. {
  479. alt5=9;
  480. }
  481. break;
  482. case '0':
  483. case '1':
  484. case '2':
  485. case '3':
  486. case '4':
  487. case '5':
  488. case '6':
  489. case '7':
  490. case '8':
  491. case '9':
  492. {
  493. alt5=10;
  494. }
  495. break;
  496. case '\n':
  497. case '\r':
  498. {
  499. alt5=11;
  500. }
  501. break;
  502. case '\t':
  503. case ' ':
  504. {
  505. alt5=12;
  506. }
  507. break;
  508. default:
  509. {
  510. NoViableAltException nvae = new NoViableAltException("", 5, 0, input);
  511. throw nvae;
  512. }
  513. }
  514. switch ( alt5 )
  515. {
  516. case 1:
  517. // BuildOptions\\DebugGrammar.g3:1:10: T__10
  518. {
  519. mT__10();
  520. }
  521. break;
  522. case 2:
  523. // BuildOptions\\DebugGrammar.g3:1:16: T__11
  524. {
  525. mT__11();
  526. }
  527. break;
  528. case 3:
  529. // BuildOptions\\DebugGrammar.g3:1:22: T__12
  530. {
  531. mT__12();
  532. }
  533. break;
  534. case 4:
  535. // BuildOptions\\DebugGrammar.g3:1:28: T__13
  536. {
  537. mT__13();
  538. }
  539. break;
  540. case 5:
  541. // BuildOptions\\DebugGrammar.g3:1:34: T__14
  542. {
  543. mT__14();
  544. }
  545. break;
  546. case 6:
  547. // BuildOptions\\DebugGrammar.g3:1:40: T__15
  548. {
  549. mT__15();
  550. }
  551. break;
  552. case 7:
  553. // BuildOptions\\DebugGrammar.g3:1:46: T__16
  554. {
  555. mT__16();
  556. }
  557. break;
  558. case 8:
  559. // BuildOptions\\DebugGrammar.g3:1:52: T__17
  560. {
  561. mT__17();
  562. }
  563. break;
  564. case 9:
  565. // BuildOptions\\DebugGrammar.g3:1:58: ID
  566. {
  567. mID();
  568. }
  569. break;
  570. case 10:
  571. // BuildOptions\\DebugGrammar.g3:1:61: INT
  572. {
  573. mINT();
  574. }
  575. break;
  576. case 11:
  577. // BuildOptions\\DebugGrammar.g3:1:65: NEWLINE
  578. {
  579. mNEWLINE();
  580. }
  581. break;
  582. case 12:
  583. // BuildOptions\\DebugGrammar.g3:1:73: WS
  584. {
  585. mWS();
  586. }
  587. break;
  588. }
  589. }
  590. #region DFA
  591. protected override void InitDFAs()
  592. {
  593. base.InitDFAs();
  594. }
  595. #endregion
  596. }