예제 #1
0
 public AstMethodDecl(AstType at, AstId i, AstFormalList afl, 
 AstVarDeclList avl, AstStmtList asl)
 {
     t=at; mid=i; fl=afl; vl=avl; sl=asl;
 }
예제 #2
0
        /* throws ParseException */
        /* final */
        public static AstFormalList astFormalList()
        {
            AstFormal f; AstFormalList fl = new AstFormalList();
            bool done = false;

            jj_consume_token(AstRegExpId.kw56);
            jj_consume_token(AstRegExpId.kwFormalList);

            //label_4:
            while (!done)
            {
                switch ((jj_ntk == AstRegExpId.UNDEFINED)?jj_ntk_fn():jj_ntk)
                {
                    case AstRegExpId.kw56:
                        break;

                    default:
                        jj_la1[3] = jj_gen;
                        done = true;
                        break /* label_4 */;
                }
                if (!done)
                {
                    f = astFormal();
                    fl.Add(f);
                }
            }

            jj_consume_token(AstRegExpId.kw57);
            {if (true) return fl;}
            throw new Error("Missing return statement in function");
        }
예제 #3
0
 public void visit(AstFormalList n)
 {
     for (int i = 0; i < n.Count(); i++)
         n[i].accept(this);
 }
예제 #4
0
 public void visit(AstFormalList n) 
 {
     for (int i = 0; i < n.size(); i++)
         n.elementAt(i).accept(this);
 }
예제 #5
0
        /* throws ParseException */
        // --------------------------------------------------------------------------
        // Formals  ->  Type <ID> {"," Type <ID>}
        // --------------------------------------------------------------------------
        /* final */
        public static AstFormalList Formals()
        {
            DemiTasse.ast.AstType t = null;
            AstId id = null;
            AstFormalList fl = new AstFormalList();

            t = Type();
            id = Id();
            fl.Add( new AstFormal( t, id ) );

            /* label_10: */
            bool done = false;
            while (!done)
            {
                switch ((jj_ntk == MpRegExpId.UNDEFINED) ? jj_ntk_fn() : jj_ntk)
                {
                    case MpRegExpId.COMMA:
                        break;
                    default:
                        jj_la1[10] = jj_gen;
                        done = true;
                        break /* label_10 */;
                }
                if (!done)
                {
                    jj_consume_token(MpRegExpId.COMMA);
                    t = Type();
                    id = Id();
                    fl.Add(new AstFormal(t, id));
                }
            }
            {if (true) return fl;}
            throw new Error("Missing return statement in function");
        }