Exemple #1
0
        /* throws ParseException */
        /* final */
        public static AstClassDeclList astClassDeclList()
        {
            bool done = false;
            AstClassDecl c; AstClassDeclList cl = new AstClassDeclList();
            jj_consume_token(AstRegExpId.kw56);
            jj_consume_token(AstRegExpId.kwClassDeclList);
            // label_1:
            while (!done)
            {
                switch ((jj_ntk == AstRegExpId.UNDEFINED)?jj_ntk_fn():jj_ntk)
                {
                    case AstRegExpId.kw56:
                        ;
                        break;

                    default:
                        jj_la1[0] = jj_gen;
                        done = true;
                        //break label_1;
                        break;
                }

                if (!done)
                {
                    c = astClassDecl();
                    cl.Add(c);
                }
            }

            jj_consume_token(AstRegExpId.kw57);
            {if (true) return cl;}
            throw new Error("Missing return statement in function");
        }
Exemple #2
0
        /* throws ParseException */
        /* final */
        public static AstProgram Program()
        {
            bool done = false;
            AstClassDecl c;
            AstClassDeclList cl = new AstClassDeclList();
            // Get a reference to the Main class and add it to the list of classes
            c = MainClass();
            cl.Add(c);

            // label_1:
            while (!done)
            {
                switch ((jj_ntk == MpRegExpId.UNDEFINED) ? jj_ntk_fn() : jj_ntk)
                {
                    case MpRegExpId.CLASS:
                        break;
                    default:
                        jj_la1[0] = jj_gen;
                        done = true;
                        break /* label_1 */;
                }
                if (!done)
                {
                    c = ClassDecl();
                    cl.Add(c);
                }
            }
            jj_consume_token(0);
            return new AstProgram( cl );
        }