IsEmpty() static private method

static private IsEmpty ( String charClass ) : bool
charClass String
return bool
示例#1
0
 internal RegexNode ReduceSet()
 {
     if (RegexCharClass.IsEmpty(this._str))
     {
         this._type = 0x16;
         this._str  = null;
     }
     else if (RegexCharClass.IsSingleton(this._str))
     {
         this._ch    = RegexCharClass.SingletonChar(this._str);
         this._str   = null;
         this._type += -2;
     }
     else if (RegexCharClass.IsSingletonInverse(this._str))
     {
         this._ch    = RegexCharClass.SingletonChar(this._str);
         this._str   = null;
         this._type += -1;
     }
     return(this);
 }
示例#2
0
        /*
         * ReduceSet:
         *
         * Simple optimization. If a set is a singleton, an inverse singleton,
         * or empty, it's transformed accordingly.
         */

        internal RegexNode ReduceSet()
        {
            // Extract empty-set, one and not-one case as special

            if (RegexCharClass.IsEmpty(_str))
            {
                _type = Nothing;
                _str  = null;
            }
            else if (RegexCharClass.IsSingleton(_str))
            {
                _ch    = RegexCharClass.SingletonChar(_str);
                _str   = null;
                _type += (One - Set);
            }
            else if (RegexCharClass.IsSingletonInverse(_str))
            {
                _ch    = RegexCharClass.SingletonChar(_str);
                _str   = null;
                _type += (Notone - Set);
            }

            return(this);
        }
示例#3
0
        /// <summary>
        /// Simple optimization. If a set is a singleton, an inverse singleton,
        /// or empty, it's transformed accordingly.
        /// </summary>
        private RegexNode ReduceSet()
        {
            // Extract empty-set, one and not-one case as special

            if (RegexCharClass.IsEmpty(Str))
            {
                NType = Nothing;
                Str   = null;
            }
            else if (RegexCharClass.IsSingleton(Str))
            {
                Ch     = RegexCharClass.SingletonChar(Str);
                Str    = null;
                NType += (One - Set);
            }
            else if (RegexCharClass.IsSingletonInverse(Str))
            {
                Ch     = RegexCharClass.SingletonChar(Str);
                Str    = null;
                NType += (Notone - Set);
            }

            return(this);
        }