public UnaryExpression(Location location, Operator unaryOperator, Expression operand) : base(location) { Operator = Utilities.ThrowIfNull(unaryOperator, "unaryOperator"); Operand = Utilities.ThrowIfNull(operand, "operand"); if(Operator.Token != '-') throw new ArgumentException( Utilities.InvariantFormat("\"{0}\" is not unary operator.", Operator), "unaryOperator"); }
public BinaryExpression( Location location, Operator binaryOperator, Expression leftExpression, Expression rightExpression) : base(location) { Operator = Utilities.ThrowIfNull(binaryOperator, "binaryOperator"); LeftExpression = Utilities.ThrowIfNull(leftExpression, "leftExpression"); RightExpression = Utilities.ThrowIfNull(rightExpression, "rightExpression"); if(!Operator.IsBinaryOperator(Operator.Token)) throw new ArgumentException( Utilities.InvariantFormat("\"{0}\" is not binary operator.", Operator), "binaryOperator"); }