Esempio n. 1
0
 private SpecialOperatorDefinition(string text, TokenType?secondaryTokenType, int precedence, SpecialOperatorType operatorType,
                                   TokenType?argumentSeperator = null, TokenType?endingText = null, int minArguments = 0, int maxArguments = 0)
     : base(text, secondaryTokenType, precedence, OperandCount.Binary)
 {
     OperatorType      = operatorType;
     EndingToken       = endingText;
     MinimumArguments  = minArguments;
     MaximumArguments  = maxArguments;
     ArgumentSeperator = argumentSeperator;
 }
Esempio n. 2
0
 internal static SpecialOperatorDefinition Create(string text, int precedence, SpecialOperatorType operatorType)
 {
     return(new SpecialOperatorDefinition(text, null, precedence, operatorType));
 }
Esempio n. 3
0
 internal static SpecialOperatorDefinition Create(string text, int precedence, SpecialOperatorType operatorType, TokenType argumentSeperator,
                                                  TokenType endingText, int minArguments, int maxArguments = int.MaxValue)
 {
     return(Create(text, null, precedence, operatorType, argumentSeperator, endingText, minArguments, maxArguments));
 }
Esempio n. 4
0
        internal static SpecialOperatorDefinition Create(string text, TokenType?secondaryTokenType, int precedence, SpecialOperatorType operatorType, TokenType argumentSeperator,
                                                         TokenType endingText, int minArguments, int maxArguments = int.MaxValue)
        {
            if (minArguments < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(minArguments), minArguments,
                                                      string.Format(
                                                          CultureInfo.InvariantCulture,
                                                          ExpressionParserStrings.ResourceManager.GetString("OperatorError_MinArgsInvalid", CultureInfo.InvariantCulture),
                                                          nameof(minArguments)
                                                          )
                                                      );
            }

            if (maxArguments < minArguments)
            {
                throw new ArgumentOutOfRangeException(nameof(maxArguments), maxArguments,
                                                      string.Format(
                                                          CultureInfo.InvariantCulture,
                                                          ExpressionParserStrings.ResourceManager.GetString("OperatorError_MaxArgsInvalid", CultureInfo.InvariantCulture),
                                                          nameof(maxArguments), nameof(minArguments)
                                                          )
                                                      );
            }
            return(new SpecialOperatorDefinition(text, secondaryTokenType, precedence, operatorType, argumentSeperator, endingText, minArguments, maxArguments));
        }
Esempio n. 5
0
 internal SpecialOperator(Token token, SpecialOperatorType operatorType) : base(token)
 {
     OperatorType = operatorType;
 }
Esempio n. 6
0
 internal MethodOperatorDefinition(string startText, string endText, int precedence, SpecialOperatorType operatorType) : base(startText, precedence, OperandCount.Binary)
 {
     EndText      = endText;
     OperatorType = operatorType;
 }