Example #1
0
 internal WindowFuncExpr(Identifier serverName
                         , Identifier databaseName
                         , Identifier schemaName
                         , Identifier name
                         , QuantifierType quantifier
                         , bool hasWildcard
                         , Exprs arguments
                         , PartitionBy partitionBy
                         , OrderBy orderBy
                         , Comments comments)
 {
     this.Comments    = comments;
     _serverName      = serverName;
     _dataBaseName    = databaseName;
     _schemaName      = schemaName;
     _name            = name;
     _quantifier      = quantifier;
     _hasWildcard     = hasWildcard;
     this.Arguments   = arguments;
     this.PartitionBy = partitionBy;
     this.OrderBy     = orderBy;
     //
     if (this.PartitionBy != null)
     {
         this.PartitionBy.Parent = this;
     }
     if (this.OrderBy != null)
     {
         this.OrderBy.Parent = this;
     }
 }
Example #2
0
 public Quantifier(int min, int max, bool lazy)
 {
     _type = QuantifierType.Brace;
     if (lazy)
     {
         _type |= QuantifierType.Lazy;
     }
     _min = min;
     _max = max;
     if (min == Infinity)
     {
         if (max == Infinity)
         {
             throw new ArgumentException("UnknownQuantifierDefinition");
         }
         _type |= QuantifierType.SingleDef;
     }
     else
     {
         if (max == Infinity)
         {
             _type |= QuantifierType.HalfDef;
         }
         else
         {
             _type |= QuantifierType.RangeDef;
         }
     }
 }
Example #3
0
 public WindowFuncExpr(Identifier serverName
                       , Identifier databaseName
                       , Identifier schemaName
                       , Identifier name
                       , QuantifierType quantifier
                       , PartitionBy partitionBy
                       , OrderBy orderBy)
 {
     this.Comments     = new Comments(7 + quantifier != QuantifierType.None? 0 : 1);
     this.ServerName   = serverName;
     this.DataBaseName = databaseName;
     this.SchemaName   = schemaName;
     this.Name         = name;
     this.Quantifier   = quantifier;
     this.HasWildcard  = true;
     this.Arguments    = new Exprs();
     this.PartitionBy  = partitionBy;
     this.OrderBy      = orderBy;
     //
     if (this.PartitionBy != null)
     {
         this.PartitionBy.Parent = this;
     }
     if (this.OrderBy != null)
     {
         this.OrderBy.Parent = this;
     }
 }
        protected QuantifierToken(QuantifierType type, bool isLazy)
        {
            Type   = type;
            IsLazy = isLazy;
            switch (type)
            {
            case QuantifierType.Optional:
                TokenType = IsLazy ? RegexTokenType.LazyOptionalQuantifier : RegexTokenType.GreedyOptionalQuantifier;
                break;

            case QuantifierType.OptionalRepeat:
                TokenType = IsLazy ? RegexTokenType.LazyOptionalRepeatQuantifier : RegexTokenType.GreedyOptionalRepeatQuantifier;
                break;

            case QuantifierType.Multiple:
                TokenType = IsLazy ? RegexTokenType.LazyMultipleQuantifier : RegexTokenType.GreedyMultipleQuantifier;
                break;

            case QuantifierType.Fixed:
                TokenType = IsLazy ? RegexTokenType.LazyFixedQuantifier : RegexTokenType.GreedyFixedQuantifier;
                break;

            case QuantifierType.MinRepeat:
                TokenType = IsLazy ? RegexTokenType.LazyMinRepeatQuantifier : RegexTokenType.GreedyMinRepeatQuantifier;
                break;

            default:
                TokenType = IsLazy ? RegexTokenType.LazyLimitedQuantifier : RegexTokenType.GreedyLimitedQuantifier;
                break;
            }
        }
        internal SingleQueryClause(QuantifierType quantifier
                                   , bool hasTop
                                   , int top
                                   , bool hasWildcard
                                   , ResultColumns results
                                   , IFromSource from
                                   , Predicate where
                                   , GroupBy groupBy
                                   , Predicate having
                                   , Comments comments)
        {
            _quantifier   = quantifier;
            _hasTop       = hasTop;
            this.Top      = top;
            _hasWildcard  = hasWildcard;
            this.Results  = results;
            _from         = from;
            _where        = where;
            this.GroupBy  = groupBy;
            _having       = having;
            this.Comments = comments;
            //this.IsSubQuery = true;

            this.SetParent(from);
            this.SetParent(where);
            this.SetParent(having);
        }
