示例#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));
            }
        }
示例#2
0
 public condTermAST(listCondFactAST lCndFact)
 {
     this.listCondFact = lCndFact;
 }
示例#3
0
 public varCondFactAST(listCondFactAST hh1, listCondFactAST hh2)
 {
     h1 = hh1;
     h2 = hh2;
 }