Ejemplo 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");
     }
 }
Ejemplo n.º 2
0
 private OperatorExpression(Operator op, VisitedExpression left, VisitedExpression right)
 {
     this.op = op;
     this.left = left;
     this.right = right;
 }
Ejemplo 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");
     }
 }
Ejemplo 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;
 }