Example #6
0
        public Quantifier(char special, bool lazy)
        {
            switch (special)
            {
            case '+':
                _type = QuantifierType.Plus;
                break;

            case '*':
                _type = QuantifierType.Star;
                break;

            case '?':
                _type = QuantifierType.Question;
                break;

            default:
                _type = QuantifierType.Invalid;
                break;
            }
            if (lazy)
            {
                _type |= QuantifierType.Lazy;
            }
        }
        public SimpleQualifierToken(QuantifierType type, bool isLazy)
            : base(type, isLazy)
        {
            switch (type)
            {
            case QuantifierType.Optional:
            case QuantifierType.OptionalRepeat:
            case QuantifierType.Multiple:
                break;

            default:
                throw new ArgumentOutOfRangeException("tokenType");
            }
        }
Example #8
0
 internal AggregateFuncExpr(string name
                            , QuantifierType quantifier
                            , bool wildcard
                            , Expr argument1
                            , Expr argument2
                            , Comments comments)
 {
     this.Comments   = comments;
     this.Name       = name;
     this.Quantifier = quantifier;
     this.Wildcard   = wildcard;
     this.Argument1  = argument1;
     this.Argument2  = argument2;
 }
Example #9
0
 internal SingleQuery(QuantifierType quantifier
                      , bool hasTop
                      , int top
                      , bool hasWildcard
                      , ResultColumns results
                      , IFromSource from
                      , Predicate where
                      , GroupBy groupBy
                      , Predicate having
                      , OrderBy orderBy
                      , ILimitClause limit
                      , Comments comments)
     : base(quantifier, hasTop, top, hasWildcard, results, from, where, groupBy, having, comments)
 {
     this.OrderBy = orderBy;
     this.Limit   = limit;
     //this.IsSubQuery = true;
 }
Example #10
0
            private IQuantifiedExpression GetQuantifier(QuantifierType type, IExpression expression)
            {
                ++index; // swallow '*', '+', '?' or '{'
                int min = 0;
                int?max = null;

                if (type == QuantifierType.Explicit)
                {
                    (min, max) = GetQuantifierRange();
                }
                bool isGreedy = (index == regex.Length || regex[index] != '?') ? true : false;

                if (!isGreedy)
                {
                    ++index;
                }
                switch (type)
                {
                case QuantifierType.ZeroOrMore: return(Quantifiers.ZeroOrMore(expression, isGreedy));

                case QuantifierType.OneOrMore: return(Quantifiers.OneOrMore(expression, isGreedy));

                case QuantifierType.ZeroOrOne: return(Quantifiers.ZeroOrOne(expression, isGreedy));

                case QuantifierType.Explicit:
                {
                    if (max == null)
                    {
                        return(Quantifiers.AtLeast(expression, min, isGreedy));
                    }
                    else if (min == max.Value)
                    {
                        return(Quantifiers.Exactly(expression, min, isGreedy));
                    }
                    else
                    {
                        return(Quantifiers.Between(expression, min, max.Value, isGreedy));
                    }
                }

                default: throw new InvalidOperationException();
                }
            }
Example #11
0
        public AggregateFuncExpr(string name
                                 , QuantifierType quantifier
                                 , bool wildcard
                                 , Expr argument1
                                 , Expr argument2)
        {
            this.Name       = name;
            this.Quantifier = quantifier;
            this.Wildcard   = wildcard;
            this.Argument1  = argument1;
            this.Argument2  = argument2;

            var c = CountTrue(this.Quantifier != QuantifierType.None
                              , this.Wildcard
                              , this.Argument2 != null // Commaの有無
                              );

            this.Comments = new Comments(c + 3);
        }
Example #12
0
 internal Quantifier(QuantifierType quantifierType)
 {
     QuantifierType = quantifierType;
 }
Example #13
0
 public Quantifier(string label, IMembershipFunction membership, QuantifierType type, double xmin, double xmax) : base(label, membership, xmin, xmax)
 {
     Type = type;
 }
Example #14
0
 internal Quantifier(QuantifierType quantifierType, long cardinality)
 {
     QuantifierType = quantifierType;
     Cardinality    = cardinality;
 }
Example #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Quantifier"/> class.
 /// </summary>
 /// <param name="variable">Name of variable to replace.</param>
 /// <param name="type">Type of quantifier.</param>
 /// <param name="bindings">Possible bindings for variable.</param>
 public Quantifier(string variable, QuantifierType type, IEnumerable <string> bindings)
 {
     Variable = variable;
     Type     = type;
     Bindings = bindings;
 }
Example #16
0
 internal Quantifier(QuantifierType quantifierType, long minCardinality, long maxCardinality)
 {
     QuantifierType = quantifierType;
     MinCardinality = minCardinality;
     MaxCardinality = maxCardinality;
 }
Example #17
0
 public Quantifier(string description, IMembershipFunction membershipFunction, QuantifierType type, double minValueOfColumn, double maxValueOfColumn) : base(description, membershipFunction, minValueOfColumn, maxValueOfColumn)
 {
     Type       = type;
     IsAbsolute = Type == QuantifierType.Absolute ? true : false;
 }
Example #18
0
 public Quantifier(QuantifierType type)
 {
     _type = type;
 }