Esempio n. 1
0
 public static OperatorExpression Build(Operator op, VisitedExpression exp)
 {
     if (op.UnaryType == Operator.UnaryTypes.Prefix)
     {
         return new OperatorExpression(op, null, exp);
     }
     else if (op.UnaryType == Operator.UnaryTypes.Postfix)
     {
         return new OperatorExpression(op, exp, null);
     }
     else
     {
         throw new InvalidOperationException("Binary operator with one operand");
     }
 }
Esempio n. 2
0
 private OperatorExpression(Operator op, VisitedExpression left, VisitedExpression right)
 {
     this.op = op;
     this.left = left;
     this.right = right;
 }
Esempio n. 3
0
 public static OperatorExpression Build(Operator op, VisitedExpression left, VisitedExpression right)
 {
     if (op.UnaryType == Operator.UnaryTypes.Binary)
     {
         return new OperatorExpression(op, left, right);
     }
     else
     {
         throw new InvalidOperationException("Unary operator with two operands");
     }
 }
Esempio n. 4
0
 private OperatorExpression(Operator op, bool useNewPrecedences, VisitedExpression left, VisitedExpression right)
 {
     this.op = op;
     this.useNewPrecedences = useNewPrecedences;
     this.left = left;
     this.right = right;
 }