Exemplo n.º 1
0
    public ElemContext elem()
    {
        ElemContext _localctx = new ElemContext(Context, State);

        EnterRule(_localctx, 2, RULE_elem);
        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 24;
                ErrorHandler.Sync(this);
                switch (TokenStream.LA(1))
                {
                case INITIALISE:
                {
                    State = 19; initialiseGame();
                }
                break;

                case GAMETYPE:
                {
                    State = 20; defineGame();
                }
                break;

                case PC:
                {
                    State = 21; createPlayer();
                }
                break;

                case ATTACKSTYLE:
                {
                    State = 22; createEnemies();
                }
                break;

                case FINALISE:
                {
                    State = 23; finishGameSetup();
                }
                break;

                default:
                    throw new NoViableAltException(this);
                }
                State = 26; Match(NEWLINE);
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
Exemplo n.º 2
0
    public ElemContext elem()
    {
        ElemContext _localctx = new ElemContext(Context, State);

        EnterRule(_localctx, 2, RULE_elem);
        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 24;
                ErrorHandler.Sync(this);
                switch (Interpreter.AdaptivePredict(TokenStream, 1, Context))
                {
                case 1:
                {
                    State = 19; createInitialRoom();
                }
                break;

                case 2:
                {
                    State = 20; createFirstCorrSect();
                }
                break;

                case 3:
                {
                    State = 21; createSecondCorrSect();
                }
                break;

                case 4:
                {
                    State = 22; createRoom();
                }
                break;

                case 5:
                {
                    State = 23; createFinalRoom();
                }
                break;
                }
                State = 26; Match(NEWLINE);
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
Exemplo n.º 3
0
    public ElemContext elem()
    {
        ElemContext _localctx = new ElemContext(Context, State);

        EnterRule(_localctx, 2, RULE_elem);
        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 27;
                ErrorHandler.Sync(this);
                switch (TokenStream.LA(1))
                {
                case START:
                {
                    State = 21; addStartSegment();
                }
                break;

                case FLATPATH:
                {
                    State = 22; addFlatPathSegment();
                }
                break;

                case LOWPLATFORM:
                {
                    State = 23; addLowPlatformSegment();
                }
                break;

                case HIGHPLATFORM:
                {
                    State = 24; addHighPlatformSegment();
                }
                break;

                case PATHGAP:
                {
                    State = 25; addPathGapSegment();
                }
                break;

                case FINISHLINE:
                {
                    State = 26; addFinishLineSegment();
                }
                break;

                default:
                    throw new NoViableAltException(this);
                }
                State = 29; Match(NEWLINE);
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }