/// <summary> /// Initializes a new instance of the <see cref="OperatorToken"/> struct. /// </summary> /// <param name="operatorType">Type of the operator.</param> public OperatorToken(OperatorType operatorType) { if (operatorType != OperatorType.Add && operatorType != OperatorType.Divide && operatorType != OperatorType.Multiply && operatorType != OperatorType.Subtract && operatorType != OperatorType.RaiseTo && operatorType != OperatorType.Modulo && operatorType != OperatorType.UnaryMinus) { throw new ArgumentException("The operator type is not of a valid type.", "operatorType"); } this._operatorType = operatorType; this._precedence = operatorType.GetOperatorPrecedence(); this._associativity = operatorType.GetAssociativity(); this._argumentCount = operatorType.GetArgumentCount(); }