Esempio n. 1
0
        public condTermAST parseCndTerm()
        {
            listCondFactAST temp   = null;
            listCondFactAST temp2  = null;
            listCondFactAST result = null;
            condFactAST     cndT   = null;
            condFactAST     expr   = null;

            //CondTerm= CondFact { "&&" CondFact }
            cndT = parseCndFac();

            temp = new unCondFactAST(cndT);
            Boolean ind = false;

            while (currentToken.sym == sym.Y_Y)
            {
                acceptIt();
                if (ind == false)
                {
                    acceptIt();
                    expr   = parseCndFac();
                    temp   = new unCondFactAST(expr);
                    result = new varCondFactAST(temp2, temp);
                    ind    = true;
                }
                else
                {
                    acceptIt();
                    expr   = parseCndFac();
                    temp2  = new unCondFactAST(expr);
                    result = new varCondFactAST(result, temp2);
                }
            }
            if (result == null)
            {
                return(new condTermAST(temp));
            }
            else
            {
                return(new condTermAST(result));
            }
        }
Esempio n. 2
0
 Object VisitVarCondFactAST(varCondFactAST var, object arg)
 {
     int numaux = ((Integer)arg).intValue(); printtab(numaux); System.out.println(c.getClass().getName());  if(c.- !=null)  c.-.visit(this,new Integer(numaux+1)); else{printtab(numaux+1);  Console.WriteLine(“NULL”);} return null;
 }
Esempio n. 3
0
        public condTermAST parseCndTerm()
        {
            listCondFactAST temp = null;
            listCondFactAST temp2 = null;
            listCondFactAST result = null;
            condFactAST cndT = null;
            condFactAST expr=null;
            //CondTerm= CondFact { "&&" CondFact }
            cndT = parseCndFac();

            temp = new unCondFactAST(cndT);
            Boolean ind = false;
            while (currentToken.sym == sym.Y_Y)
            {
                acceptIt();
                if (ind == false)
                {
                    acceptIt();
                    expr = parseCndFac();
                    temp = new unCondFactAST(expr);
                    result = new varCondFactAST(temp2, temp);
                    ind = true;
                }
                else
                {
                    acceptIt();
                    expr = parseCndFac();
                    temp2 = new unCondFactAST(expr);
                    result = new varCondFactAST(result, temp2);
                }

            }
            if (result == null)
            {
                return new condTermAST(temp);
            }
            else return new condTermAST(result);
        }