Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [RuleVersion(0)]
- public ProgramContext program() {
- ProgramContext _localctx = new ProgramContext(_ctx, State);
- EnterRule(_localctx, 0, RULE_program);
- int _la;
- try {
- _localctx = new ProgramASTContext(_localctx);
- EnterOuterAlt(_localctx, 1);
- {
- State = 40; ((ProgramASTContext)_localctx).tclass = Match(CLASS);
- State = 41; ((ProgramASTContext)_localctx).tident = Match(IDENT);
- State = 47;
- _errHandler.Sync(this);
- _la = _input.La(1);
- while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << CLASS) | (1L << CONST) | (1L << IDENT))) != 0)) {
- {
- State = 45;
- switch (_input.La(1)) {
- case CONST:
- {
- State = 42; const_decl();
- }
- break;
- case IDENT:
- {
- State = 43; var_decl();
- }
- break;
- case CLASS:
- {
- State = 44; class_decl();
- }
- break;
- default:
- throw new NoViableAltException(this);
- }
- }
- State = 49;
- _errHandler.Sync(this);
- _la = _input.La(1);
- }
- State = 50; ((ProgramASTContext)_localctx).tlcb = Match(LEFT_CURLY_BRACKET);
- State = 54;
- _errHandler.Sync(this);
- _la = _input.La(1);
- while (_la==VOID || _la==IDENT) {
- {
- {
- State = 51; method_decl();
- }
- }
- State = 56;
- _errHandler.Sync(this);
- _la = _input.La(1);
- }
- State = 57; ((ProgramASTContext)_localctx).trcb = Match(RIGHT_CURLY_BRACKET);
- State = 58; Match(Eof);
- }
- }
- catch (RecognitionException re) {
- _localctx.exception = re;
- _errHandler.ReportError(this, re);
- _errHandler.Recover(this, re);
- }
- finally {
- ExitRule();
- }
- return _localctx;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement