Exemplo 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;
 }
Exemplo n.º 2
0
 internal static SpecialOperatorDefinition Create(string text, int precedence, SpecialOperatorType operatorType)
 {
     return(new SpecialOperatorDefinition(text, null, precedence, operatorType));
 }
Exemplo 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));
 }
Exemplo 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));
        }
Exemplo n.º 5
0
 internal SpecialOperator(Token token, SpecialOperatorType operatorType) : base(token)
 {
     OperatorType = operatorType;
 }
Exemplo n.º 6
0
 internal MethodOperatorDefinition(string startText, string endText, int precedence, SpecialOperatorType operatorType) : base(startText, precedence, OperandCount.Binary)
 {
     EndText      = endText;
     OperatorType = operatorType;
 }