// $ANTLR end "prog"


    // $ANTLR start "stat"
    // BuildOptions\\ProfileTreeGrammar.g3:56:0: stat : ( expr | ^( '=' ID expr ) | ^( FUNC ( . )+ ) );
    private void stat(  )
    {
        CommonTree ID2   = null;
        BigInteger expr1 = default(BigInteger);
        BigInteger expr3 = default(BigInteger);

        try
        {
            dbg.EnterRule(GrammarFileName, "stat");
            if (RuleLevel == 0)
            {
                dbg.Commence();
            }
            IncRuleLevel();
            dbg.Location(56, -1);

            try
            {
                // BuildOptions\\ProfileTreeGrammar.g3:56:9: ( expr | ^( '=' ID expr ) | ^( FUNC ( . )+ ) )
                int alt3 = 3;
                try
                {
                    dbg.EnterDecision(3);

                    switch (input.LA(1))
                    {
                    case CALL:
                    case ID:
                    case INT:
                    case 10:
                    case 11:
                    case 14:
                    case 15:
                    case 16:
                    {
                        alt3 = 1;
                    }
                    break;

                    case 17:
                    {
                        alt3 = 2;
                    }
                    break;

                    case FUNC:
                    {
                        alt3 = 3;
                    }
                    break;

                    default:
                    {
                        NoViableAltException nvae = new NoViableAltException("", 3, 0, input);

                        dbg.RecognitionException(nvae);
                        throw nvae;
                    }
                    }
                }
                finally
                {
                    dbg.ExitDecision(3);
                }

                switch (alt3)
                {
                case 1:
                    dbg.EnterAlt(1);

                    // BuildOptions\\ProfileTreeGrammar.g3:56:9: expr
                    {
                        dbg.Location(56, 8);
                        PushFollow(Follow._expr_in_stat63);
                        expr1 = expr();

                        state._fsp--;

                        dbg.Location(56, 35);
                        string result = expr1.ToString();
                        Console.Out.WriteLine(expr1 + " (about " + result[0] + "*10^" + (result.Length - 1) + ")");
                    }
                    break;

                case 2:
                    dbg.EnterAlt(2);

                    // BuildOptions\\ProfileTreeGrammar.g3:59:9: ^( '=' ID expr )
                    {
                        dbg.Location(59, 8);
                        dbg.Location(59, 10);
                        Match(input, 17, Follow._17_in_stat98);

                        Match(input, TokenTypes.Down, null);
                        dbg.Location(59, 14);
                        ID2 = (CommonTree)Match(input, ID, Follow._ID_in_stat100);
                        dbg.Location(59, 17);
                        PushFollow(Follow._expr_in_stat102);
                        expr3 = expr();

                        state._fsp--;


                        Match(input, TokenTypes.Up, null);
                        dbg.Location(59, 35);
                        globalMemory[(ID2 != null?ID2.Text:null)] = expr3;
                    }
                    break;

                case 3:
                    dbg.EnterAlt(3);

                    // BuildOptions\\ProfileTreeGrammar.g3:60:9: ^( FUNC ( . )+ )
                    {
                        dbg.Location(60, 8);
                        dbg.Location(60, 10);
                        Match(input, FUNC, Follow._FUNC_in_stat128);

                        Match(input, TokenTypes.Down, null);
                        dbg.Location(60, 15);
                        // BuildOptions\\ProfileTreeGrammar.g3:60:16: ( . )+
                        int cnt2 = 0;
                        try
                        {
                            dbg.EnterSubRule(2);

                            for ( ; ;)
                            {
                                int alt2 = 2;
                                try
                                {
                                    dbg.EnterDecision(2);

                                    int LA2_0 = input.LA(1);

                                    if (((LA2_0 >= CALL && LA2_0 <= 17)))
                                    {
                                        alt2 = 1;
                                    }
                                    else if ((LA2_0 == UP))
                                    {
                                        alt2 = 2;
                                    }
                                }
                                finally
                                {
                                    dbg.ExitDecision(2);
                                }

                                switch (alt2)
                                {
                                case 1:
                                    dbg.EnterAlt(1);

                                    // BuildOptions\\ProfileTreeGrammar.g3:60:0: .
                                    {
                                        dbg.Location(60, 15);
                                        MatchAny(input);
                                    }
                                    break;

                                default:
                                    if (cnt2 >= 1)
                                    {
                                        goto loop2;
                                    }

                                    EarlyExitException eee2 = new EarlyExitException(2, input);
                                    dbg.RecognitionException(eee2);

                                    throw eee2;
                                }
                                cnt2++;
                            }
loop2:
                            ;
                        }
                        finally
                        {
                            dbg.ExitSubRule(2);
                        }


                        Match(input, TokenTypes.Up, null);
                    }
                    break;
                }
            }
            catch (RecognitionException re)
            {
                ReportError(re);
                Recover(input, re);
            }
            finally
            {
            }
            dbg.Location(61, 4);
        }
        finally
        {
            dbg.ExitRule(GrammarFileName, "stat");
            DecRuleLevel();
            if (RuleLevel == 0)
            {
                dbg.Terminate();
            }
        }

        return;
    }