PageRenderTime 56ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/runtime/CSharp3/Sources/Antlr3.Runtime.Test/BuildOptions/DebugGrammarParser.cs

https://bitbucket.org/jwalton/antlr3
C# | 1556 lines | 1151 code | 290 blank | 115 comment | 60 complexity | 6e7330dc871d2668209402e571e96751 MD5 | raw file
  1. // $ANTLR 3.1.2 BuildOptions\\DebugGrammar.g3 2009-09-30 13:18:13
  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. using Antlr.Runtime.Debug;
  12. using IOException = System.IO.IOException;
  13. using Antlr.Runtime.Tree;
  14. using RewriteRuleITokenStream = Antlr.Runtime.Tree.RewriteRuleTokenStream;
  15. [System.CodeDom.Compiler.GeneratedCode("ANTLR", "3.1.2")]
  16. [System.CLSCompliant(false)]
  17. public partial class DebugGrammarParser : DebugParser
  18. {
  19. internal static readonly string[] tokenNames = new string[] {
  20. "<invalid>", "<EOR>", "<DOWN>", "<UP>", "CALL", "FUNC", "ID", "INT", "NEWLINE", "WS", "'-'", "'%'", "'('", "')'", "'*'", "'/'", "'+'", "'='"
  21. };
  22. public const int EOF=-1;
  23. public const int T__10=10;
  24. public const int T__11=11;
  25. public const int T__12=12;
  26. public const int T__13=13;
  27. public const int T__14=14;
  28. public const int T__15=15;
  29. public const int T__16=16;
  30. public const int T__17=17;
  31. public const int CALL=4;
  32. public const int FUNC=5;
  33. public const int ID=6;
  34. public const int INT=7;
  35. public const int NEWLINE=8;
  36. public const int WS=9;
  37. // delegates
  38. // delegators
  39. public static readonly string[] ruleNames =
  40. new string[]
  41. {
  42. "invalidRule", "atom", "expr", "formalPar", "func", "multExpr", "prog",
  43. "stat"
  44. };
  45. int ruleLevel = 0;
  46. public virtual int RuleLevel { get { return ruleLevel; } }
  47. public virtual void IncRuleLevel() { ruleLevel++; }
  48. public virtual void DecRuleLevel() { ruleLevel--; }
  49. public DebugGrammarParser( ITokenStream input )
  50. : this( input, DebugEventSocketProxy.DefaultDebuggerPort, new RecognizerSharedState() )
  51. {
  52. }
  53. public DebugGrammarParser( ITokenStream input, int port, RecognizerSharedState state )
  54. : base( input, state )
  55. {
  56. InitializeTreeAdaptor();
  57. if ( TreeAdaptor == null )
  58. TreeAdaptor = new CommonTreeAdaptor();
  59. DebugEventSocketProxy proxy = new DebugEventSocketProxy( this, port, adaptor );
  60. DebugListener = proxy;
  61. TokenStream = new DebugTokenStream( input, proxy );
  62. try
  63. {
  64. proxy.Handshake();
  65. }
  66. catch ( IOException ioe )
  67. {
  68. ReportError( ioe );
  69. }
  70. ITreeAdaptor adap = new CommonTreeAdaptor();
  71. TreeAdaptor = adap;
  72. proxy.TreeAdaptor = adap;
  73. }
  74. public DebugGrammarParser( ITokenStream input, IDebugEventListener dbg )
  75. : base( input, dbg )
  76. {
  77. InitializeTreeAdaptor();
  78. if ( TreeAdaptor == null )
  79. TreeAdaptor = new CommonTreeAdaptor();
  80. ITreeAdaptor adap = new CommonTreeAdaptor();
  81. TreeAdaptor = adap;
  82. }
  83. protected virtual bool EvalPredicate( bool result, string predicate )
  84. {
  85. dbg.SemanticPredicate( result, predicate );
  86. return result;
  87. }
  88. // Implement this function in your helper file to use a custom tree adaptor
  89. partial void InitializeTreeAdaptor();
  90. protected DebugTreeAdaptor adaptor;
  91. public ITreeAdaptor TreeAdaptor
  92. {
  93. get
  94. {
  95. return adaptor;
  96. }
  97. set
  98. {
  99. this.adaptor = new DebugTreeAdaptor(dbg,adaptor);
  100. }
  101. }
  102. public override string[] TokenNames { get { return DebugGrammarParser.tokenNames; } }
  103. public override string GrammarFileName { get { return "BuildOptions\\DebugGrammar.g3"; } }
  104. #region Rules
  105. public class prog_return : ParserRuleReturnScope
  106. {
  107. internal CommonTree tree;
  108. public override object Tree { get { return tree; } }
  109. }
  110. // $ANTLR start "prog"
  111. // BuildOptions\\DebugGrammar.g3:50:0: prog : ( stat )* ;
  112. private DebugGrammarParser.prog_return prog( )
  113. {
  114. DebugGrammarParser.prog_return retval = new DebugGrammarParser.prog_return();
  115. retval.start = input.LT(1);
  116. CommonTree root_0 = null;
  117. DebugGrammarParser.stat_return stat1 = default(DebugGrammarParser.stat_return);
  118. try
  119. {
  120. dbg.EnterRule( GrammarFileName, "prog" );
  121. if ( RuleLevel == 0 )
  122. {
  123. dbg.Commence();
  124. }
  125. IncRuleLevel();
  126. dbg.Location( 50, -1 );
  127. try
  128. {
  129. // BuildOptions\\DebugGrammar.g3:50:7: ( ( stat )* )
  130. dbg.EnterAlt( 1 );
  131. // BuildOptions\\DebugGrammar.g3:50:7: ( stat )*
  132. {
  133. root_0 = (CommonTree)adaptor.Nil();
  134. dbg.Location( 50, 6 );
  135. // BuildOptions\\DebugGrammar.g3:50:7: ( stat )*
  136. try
  137. {
  138. dbg.EnterSubRule( 1 );
  139. for ( ; ; )
  140. {
  141. int alt1=2;
  142. try
  143. {
  144. dbg.EnterDecision( 1 );
  145. int LA1_0 = input.LA(1);
  146. if ( ((LA1_0>=ID && LA1_0<=NEWLINE)||LA1_0==12) )
  147. {
  148. alt1=1;
  149. }
  150. }
  151. finally
  152. {
  153. dbg.ExitDecision( 1 );
  154. }
  155. switch ( alt1 )
  156. {
  157. case 1:
  158. dbg.EnterAlt( 1 );
  159. // BuildOptions\\DebugGrammar.g3:50:9: stat
  160. {
  161. dbg.Location( 50, 8 );
  162. PushFollow(Follow._stat_in_prog53);
  163. stat1=stat();
  164. state._fsp--;
  165. adaptor.AddChild(root_0, stat1.Tree);
  166. }
  167. break;
  168. default:
  169. goto loop1;
  170. }
  171. }
  172. loop1:
  173. ;
  174. }
  175. finally
  176. {
  177. dbg.ExitSubRule( 1 );
  178. }
  179. }
  180. retval.stop = input.LT(-1);
  181. retval.tree = (CommonTree)adaptor.RulePostProcessing(root_0);
  182. adaptor.SetTokenBoundaries(retval.tree, retval.start, retval.stop);
  183. }
  184. catch ( RecognitionException re )
  185. {
  186. ReportError(re);
  187. Recover(input,re);
  188. retval.tree = (CommonTree)adaptor.ErrorNode(input, retval.start, input.LT(-1), re);
  189. }
  190. finally
  191. {
  192. }
  193. dbg.Location(51, 4);
  194. }
  195. finally
  196. {
  197. dbg.ExitRule( GrammarFileName, "prog" );
  198. DecRuleLevel();
  199. if ( RuleLevel == 0 )
  200. {
  201. dbg.Terminate();
  202. }
  203. }
  204. return retval;
  205. }
  206. // $ANTLR end "prog"
  207. public class stat_return : ParserRuleReturnScope
  208. {
  209. internal CommonTree tree;
  210. public override object Tree { get { return tree; } }
  211. }
  212. // $ANTLR start "stat"
  213. // BuildOptions\\DebugGrammar.g3:53:0: stat : ( expr NEWLINE -> expr | ID '=' expr NEWLINE -> ^( '=' ID expr ) | func NEWLINE -> func | NEWLINE ->);
  214. private DebugGrammarParser.stat_return stat( )
  215. {
  216. DebugGrammarParser.stat_return retval = new DebugGrammarParser.stat_return();
  217. retval.start = input.LT(1);
  218. CommonTree root_0 = null;
  219. IToken NEWLINE3=null;
  220. IToken ID4=null;
  221. IToken char_literal5=null;
  222. IToken NEWLINE7=null;
  223. IToken NEWLINE9=null;
  224. IToken NEWLINE10=null;
  225. DebugGrammarParser.expr_return expr2 = default(DebugGrammarParser.expr_return);
  226. DebugGrammarParser.expr_return expr6 = default(DebugGrammarParser.expr_return);
  227. DebugGrammarParser.func_return func8 = default(DebugGrammarParser.func_return);
  228. CommonTree NEWLINE3_tree=null;
  229. CommonTree ID4_tree=null;
  230. CommonTree char_literal5_tree=null;
  231. CommonTree NEWLINE7_tree=null;
  232. CommonTree NEWLINE9_tree=null;
  233. CommonTree NEWLINE10_tree=null;
  234. RewriteRuleITokenStream stream_NEWLINE=new RewriteRuleITokenStream(adaptor,"token NEWLINE");
  235. RewriteRuleITokenStream stream_ID=new RewriteRuleITokenStream(adaptor,"token ID");
  236. RewriteRuleITokenStream stream_17=new RewriteRuleITokenStream(adaptor,"token 17");
  237. RewriteRuleSubtreeStream stream_expr=new RewriteRuleSubtreeStream(adaptor,"rule expr");
  238. RewriteRuleSubtreeStream stream_func=new RewriteRuleSubtreeStream(adaptor,"rule func");
  239. try
  240. {
  241. dbg.EnterRule( GrammarFileName, "stat" );
  242. if ( RuleLevel == 0 )
  243. {
  244. dbg.Commence();
  245. }
  246. IncRuleLevel();
  247. dbg.Location( 53, -1 );
  248. try
  249. {
  250. // BuildOptions\\DebugGrammar.g3:53:9: ( expr NEWLINE -> expr | ID '=' expr NEWLINE -> ^( '=' ID expr ) | func NEWLINE -> func | NEWLINE ->)
  251. int alt2=4;
  252. try
  253. {
  254. dbg.EnterDecision( 2 );
  255. try
  256. {
  257. isCyclicDecision = true;
  258. alt2 = dfa2.Predict(input);
  259. }
  260. catch ( NoViableAltException nvae )
  261. {
  262. dbg.RecognitionException( nvae );
  263. throw nvae;
  264. }
  265. }
  266. finally
  267. {
  268. dbg.ExitDecision( 2 );
  269. }
  270. switch ( alt2 )
  271. {
  272. case 1:
  273. dbg.EnterAlt( 1 );
  274. // BuildOptions\\DebugGrammar.g3:53:9: expr NEWLINE
  275. {
  276. dbg.Location( 53, 8 );
  277. PushFollow(Follow._expr_in_stat70);
  278. expr2=expr();
  279. state._fsp--;
  280. stream_expr.Add(expr2.Tree);
  281. dbg.Location( 53, 13 );
  282. NEWLINE3=(IToken)Match(input,NEWLINE,Follow._NEWLINE_in_stat72);
  283. stream_NEWLINE.Add(NEWLINE3);
  284. {
  285. // AST REWRITE
  286. // elements: expr
  287. // token labels:
  288. // rule labels: retval
  289. // token list labels:
  290. // rule list labels:
  291. // wildcard labels:
  292. retval.tree = root_0;
  293. RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
  294. root_0 = (CommonTree)adaptor.Nil();
  295. // 53:41: -> expr
  296. {
  297. dbg.Location( 53, 43 );
  298. adaptor.AddChild(root_0, stream_expr.NextTree());
  299. }
  300. retval.tree = root_0;
  301. }
  302. }
  303. break;
  304. case 2:
  305. dbg.EnterAlt( 2 );
  306. // BuildOptions\\DebugGrammar.g3:54:9: ID '=' expr NEWLINE
  307. {
  308. dbg.Location( 54, 8 );
  309. ID4=(IToken)Match(input,ID,Follow._ID_in_stat105);
  310. stream_ID.Add(ID4);
  311. dbg.Location( 54, 11 );
  312. char_literal5=(IToken)Match(input,17,Follow._17_in_stat107);
  313. stream_17.Add(char_literal5);
  314. dbg.Location( 54, 15 );
  315. PushFollow(Follow._expr_in_stat109);
  316. expr6=expr();
  317. state._fsp--;
  318. stream_expr.Add(expr6.Tree);
  319. dbg.Location( 54, 20 );
  320. NEWLINE7=(IToken)Match(input,NEWLINE,Follow._NEWLINE_in_stat111);
  321. stream_NEWLINE.Add(NEWLINE7);
  322. {
  323. // AST REWRITE
  324. // elements: 17, ID, expr
  325. // token labels:
  326. // rule labels: retval
  327. // token list labels:
  328. // rule list labels:
  329. // wildcard labels:
  330. retval.tree = root_0;
  331. RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
  332. root_0 = (CommonTree)adaptor.Nil();
  333. // 54:41: -> ^( '=' ID expr )
  334. {
  335. dbg.Location( 54, 43 );
  336. // BuildOptions\\DebugGrammar.g3:54:44: ^( '=' ID expr )
  337. {
  338. CommonTree root_1 = (CommonTree)adaptor.Nil();
  339. dbg.Location( 54, 45 );
  340. root_1 = (CommonTree)adaptor.BecomeRoot(stream_17.NextNode(), root_1);
  341. dbg.Location( 54, 49 );
  342. adaptor.AddChild(root_1, stream_ID.NextNode());
  343. dbg.Location( 54, 52 );
  344. adaptor.AddChild(root_1, stream_expr.NextTree());
  345. adaptor.AddChild(root_0, root_1);
  346. }
  347. }
  348. retval.tree = root_0;
  349. }
  350. }
  351. break;
  352. case 3:
  353. dbg.EnterAlt( 3 );
  354. // BuildOptions\\DebugGrammar.g3:55:9: func NEWLINE
  355. {
  356. dbg.Location( 55, 8 );
  357. PushFollow(Follow._func_in_stat143);
  358. func8=func();
  359. state._fsp--;
  360. stream_func.Add(func8.Tree);
  361. dbg.Location( 55, 13 );
  362. NEWLINE9=(IToken)Match(input,NEWLINE,Follow._NEWLINE_in_stat145);
  363. stream_NEWLINE.Add(NEWLINE9);
  364. {
  365. // AST REWRITE
  366. // elements: func
  367. // token labels:
  368. // rule labels: retval
  369. // token list labels:
  370. // rule list labels:
  371. // wildcard labels:
  372. retval.tree = root_0;
  373. RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
  374. root_0 = (CommonTree)adaptor.Nil();
  375. // 55:41: -> func
  376. {
  377. dbg.Location( 55, 43 );
  378. adaptor.AddChild(root_0, stream_func.NextTree());
  379. }
  380. retval.tree = root_0;
  381. }
  382. }
  383. break;
  384. case 4:
  385. dbg.EnterAlt( 4 );
  386. // BuildOptions\\DebugGrammar.g3:56:9: NEWLINE
  387. {
  388. dbg.Location( 56, 8 );
  389. NEWLINE10=(IToken)Match(input,NEWLINE,Follow._NEWLINE_in_stat178);
  390. stream_NEWLINE.Add(NEWLINE10);
  391. {
  392. // AST REWRITE
  393. // elements:
  394. // token labels:
  395. // rule labels: retval
  396. // token list labels:
  397. // rule list labels:
  398. // wildcard labels:
  399. retval.tree = root_0;
  400. RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
  401. root_0 = (CommonTree)adaptor.Nil();
  402. // 56:41: ->
  403. {
  404. dbg.Location( 57, 4 );
  405. root_0 = null;
  406. }
  407. retval.tree = root_0;
  408. }
  409. }
  410. break;
  411. }
  412. retval.stop = input.LT(-1);
  413. retval.tree = (CommonTree)adaptor.RulePostProcessing(root_0);
  414. adaptor.SetTokenBoundaries(retval.tree, retval.start, retval.stop);
  415. }
  416. catch ( RecognitionException re )
  417. {
  418. ReportError(re);
  419. Recover(input,re);
  420. retval.tree = (CommonTree)adaptor.ErrorNode(input, retval.start, input.LT(-1), re);
  421. }
  422. finally
  423. {
  424. }
  425. dbg.Location(57, 4);
  426. }
  427. finally
  428. {
  429. dbg.ExitRule( GrammarFileName, "stat" );
  430. DecRuleLevel();
  431. if ( RuleLevel == 0 )
  432. {
  433. dbg.Terminate();
  434. }
  435. }
  436. return retval;
  437. }
  438. // $ANTLR end "stat"
  439. public class func_return : ParserRuleReturnScope
  440. {
  441. internal CommonTree tree;
  442. public override object Tree { get { return tree; } }
  443. }
  444. // $ANTLR start "func"
  445. // BuildOptions\\DebugGrammar.g3:59:0: func : ID '(' formalPar ')' '=' expr -> ^( FUNC ID formalPar expr ) ;
  446. private DebugGrammarParser.func_return func( )
  447. {
  448. DebugGrammarParser.func_return retval = new DebugGrammarParser.func_return();
  449. retval.start = input.LT(1);
  450. CommonTree root_0 = null;
  451. IToken ID11=null;
  452. IToken char_literal12=null;
  453. IToken char_literal14=null;
  454. IToken char_literal15=null;
  455. DebugGrammarParser.formalPar_return formalPar13 = default(DebugGrammarParser.formalPar_return);
  456. DebugGrammarParser.expr_return expr16 = default(DebugGrammarParser.expr_return);
  457. CommonTree ID11_tree=null;
  458. CommonTree char_literal12_tree=null;
  459. CommonTree char_literal14_tree=null;
  460. CommonTree char_literal15_tree=null;
  461. RewriteRuleITokenStream stream_ID=new RewriteRuleITokenStream(adaptor,"token ID");
  462. RewriteRuleITokenStream stream_12=new RewriteRuleITokenStream(adaptor,"token 12");
  463. RewriteRuleITokenStream stream_13=new RewriteRuleITokenStream(adaptor,"token 13");
  464. RewriteRuleITokenStream stream_17=new RewriteRuleITokenStream(adaptor,"token 17");
  465. RewriteRuleSubtreeStream stream_formalPar=new RewriteRuleSubtreeStream(adaptor,"rule formalPar");
  466. RewriteRuleSubtreeStream stream_expr=new RewriteRuleSubtreeStream(adaptor,"rule expr");
  467. try
  468. {
  469. dbg.EnterRule( GrammarFileName, "func" );
  470. if ( RuleLevel == 0 )
  471. {
  472. dbg.Commence();
  473. }
  474. IncRuleLevel();
  475. dbg.Location( 59, -1 );
  476. try
  477. {
  478. // BuildOptions\\DebugGrammar.g3:59:9: ( ID '(' formalPar ')' '=' expr -> ^( FUNC ID formalPar expr ) )
  479. dbg.EnterAlt( 1 );
  480. // BuildOptions\\DebugGrammar.g3:59:9: ID '(' formalPar ')' '=' expr
  481. {
  482. dbg.Location( 59, 8 );
  483. ID11=(IToken)Match(input,ID,Follow._ID_in_func219);
  484. stream_ID.Add(ID11);
  485. dbg.Location( 59, 12 );
  486. char_literal12=(IToken)Match(input,12,Follow._12_in_func222);
  487. stream_12.Add(char_literal12);
  488. dbg.Location( 59, 16 );
  489. PushFollow(Follow._formalPar_in_func224);
  490. formalPar13=formalPar();
  491. state._fsp--;
  492. stream_formalPar.Add(formalPar13.Tree);
  493. dbg.Location( 59, 26 );
  494. char_literal14=(IToken)Match(input,13,Follow._13_in_func226);
  495. stream_13.Add(char_literal14);
  496. dbg.Location( 59, 30 );
  497. char_literal15=(IToken)Match(input,17,Follow._17_in_func228);
  498. stream_17.Add(char_literal15);
  499. dbg.Location( 59, 34 );
  500. PushFollow(Follow._expr_in_func230);
  501. expr16=expr();
  502. state._fsp--;
  503. stream_expr.Add(expr16.Tree);
  504. {
  505. // AST REWRITE
  506. // elements: ID, formalPar, expr
  507. // token labels:
  508. // rule labels: retval
  509. // token list labels:
  510. // rule list labels:
  511. // wildcard labels:
  512. retval.tree = root_0;
  513. RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
  514. root_0 = (CommonTree)adaptor.Nil();
  515. // 59:41: -> ^( FUNC ID formalPar expr )
  516. {
  517. dbg.Location( 59, 43 );
  518. // BuildOptions\\DebugGrammar.g3:59:44: ^( FUNC ID formalPar expr )
  519. {
  520. CommonTree root_1 = (CommonTree)adaptor.Nil();
  521. dbg.Location( 59, 45 );
  522. root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(FUNC, "FUNC"), root_1);
  523. dbg.Location( 59, 50 );
  524. adaptor.AddChild(root_1, stream_ID.NextNode());
  525. dbg.Location( 59, 53 );
  526. adaptor.AddChild(root_1, stream_formalPar.NextTree());
  527. dbg.Location( 59, 63 );
  528. adaptor.AddChild(root_1, stream_expr.NextTree());
  529. adaptor.AddChild(root_0, root_1);
  530. }
  531. }
  532. retval.tree = root_0;
  533. }
  534. }
  535. retval.stop = input.LT(-1);
  536. retval.tree = (CommonTree)adaptor.RulePostProcessing(root_0);
  537. adaptor.SetTokenBoundaries(retval.tree, retval.start, retval.stop);
  538. }
  539. catch ( RecognitionException re )
  540. {
  541. ReportError(re);
  542. Recover(input,re);
  543. retval.tree = (CommonTree)adaptor.ErrorNode(input, retval.start, input.LT(-1), re);
  544. }
  545. finally
  546. {
  547. functionDefinitions.Add(((CommonTree)retval.Tree));
  548. }
  549. dbg.Location(60, 4);
  550. }
  551. finally
  552. {
  553. dbg.ExitRule( GrammarFileName, "func" );
  554. DecRuleLevel();
  555. if ( RuleLevel == 0 )
  556. {
  557. dbg.Terminate();
  558. }
  559. }
  560. return retval;
  561. }
  562. // $ANTLR end "func"
  563. public class formalPar_return : ParserRuleReturnScope
  564. {
  565. internal CommonTree tree;
  566. public override object Tree { get { return tree; } }
  567. }
  568. // $ANTLR start "formalPar"
  569. // BuildOptions\\DebugGrammar.g3:65:0: formalPar : ( ID | INT );
  570. private DebugGrammarParser.formalPar_return formalPar( )
  571. {
  572. DebugGrammarParser.formalPar_return retval = new DebugGrammarParser.formalPar_return();
  573. retval.start = input.LT(1);
  574. CommonTree root_0 = null;
  575. IToken set17=null;
  576. CommonTree set17_tree=null;
  577. try
  578. {
  579. dbg.EnterRule( GrammarFileName, "formalPar" );
  580. if ( RuleLevel == 0 )
  581. {
  582. dbg.Commence();
  583. }
  584. IncRuleLevel();
  585. dbg.Location( 65, -1 );
  586. try
  587. {
  588. // BuildOptions\\DebugGrammar.g3:66:9: ( ID | INT )
  589. dbg.EnterAlt( 1 );
  590. // BuildOptions\\DebugGrammar.g3:
  591. {
  592. root_0 = (CommonTree)adaptor.Nil();
  593. dbg.Location( 66, 8 );
  594. set17=(IToken)input.LT(1);
  595. if ( (input.LA(1)>=ID && input.LA(1)<=INT) )
  596. {
  597. input.Consume();
  598. adaptor.AddChild(root_0, (CommonTree)adaptor.Create(set17));
  599. state.errorRecovery=false;
  600. }
  601. else
  602. {
  603. MismatchedSetException mse = new MismatchedSetException(null,input);
  604. dbg.RecognitionException( mse );
  605. throw mse;
  606. }
  607. }
  608. retval.stop = input.LT(-1);
  609. retval.tree = (CommonTree)adaptor.RulePostProcessing(root_0);
  610. adaptor.SetTokenBoundaries(retval.tree, retval.start, retval.stop);
  611. }
  612. catch ( RecognitionException re )
  613. {
  614. ReportError(re);
  615. Recover(input,re);
  616. retval.tree = (CommonTree)adaptor.ErrorNode(input, retval.start, input.LT(-1), re);
  617. }
  618. finally
  619. {
  620. }
  621. dbg.Location(68, 1);
  622. }
  623. finally
  624. {
  625. dbg.ExitRule( GrammarFileName, "formalPar" );
  626. DecRuleLevel();
  627. if ( RuleLevel == 0 )
  628. {
  629. dbg.Terminate();
  630. }
  631. }
  632. return retval;
  633. }
  634. // $ANTLR end "formalPar"
  635. public class expr_return : ParserRuleReturnScope
  636. {
  637. internal CommonTree tree;
  638. public override object Tree { get { return tree; } }
  639. }
  640. // $ANTLR start "expr"
  641. // BuildOptions\\DebugGrammar.g3:73:0: expr : multExpr ( ( '+' | '-' ) multExpr )* ;
  642. private DebugGrammarParser.expr_return expr( )
  643. {
  644. DebugGrammarParser.expr_return retval = new DebugGrammarParser.expr_return();
  645. retval.start = input.LT(1);
  646. CommonTree root_0 = null;
  647. IToken char_literal19=null;
  648. IToken char_literal20=null;
  649. DebugGrammarParser.multExpr_return multExpr18 = default(DebugGrammarParser.multExpr_return);
  650. DebugGrammarParser.multExpr_return multExpr21 = default(DebugGrammarParser.multExpr_return);
  651. CommonTree char_literal19_tree=null;
  652. CommonTree char_literal20_tree=null;
  653. try
  654. {
  655. dbg.EnterRule( GrammarFileName, "expr" );
  656. if ( RuleLevel == 0 )
  657. {
  658. dbg.Commence();
  659. }
  660. IncRuleLevel();
  661. dbg.Location( 73, -1 );
  662. try
  663. {
  664. // BuildOptions\\DebugGrammar.g3:73:9: ( multExpr ( ( '+' | '-' ) multExpr )* )
  665. dbg.EnterAlt( 1 );
  666. // BuildOptions\\DebugGrammar.g3:73:9: multExpr ( ( '+' | '-' ) multExpr )*
  667. {
  668. root_0 = (CommonTree)adaptor.Nil();
  669. dbg.Location( 73, 8 );
  670. PushFollow(Follow._multExpr_in_expr288);
  671. multExpr18=multExpr();
  672. state._fsp--;
  673. adaptor.AddChild(root_0, multExpr18.Tree);
  674. dbg.Location( 73, 17 );
  675. // BuildOptions\\DebugGrammar.g3:73:18: ( ( '+' | '-' ) multExpr )*
  676. try
  677. {
  678. dbg.EnterSubRule( 4 );
  679. for ( ; ; )
  680. {
  681. int alt4=2;
  682. try
  683. {
  684. dbg.EnterDecision( 4 );
  685. int LA4_0 = input.LA(1);
  686. if ( (LA4_0==10||LA4_0==16) )
  687. {
  688. alt4=1;
  689. }
  690. }
  691. finally
  692. {
  693. dbg.ExitDecision( 4 );
  694. }
  695. switch ( alt4 )
  696. {
  697. case 1:
  698. dbg.EnterAlt( 1 );
  699. // BuildOptions\\DebugGrammar.g3:73:19: ( '+' | '-' ) multExpr
  700. {
  701. dbg.Location( 73, 18 );
  702. // BuildOptions\\DebugGrammar.g3:73:19: ( '+' | '-' )
  703. int alt3=2;
  704. try
  705. {
  706. dbg.EnterSubRule( 3 );
  707. try
  708. {
  709. dbg.EnterDecision( 3 );
  710. int LA3_0 = input.LA(1);
  711. if ( (LA3_0==16) )
  712. {
  713. alt3=1;
  714. }
  715. else if ( (LA3_0==10) )
  716. {
  717. alt3=2;
  718. }
  719. else
  720. {
  721. NoViableAltException nvae = new NoViableAltException("", 3, 0, input);
  722. dbg.RecognitionException( nvae );
  723. throw nvae;
  724. }
  725. }
  726. finally
  727. {
  728. dbg.ExitDecision( 3 );
  729. }
  730. switch ( alt3 )
  731. {
  732. case 1:
  733. dbg.EnterAlt( 1 );
  734. // BuildOptions\\DebugGrammar.g3:73:20: '+'
  735. {
  736. dbg.Location( 73, 22 );
  737. char_literal19=(IToken)Match(input,16,Follow._16_in_expr292);
  738. char_literal19_tree = (CommonTree)adaptor.Create(char_literal19);
  739. root_0 = (CommonTree)adaptor.BecomeRoot(char_literal19_tree, root_0);
  740. }
  741. break;
  742. case 2:
  743. dbg.EnterAlt( 2 );
  744. // BuildOptions\\DebugGrammar.g3:73:25: '-'
  745. {
  746. dbg.Location( 73, 27 );
  747. char_literal20=(IToken)Match(input,10,Follow._10_in_expr295);
  748. char_literal20_tree = (CommonTree)adaptor.Create(char_literal20);
  749. root_0 = (CommonTree)adaptor.BecomeRoot(char_literal20_tree, root_0);
  750. }
  751. break;
  752. }
  753. }
  754. finally
  755. {
  756. dbg.ExitSubRule( 3 );
  757. }
  758. dbg.Location( 73, 30 );
  759. PushFollow(Follow._multExpr_in_expr299);
  760. multExpr21=multExpr();
  761. state._fsp--;
  762. adaptor.AddChild(root_0, multExpr21.Tree);
  763. }
  764. break;
  765. default:
  766. goto loop4;
  767. }
  768. }
  769. loop4:
  770. ;
  771. }
  772. finally
  773. {
  774. dbg.ExitSubRule( 4 );
  775. }
  776. }
  777. retval.stop = input.LT(-1);
  778. retval.tree = (CommonTree)adaptor.RulePostProcessing(root_0);
  779. adaptor.SetTokenBoundaries(retval.tree, retval.start, retval.stop);
  780. }
  781. catch ( RecognitionException re )
  782. {
  783. ReportError(re);
  784. Recover(input,re);
  785. retval.tree = (CommonTree)adaptor.ErrorNode(input, retval.start, input.LT(-1), re);
  786. }
  787. finally
  788. {
  789. }
  790. dbg.Location(74, 4);
  791. }
  792. finally
  793. {
  794. dbg.ExitRule( GrammarFileName, "expr" );
  795. DecRuleLevel();
  796. if ( RuleLevel == 0 )
  797. {
  798. dbg.Terminate();
  799. }
  800. }
  801. return retval;
  802. }
  803. // $ANTLR end "expr"
  804. public class multExpr_return : ParserRuleReturnScope
  805. {
  806. internal CommonTree tree;
  807. public override object Tree { get { return tree; } }
  808. }
  809. // $ANTLR start "multExpr"
  810. // BuildOptions\\DebugGrammar.g3:76:0: multExpr : atom ( ( '*' | '/' | '%' ) atom )* ;
  811. private DebugGrammarParser.multExpr_return multExpr( )
  812. {
  813. DebugGrammarParser.multExpr_return retval = new DebugGrammarParser.multExpr_return();
  814. retval.start = input.LT(1);
  815. CommonTree root_0 = null;
  816. IToken set23=null;
  817. DebugGrammarParser.atom_return atom22 = default(DebugGrammarParser.atom_return);
  818. DebugGrammarParser.atom_return atom24 = default(DebugGrammarParser.atom_return);
  819. CommonTree set23_tree=null;
  820. try
  821. {
  822. dbg.EnterRule( GrammarFileName, "multExpr" );
  823. if ( RuleLevel == 0 )
  824. {
  825. dbg.Commence();
  826. }
  827. IncRuleLevel();
  828. dbg.Location( 76, -1 );
  829. try
  830. {
  831. // BuildOptions\\DebugGrammar.g3:77:9: ( atom ( ( '*' | '/' | '%' ) atom )* )
  832. dbg.EnterAlt( 1 );
  833. // BuildOptions\\DebugGrammar.g3:77:9: atom ( ( '*' | '/' | '%' ) atom )*
  834. {
  835. root_0 = (CommonTree)adaptor.Nil();
  836. dbg.Location( 77, 8 );
  837. PushFollow(Follow._atom_in_multExpr320);
  838. atom22=atom();
  839. state._fsp--;
  840. adaptor.AddChild(root_0, atom22.Tree);
  841. dbg.Location( 77, 13 );
  842. // BuildOptions\\DebugGrammar.g3:77:14: ( ( '*' | '/' | '%' ) atom )*
  843. try
  844. {
  845. dbg.EnterSubRule( 5 );
  846. for ( ; ; )
  847. {
  848. int alt5=2;
  849. try
  850. {
  851. dbg.EnterDecision( 5 );
  852. int LA5_0 = input.LA(1);
  853. if ( (LA5_0==11||(LA5_0>=14 && LA5_0<=15)) )
  854. {
  855. alt5=1;
  856. }
  857. }
  858. finally
  859. {
  860. dbg.ExitDecision( 5 );
  861. }
  862. switch ( alt5 )
  863. {
  864. case 1:
  865. dbg.EnterAlt( 1 );
  866. // BuildOptions\\DebugGrammar.g3:77:15: ( '*' | '/' | '%' ) atom
  867. {
  868. dbg.Location( 77, 27 );
  869. set23=(IToken)input.LT(1);
  870. set23=(IToken)input.LT(1);
  871. if ( input.LA(1)==11||(input.LA(1)>=14 && input.LA(1)<=15) )
  872. {
  873. input.Consume();
  874. root_0 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(set23), root_0);
  875. state.errorRecovery=false;
  876. }
  877. else
  878. {
  879. MismatchedSetException mse = new MismatchedSetException(null,input);
  880. dbg.RecognitionException( mse );
  881. throw mse;
  882. }
  883. dbg.Location( 77, 29 );
  884. PushFollow(Follow._atom_in_multExpr332);
  885. atom24=atom();
  886. state._fsp--;
  887. adaptor.AddChild(root_0, atom24.Tree);
  888. }
  889. break;
  890. default:
  891. goto loop5;
  892. }
  893. }
  894. loop5:
  895. ;
  896. }
  897. finally
  898. {
  899. dbg.ExitSubRule( 5 );
  900. }
  901. }
  902. retval.stop = input.LT(-1);
  903. retval.tree = (CommonTree)adaptor.RulePostProcessing(root_0);
  904. adaptor.SetTokenBoundaries(retval.tree, retval.start, retval.stop);
  905. }
  906. catch ( RecognitionException re )
  907. {
  908. ReportError(re);
  909. Recover(input,re);
  910. retval.tree = (CommonTree)adaptor.ErrorNode(input, retval.start, input.LT(-1), re);
  911. }
  912. finally
  913. {
  914. }
  915. dbg.Location(78, 4);
  916. }
  917. finally
  918. {
  919. dbg.ExitRule( GrammarFileName, "multExpr" );
  920. DecRuleLevel();
  921. if ( RuleLevel == 0 )
  922. {
  923. dbg.Terminate();
  924. }
  925. }
  926. return retval;
  927. }
  928. // $ANTLR end "multExpr"
  929. public class atom_return : ParserRuleReturnScope
  930. {
  931. internal CommonTree tree;
  932. public override object Tree { get { return tree; } }
  933. }
  934. // $ANTLR start "atom"
  935. // BuildOptions\\DebugGrammar.g3:80:0: atom : ( INT | ID | '(' expr ')' -> expr | ID '(' expr ')' -> ^( CALL ID expr ) );
  936. private DebugGrammarParser.atom_return atom( )
  937. {
  938. DebugGrammarParser.atom_return retval = new DebugGrammarParser.atom_return();
  939. retval.start = input.LT(1);
  940. CommonTree root_0 = null;
  941. IToken INT25=null;
  942. IToken ID26=null;
  943. IToken char_literal27=null;
  944. IToken char_literal29=null;
  945. IToken ID30=null;
  946. IToken char_literal31=null;
  947. IToken char_literal33=null;
  948. DebugGrammarParser.expr_return expr28 = default(DebugGrammarParser.expr_return);
  949. DebugGrammarParser.expr_return expr32 = default(DebugGrammarParser.expr_return);
  950. CommonTree INT25_tree=null;
  951. CommonTree ID26_tree=null;
  952. CommonTree char_literal27_tree=null;
  953. CommonTree char_literal29_tree=null;
  954. CommonTree ID30_tree=null;
  955. CommonTree char_literal31_tree=null;
  956. CommonTree char_literal33_tree=null;
  957. RewriteRuleITokenStream stream_12=new RewriteRuleITokenStream(adaptor,"token 12");
  958. RewriteRuleITokenStream stream_13=new RewriteRuleITokenStream(adaptor,"token 13");
  959. RewriteRuleITokenStream stream_ID=new RewriteRuleITokenStream(adaptor,"token ID");
  960. RewriteRuleSubtreeStream stream_expr=new RewriteRuleSubtreeStream(adaptor,"rule expr");
  961. try
  962. {
  963. dbg.EnterRule( GrammarFileName, "atom" );
  964. if ( RuleLevel == 0 )
  965. {
  966. dbg.Commence();
  967. }
  968. IncRuleLevel();
  969. dbg.Location( 80, -1 );
  970. try
  971. {
  972. // BuildOptions\\DebugGrammar.g3:80:9: ( INT | ID | '(' expr ')' -> expr | ID '(' expr ')' -> ^( CALL ID expr ) )
  973. int alt6=4;
  974. try
  975. {
  976. dbg.EnterDecision( 6 );
  977. switch ( input.LA(1) )
  978. {
  979. case INT:
  980. {
  981. alt6=1;
  982. }
  983. break;
  984. case ID:
  985. {
  986. int LA6_2 = input.LA(2);
  987. if ( (LA6_2==12) )
  988. {
  989. alt6=4;
  990. }
  991. else if ( (LA6_2==NEWLINE||(LA6_2>=10 && LA6_2<=11)||(LA6_2>=13 && LA6_2<=16)) )
  992. {
  993. alt6=2;
  994. }
  995. else
  996. {
  997. NoViableAltException nvae = new NoViableAltException("", 6, 2, input);
  998. dbg.RecognitionException( nvae );
  999. throw nvae;
  1000. }
  1001. }
  1002. break;
  1003. case 12:
  1004. {
  1005. alt6=3;
  1006. }
  1007. break;
  1008. default:
  1009. {
  1010. NoViableAltException nvae = new NoViableAltException("", 6, 0, input);
  1011. dbg.RecognitionException( nvae );
  1012. throw nvae;
  1013. }
  1014. }
  1015. }
  1016. finally
  1017. {
  1018. dbg.ExitDecision( 6 );
  1019. }
  1020. switch ( alt6 )
  1021. {
  1022. case 1:
  1023. dbg.EnterAlt( 1 );
  1024. // BuildOptions\\DebugGrammar.g3:80:9: INT
  1025. {
  1026. root_0 = (CommonTree)adaptor.Nil();
  1027. dbg.Location( 80, 8 );
  1028. INT25=(IToken)Match(input,INT,Follow._INT_in_atom348);
  1029. INT25_tree = (CommonTree)adaptor.Create(INT25);
  1030. adaptor.AddChild(root_0, INT25_tree);
  1031. }
  1032. break;
  1033. case 2:
  1034. dbg.EnterAlt( 2 );
  1035. // BuildOptions\\DebugGrammar.g3:81:9: ID
  1036. {
  1037. root_0 = (CommonTree)adaptor.Nil();
  1038. dbg.Location( 81, 8 );
  1039. ID26=(IToken)Match(input,ID,Follow._ID_in_atom358);
  1040. ID26_tree = (CommonTree)adaptor.Create(ID26);
  1041. adaptor.AddChild(root_0, ID26_tree);
  1042. }
  1043. break;
  1044. case 3:
  1045. dbg.EnterAlt( 3 );
  1046. // BuildOptions\\DebugGrammar.g3:82:9: '(' expr ')'
  1047. {
  1048. dbg.Location( 82, 8 );
  1049. char_literal27=(IToken)Match(input,12,Follow._12_in_atom368);
  1050. stream_12.Add(char_literal27);
  1051. dbg.Location( 82, 12 );
  1052. PushFollow(Follow._expr_in_atom370);
  1053. expr28=expr();
  1054. state._fsp--;
  1055. stream_expr.Add(expr28.Tree);
  1056. dbg.Location( 82, 17 );
  1057. char_literal29=(IToken)Match(input,13,Follow._13_in_atom372);
  1058. stream_13.Add(char_literal29);
  1059. {
  1060. // AST REWRITE
  1061. // elements: expr
  1062. // token labels:
  1063. // rule labels: retval
  1064. // token list labels:
  1065. // rule list labels:
  1066. // wildcard labels:
  1067. retval.tree = root_0;
  1068. RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
  1069. root_0 = (CommonTree)adaptor.Nil();
  1070. // 82:25: -> expr
  1071. {
  1072. dbg.Location( 82, 27 );
  1073. adaptor.AddChild(root_0, stream_expr.NextTree());
  1074. }
  1075. retval.tree = root_0;
  1076. }
  1077. }
  1078. break;
  1079. case 4:
  1080. dbg.EnterAlt( 4 );
  1081. // BuildOptions\\DebugGrammar.g3:83:9: ID '(' expr ')'
  1082. {
  1083. dbg.Location( 83, 8 );
  1084. ID30=(IToken)Match(input,ID,Follow._ID_in_atom389);
  1085. stream_ID.Add(ID30);
  1086. dbg.Location( 83, 11 );
  1087. char_literal31=(IToken)Match(input,12,Follow._12_in_atom391);
  1088. stream_12.Add(char_literal31);
  1089. dbg.Location( 83, 15 );
  1090. PushFollow(Follow._expr_in_atom393);
  1091. expr32=expr();
  1092. state._fsp--;
  1093. stream_expr.Add(expr32.Tree);
  1094. dbg.Location( 83, 20 );
  1095. char_literal33=(IToken)Match(input,13,Follow._13_in_atom395);
  1096. stream_13.Add(char_literal33);
  1097. {
  1098. // AST REWRITE
  1099. // elements: ID, expr
  1100. // token labels:
  1101. // rule labels: retval
  1102. // token list labels:
  1103. // rule list labels:
  1104. // wildcard labels:
  1105. retval.tree = root_0;
  1106. RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
  1107. root_0 = (CommonTree)adaptor.Nil();
  1108. // 83:25: -> ^( CALL ID expr )
  1109. {
  1110. dbg.Location( 83, 27 );
  1111. // BuildOptions\\DebugGrammar.g3:83:28: ^( CALL ID expr )
  1112. {
  1113. CommonTree root_1 = (CommonTree)adaptor.Nil();
  1114. dbg.Location( 83, 29 );
  1115. root_1 = (CommonTree)adaptor.BecomeRoot((CommonTree)adaptor.Create(CALL, "CALL"), root_1);
  1116. dbg.Location( 83, 34 );
  1117. adaptor.AddChild(root_1, stream_ID.NextNode());
  1118. dbg.Location( 83, 37 );
  1119. adaptor.AddChild(root_1, stream_expr.NextTree());
  1120. adaptor.AddChild(root_0, root_1);
  1121. }
  1122. }
  1123. retval.tree = root_0;
  1124. }
  1125. }
  1126. break;
  1127. }
  1128. retval.stop = input.LT(-1);
  1129. retval.tree = (CommonTree)adaptor.RulePostProcessing(root_0);
  1130. adaptor.SetTokenBoundaries(retval.tree, retval.start, retval.stop);
  1131. }
  1132. catch ( RecognitionException re )
  1133. {
  1134. ReportError(re);
  1135. Recover(input,re);
  1136. retval.tree = (CommonTree)adaptor.ErrorNode(input, retval.start, input.LT(-1), re);
  1137. }
  1138. finally
  1139. {
  1140. }
  1141. dbg.Location(84, 4);
  1142. }
  1143. finally
  1144. {
  1145. dbg.ExitRule( GrammarFileName, "atom" );
  1146. DecRuleLevel();
  1147. if ( RuleLevel == 0 )
  1148. {
  1149. dbg.Terminate();
  1150. }
  1151. }
  1152. return retval;
  1153. }
  1154. // $ANTLR end "atom"
  1155. #endregion Rules
  1156. #region DFA
  1157. DFA2 dfa2;
  1158. protected override void InitDFAs()
  1159. {
  1160. base.InitDFAs();
  1161. dfa2 = new DFA2( this );
  1162. }
  1163. class DFA2 : DFA
  1164. {
  1165. const string DFA2_eotS =
  1166. "\xA\xFFFF";
  1167. const string DFA2_eofS =
  1168. "\xA\xFFFF";
  1169. const string DFA2_minS =
  1170. "\x1\x6\x1\xFFFF\x1\x8\x1\xFFFF\x1\x6\x1\xFFFF\x2\xA\x1\x8\x1\xFFFF";
  1171. const string DFA2_maxS =
  1172. "\x1\xC\x1\xFFFF\x1\x11\x1\xFFFF\x1\xC\x1\xFFFF\x2\x10\x1\x11\x1\xFFFF";
  1173. const string DFA2_acceptS =
  1174. "\x1\xFFFF\x1\x1\x1\xFFFF\x1\x4\x1\xFFFF\x1\x2\x3\xFFFF\x1\x3";
  1175. const string DFA2_specialS =
  1176. "\xA\xFFFF}>";
  1177. static readonly string[] DFA2_transitionS =
  1178. {
  1179. "\x1\x2\x1\x1\x1\x3\x3\xFFFF\x1\x1",
  1180. "",
  1181. "\x1\x1\x1\xFFFF\x2\x1\x1\x4\x1\xFFFF\x3\x1\x1\x5",
  1182. "",
  1183. "\x1\x7\x1\x6\x4\xFFFF\x1\x1",
  1184. "",
  1185. "\x2\x1\x1\xFFFF\x1\x8\x3\x1",
  1186. "\x3\x1\x1\x8\x3\x1",
  1187. "\x1\x1\x1\xFFFF\x2\x1\x2\xFFFF\x3\x1\x1\x9",
  1188. ""
  1189. };
  1190. static readonly short[] DFA2_eot = DFA.UnpackEncodedString(DFA2_eotS);
  1191. static readonly short[] DFA2_eof = DFA.UnpackEncodedString(DFA2_eofS);
  1192. static readonly char[] DFA2_min = DFA.UnpackEncodedStringToUnsignedChars(DFA2_minS);
  1193. static readonly char[] DFA2_max = DFA.UnpackEncodedStringToUnsignedChars(DFA2_maxS);
  1194. static readonly short[] DFA2_accept = DFA.UnpackEncodedString(DFA2_acceptS);
  1195. static readonly short[] DFA2_special = DFA.UnpackEncodedString(DFA2_specialS);
  1196. static readonly short[][] DFA2_transition;
  1197. static DFA2()
  1198. {
  1199. int numStates = DFA2_transitionS.Length;
  1200. DFA2_transition = new short[numStates][];
  1201. for ( int i=0; i < numStates; i++ )
  1202. {
  1203. DFA2_transition[i] = DFA.UnpackEncodedString(DFA2_transitionS[i]);
  1204. }
  1205. }
  1206. public DFA2( BaseRecognizer recognizer )
  1207. {
  1208. this.recognizer = recognizer;
  1209. this.decisionNumber = 2;
  1210. this.eot = DFA2_eot;
  1211. this.eof = DFA2_eof;
  1212. this.min = DFA2_min;
  1213. this.max = DFA2_max;
  1214. this.accept = DFA2_accept;
  1215. this.special = DFA2_special;
  1216. this.transition = DFA2_transition;
  1217. }
  1218. public override string GetDescription()
  1219. {
  1220. return "53:0: stat : ( expr NEWLINE -> expr | ID '=' expr NEWLINE -> ^( '=' ID expr ) | func NEWLINE -> func | NEWLINE ->);";
  1221. }
  1222. public override void Error( NoViableAltException nvae )
  1223. {
  1224. ((DebugParser)recognizer).dbg.RecognitionException( nvae );
  1225. }
  1226. }
  1227. #endregion DFA
  1228. #region Follow sets
  1229. private static class Follow
  1230. {
  1231. public static readonly BitSet _stat_in_prog53 = new BitSet(new ulong[]{0x11C2UL});
  1232. public static readonly BitSet _expr_in_stat70 = new BitSet(new ulong[]{0x100UL});
  1233. public static readonly BitSet _NEWLINE_in_stat72 = new BitSet(new ulong[]{0x2UL});
  1234. public static readonly BitSet _ID_in_stat105 = new BitSet(new ulong[]{0x20000UL});
  1235. public static readonly BitSet _17_in_stat107 = new BitSet(new ulong[]{0x10C0UL});
  1236. public static readonly BitSet _expr_in_stat109 = new BitSet(new ulong[]{0x100UL});
  1237. public static readonly BitSet _NEWLINE_in_stat111 = new BitSet(new ulong[]{0x2UL});
  1238. public static readonly BitSet _func_in_stat143 = new BitSet(new ulong[]{0x100UL});
  1239. public static readonly BitSet _NEWLINE_in_stat145 = new BitSet(new ulong[]{0x2UL});
  1240. public static readonly BitSet _NEWLINE_in_stat178 = new BitSet(new ulong[]{0x2UL});
  1241. public static readonly BitSet _ID_in_func219 = new BitSet(new ulong[]{0x1000UL});
  1242. public static readonly BitSet _12_in_func222 = new BitSet(new ulong[]{0xC0UL});
  1243. public static readonly BitSet _formalPar_in_func224 = new BitSet(new ulong[]{0x2000UL});
  1244. public static readonly BitSet _13_in_func226 = new BitSet(new ulong[]{0x20000UL});
  1245. public static readonly BitSet _17_in_func228 = new BitSet(new ulong[]{0x10C0UL});
  1246. public static readonly BitSet _expr_in_func230 = new BitSet(new ulong[]{0x2UL});
  1247. public static readonly BitSet _set_in_formalPar267 = new BitSet(new ulong[]{0x2UL});
  1248. public static readonly BitSet _multExpr_in_expr288 = new BitSet(new ulong[]{0x10402UL});
  1249. public static readonly BitSet _16_in_expr292 = new BitSet(new ulong[]{0x10C0UL});
  1250. public static readonly BitSet _10_in_expr295 = new BitSet(new ulong[]{0x10C0UL});
  1251. public static readonly BitSet _multExpr_in_expr299 = new BitSet(new ulong[]{0x10402UL});
  1252. public static readonly BitSet _atom_in_multExpr320 = new BitSet(new ulong[]{0xC802UL});
  1253. public static readonly BitSet _set_in_multExpr323 = new BitSet(new ulong[]{0x10C0UL});
  1254. public static readonly BitSet _atom_in_multExpr332 = new BitSet(new ulong[]{0xC802UL});
  1255. public static readonly BitSet _INT_in_atom348 = new BitSet(new ulong[]{0x2UL});
  1256. public static readonly BitSet _ID_in_atom358 = new BitSet(new ulong[]{0x2UL});
  1257. public static readonly BitSet _12_in_atom368 = new BitSet(new ulong[]{0x10C0UL});
  1258. public static readonly BitSet _expr_in_atom370 = new BitSet(new ulong[]{0x2000UL});
  1259. public static readonly BitSet _13_in_atom372 = new BitSet(new ulong[]{0x2UL});
  1260. public static readonly BitSet _ID_in_atom389 = new BitSet(new ulong[]{0x1000UL});
  1261. public static readonly BitSet _12_in_atom391 = new BitSet(new ulong[]{0x10C0UL});
  1262. public static readonly BitSet _expr_in_atom393 = new BitSet(new ulong[]{0x2000UL});
  1263. public static readonly BitSet _13_in_atom395 = new BitSet(new ulong[]{0x2UL});
  1264. }
  1265. #endregion Follow sets
  1266. }