Пример #1
0
        void Term(out Expression e)
        {
            Operator op; Expression e1, e2;

            Factor(out e1);
            e = e1;
            while (la.kind == 26 || la.kind == 27 || la.kind == 28)
            {
                MulOp(out op);
                Factor(out e2);
                e = new BinaryOperation(op, e, e2);
            }
        }
Пример #2
0
        void SimExpr(out Expression e)
        {
            Expression e1, e2; Operator op;

            Term(out e1);
            e = e1;
            while (la.kind == 24 || la.kind == 25)
            {
                AddOp(out op);
                Term(out e2);
                e = new BinaryOperation(op, e, e2);
            }
        }
Пример #3
0
        void SimBoolExpr(out Expression e)
        {
            Expression e1, e2; Operator op; e = null;

            LetIn(out e1);
            e = e1;
            if (StartOf(2))
            {
                RelOp(out op);
                LetIn(out e2);
                e = new BinaryOperation(op, e, e2);
            }
        }
Пример #4
0
        void BoolTerm(out Expression e)
        {
            Expression e1, e2; Operator op; e = null;

            SimBoolExpr(out e1);
            e = e1;
            while (la.kind == 14)
            {
                OrOp(out op);
                SimBoolExpr(out e2);
                e = new BinaryOperation(op, e, e2);
            }
        }
Пример #5
0
        void LogExpr(out Expression e)
        {
            Expression e1, e2; Operator op; e = null;

            BoolTerm(out e1);
            e = e1;
            while (la.kind == 13)
            {
                AndOp(out op);
                BoolTerm(out e2);
                e = new BinaryOperation(op, e, e2);
            }
        }
Пример #6
0
 void Term(out Expression e)
 {
     Operator op; Expression e1, e2;
     Factor(out e1);
     e = e1;
     while (la.kind == 19 || la.kind == 20) {
     MulOp(out op);
     Factor(out e2);
     e = new BinaryOperation(op, e, e2);
     }
 }
Пример #7
0
 void SimExpr(out Expression e)
 {
     Expression e1, e2; Operator op;
     Term(out e1);
     e = e1;
     while (la.kind == 17 || la.kind == 18) {
     AddOp(out op);
     Term(out e2);
     e = new BinaryOperation(op, e, e2);
     }
 }
Пример #8
0
 void SimBoolExpr(out Expression e)
 {
     Expression e1, e2; Operator op; e = null;
     SimExpr(out e1);
     e = e1;
     if (StartOf(1)) {
     RelOp(out op);
     SimExpr(out e2);
     e = new BinaryOperation(op, e, e2);
     }
 }
Пример #9
0
 void Expr(out Expression e)
 {
     Expression e1, e2; Operator op; e = null;
     BoolTerm(out e1);
     e = e1;
     while (la.kind == 9) {
     AndOp(out op);
     BoolTerm(out e2);
     e = new BinaryOperation(op, e, e2);
     }
 }
Пример #10
0
 void BoolTerm(out Expression e)
 {
     Expression e1, e2; Operator op; e = null;
     SimBoolExpr(out e1);
     e = e1;
     while (la.kind == 10) {
     OrOp(out op);
     SimBoolExpr(out e2);
     e = new BinaryOperation(op, e, e2);
     }
 }