System.Text.RegularExpressions.RegexNode.AddChild C# (CSharp) Method

AddChild() private method

private AddChild ( RegexNode newChild ) : void
newChild RegexNode
return void
        internal void AddChild(RegexNode newChild)
        {
            RegexNode reducedChild;

            if (_children == null)
                _children = new List<RegexNode>(4);

            reducedChild = newChild.Reduce();

            _children.Add(reducedChild);
            reducedChild._next = this;
        }

Usage Example

Esempio n. 1
0
        public RegexNode MakeQuantifier(bool lazy, int min, int max)
        {
            if (min == 0 && max == 0)
            {
                return(new RegexNode(Empty, Options));
            }

            if (min == 1 && max == 1)
            {
                return(this);
            }

            switch (NType)
            {
            case One:
            case Notone:
            case Set:
                MakeRep(lazy ? Onelazy : Oneloop, min, max);
                return(this);

            default:
                var result = new RegexNode(lazy ? Lazyloop : Loop, Options, min, max);
                result.AddChild(this);
                return(result);
            }
        }
All Usage Examples Of System.Text.RegularExpressions.RegexNode::AddChild