Example #1
0
        public conditionAST parseCondition()
        {
            listCondTermAST temp   = null;
            listCondTermAST temp2  = null;
            listCondTermAST result = null;
            condTermAST     cndT   = null;
            condTermAST     expr   = null;

            //Condition = CondTerm { "||" CondTerm }
            cndT = parseCndTerm();
            temp = new unCondTermAST(cndT);
            Boolean ind = false;

            while (currentToken.sym == sym.O_O)
            {
                acceptIt();
                if (ind == false)
                {
                    acceptIt();
                    expr   = parseCndTerm();
                    temp   = new unCondTermAST(expr);
                    result = new varCondTermAST(temp2, temp);
                    ind    = true;
                }
                else
                {
                    acceptIt();
                    expr   = parseCndTerm();
                    temp2  = new unCondTermAST(expr);
                    result = new varCondTermAST(result, temp2);
                }
            }
            if (result == null)
            {
                return(new conditionAST(temp));
            }
            else
            {
                return(new conditionAST(result));
            }
        }
Example #2
0
 Object VisitCondTermAS(condTermAST 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;
 }