155 references to Child
System.Text.RegularExpressions.Generator (155)
RegexGenerator.cs (1)
344if (HasCaseInsensitiveBackReferences(node.Child(i)))
RegexGenerator.Emitter.cs (40)
70DescribeExpressionAsXmlComment(writer, regexMethod.Tree.Root.Child(0), regexMethod); // skip implicit root capture 729RegexNode root = rm.Tree.Root.Child(0); 1584node = node.Child(0); 1794if (rm.Analysis.MayBacktrack(node.Child(i))) 1816if (node.Child(i).FindStartingLiteralNode(allowZeroWidth: false) is not RegexNode startingLiteralNode || 1900RegexNode child = node.Child(i); 1933case RegexNodeKind.Concatenate when child.Child(0) == startingLiteralNode && (startingLiteralNode.Kind is RegexNodeKind.One or RegexNodeKind.Set or RegexNodeKind.Multi): 1941RegexNode originalFirst = child.Child(0); 1943child.Child(0).Kind is RegexNodeKind.Multi ? 1944SliceOffMultiFirstChar(child.Child(0)) : // multi, so slice off the first character 2099EmitNode(node.Child(i)); 2295RegexNode yesBranch = node.Child(0); 2296RegexNode? noBranch = node.Child(1) is { Kind: not RegexNodeKind.Empty } childNo ? childNo : null; 2467RegexNode condition = node.Child(0); 2471RegexNode yesBranch = node.Child(1); 2472RegexNode? noBranch = node.Child(2) is { Kind: not RegexNodeKind.Empty } childNo ? childNo : null; 2665RegexNode child = node.Child(0); 2761RegexNode child = node.Child(0); 2813RegexNode child = node.Child(0); 2932case RegexNodeKind.Atomic when !rm.Analysis.MayBacktrack(node.Child(0)): 2933EmitNode(node.Child(0)); 3034Debug.Assert(rm.Analysis.MayBacktrack(node.Child(0))); 3061Debug.Assert(rm.Analysis.MayBacktrack(node.Child(0)), "Expected child to potentially backtrack"); 3075EmitNode(node.Child(0), subsequent); 3136RegexNode child = node.Child(i); 3189EmitNode(node.Child(i), GetSubsequentOrDefault(i, node, subsequent), emitLengthChecksIfRequired: false); 3203EmitNode(node.Child(i), GetSubsequentOrDefault(i, node, subsequent), emitLengthChecksIfRequired: emitLengthChecksIfRequired); 3216RegexNode next = node.Child(i); 3819RegexNode child = node.Child(0); 4408Debug.Assert(!rm.Analysis.MayBacktrack(node.Child(0)), $"Expected non-backtracking node {node.Kind}"); 4417EmitNode(node.Child(0)); 4428RegexNode child = node.Child(0); 5756RegexNodeKind.Atomic when node.Child(0).Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop or RegexNodeKind.Alternate => true, 5769RegexNodeKind.ExpressionConditional when node.Parent.Child(0) == node => "Condition: ", 5770RegexNodeKind.ExpressionConditional when node.Parent.Child(1) == node => "Matched: ", 5771RegexNodeKind.ExpressionConditional when node.Parent.Child(2) == node => "Not Matched: ", 5773RegexNodeKind.BackreferenceConditional when node.Parent.Child(0) == node => "Matched: ", 5774RegexNodeKind.BackreferenceConditional when node.Parent.Child(1) == node => "Not Matched: ", 5801DescribeExpressionAsXmlComment(writer, node.Child(i), rm, depth); 5803node = node.Child(childCount - 1);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
26RegexFindOptimizations positiveLookaheadOpts = new(positiveLookahead.Child(0), options, isLeadingPartial: true);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (76)
210loopAsChild.AddChild(Child(0)); 255RegexNode child = node.Child(i); 409RegexNode node = rootNode.Child(0); // skip implicit root capture node 416node = node.Child(0); 421node = node.Child(0); 486node = node.Child(0); 497RegexNode existingChild = node.Child(node.ChildCount() - 1); 518node.Child(i).EliminateEndingBacktracking(); 523node = node.Child(0); 546node = node.Child(0); 552if (node.N == 1 || CanBeMadeAtomic(node.Child(0), node.Child(0), iterateNullableSubsequent: false, allowLazy: false)) 559node = node.Child(0); 6161 => Child(0), 635u = u.Child(0); 661RegexNode child = Child(0); 665child = atomic.Child(0); 796(child.Child(0).Kind is RegexNodeKind.Empty || child.Child(1).Kind is RegexNodeKind.Empty); // can be transformed into a ? or ?? 803child = atomic.Child(0); 836RegexNode child = u.Child(0); 904RegexNode child = u.Child(0); 1026return Child(0); 1047if (node.Child(1).Kind is RegexNodeKind.Empty) 1049node = node.Child(0).MakeQuantifier(lazy: false, min: 0, max: 1); 1051else if (node.Child(0).Kind is RegexNodeKind.Empty) 1053node = node.Child(1).MakeQuantifier(lazy: true, min: 0, max: 1); 1222RegexNode required = children[startingIndex].Child(0); 1242RegexNode other = children[endingIndex].Child(0); 1435ProcessOneOrMulti(branch.Kind == RegexNodeKind.Concatenate ? branch.Child(0) : branch, startingSpan); 1487return alternation.ChildCount() == 1 ? alternation.Child(0) : alternation; 1500RegexNode branch = Kind == RegexNodeKind.Concatenate ? Child(0) : this; 1537node = node.Child(0); 1630return Child(0); 1637RegexNode child = Child(i); 1944Child(i).FindAndMakeLoopsAtomic(); 1975node = node.Child(node.ChildCount() - 1); 2024RegexNode loopChild = node.Child(0); 2027loopChild = loopChild.Child(loopChild.ChildCount() - 1); 2052RegexNode child = node.Child(0); 2062RegexNode child = node.Child(0); 2083ProcessNode(node.Child(b), subsequent); 2101if (Kind is RegexNodeKind.NegativeLookaround && ContainsKind(Child(0), [RegexNodeKind.Backreference, RegexNodeKind.BackreferenceConditional]) is false) 2107ReplaceChild(0, Child(0)); 2112RegexNode node = parent.Child(nodeIndex); 2116parent.ReplaceChild(nodeIndex, node.Child(0)); 2140RegexNode child = Child(0); 2199if (ContainsKind(node.Child(i), kinds) is true) 2246RegexNode condition = Child(0); 2249ReplaceChild(0, condition.Child(0)); 2254condition = Child(0); 2276node = node.Child(node.ChildCount() - 1); 2307subsequent = subsequent.Child(0); 2334if (!CanBeMadeAtomic(node, subsequent.Child(i), iterateNullableSubsequent, allowLazy: false)) 2430RegexNode loopChild = node.Child(0); 2613return (int)Math.Min(int.MaxValue - 1, (long)M * Child(0).ComputeMinLength()); 2620int min = Child(0).ComputeMinLength(); 2623min = Math.Min(min, Child(i).ComputeMinLength()); 2630return Math.Min(Child(0).ComputeMinLength(), Child(1).ComputeMinLength()); 2634return Math.Min(Child(1).ComputeMinLength(), Child(2).ComputeMinLength()); 2643sum += Child(i).ComputeMinLength(); 2653return Child(0).ComputeMinLength(); 2721if (Child(0).ComputeMaxLength() is int childMaxLength) 2737if (Child(0).ComputeMaxLength() is not int maxLength) 2744if (Child(i).ComputeMaxLength() is not int next) 2760return Child(i).ComputeMaxLength() is int yes && Child(i + 1).ComputeMaxLength() is int no ? 2772if (Child(i).ComputeMaxLength() is not int length) 2791return Child(0).ComputeMaxLength(); 2853RegexNode child = Child(i); 2956RegexNode child = Child(childIndex); 2964child = Child(exclusiveEnd); 3132if (ExceedsMaxDepthAllowedDepth(node.Child(i), allowedDepth - 1)) 3165curNode = curNode.Child(curChild);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (36)
86node = node.Child(0); 217if (!FindPrefixesCore(node.Child(i), results, ignoreCase)) 231if (!FindPrefixesCore(node.Child(0), results, ignoreCase)) 258_ = FindPrefixesCore(node.Child(i), alternateBranchResults, ignoreCase); 368if (!Process(node.Child(i), ref vsb)) 385Process(node.Child(0), ref vsb); 401Process(node.Child(i), ref alternateSb); 445if (!Process(node.Child(0), ref vsb)) 456return Process(node.Child(0), ref vsb); 494node = node.Child(0); 684return TryFindRawFixedSets(node.Child(0), results, ref distance, thorough); 693TryFindRawFixedSets(node.Child(0), results, ref distance, thorough); 701if (!TryFindRawFixedSets(node.Child(i), results, ref distance, thorough)) 721allSameSize &= TryFindRawFixedSets(node.Child(i), localResults, ref localDistance, thorough); 1032return TryFindFirstOrLastCharClass(node.Child(0), findFirst, ref cc); 1039return TryFindFirstOrLastCharClass(node.Child(0), findFirst, ref cc) switch 1057bool? childResult = TryFindFirstOrLastCharClass(node.Child(i), findFirst, ref cc); 1068bool? childResult = TryFindFirstOrLastCharClass(node.Child(i), findFirst, ref cc); 1087bool? childResult = TryFindFirstOrLastCharClass(node.Child(i), findFirst, ref cc); 1105return (TryFindFirstOrLastCharClass(node.Child(branchStart), findFirst, ref cc), TryFindFirstOrLastCharClass(node.Child(branchStart + 1), findFirst, ref cc)) switch 1140node = node.Child(0); 1154RegexNode firstChild = node.Child(0); 1157firstChild = firstChild.Child(0); 1166RegexNode nextChild = node.Child(1); 1174nextChild = node.Child(2); 1227nextChild = nextChild.Child(0); 1300node = node.Child(0); 1306FindLeadingPositiveLookahead(node.Child(0), ref positiveLookahead); 1314if (!FindLeadingPositiveLookahead(node.Child(i), ref positiveLookahead)) 1370node = node.Child(0); 1385RegexNode tmpChild = node.Child(i); 1416if (node.Child(i).Kind is not (RegexNodeKind.Empty or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround)) 1418child = node.Child(i); 1481RegexNodeKind anchor = FindLeadingOrTrailingAnchor(node.Child(0), leading); 1492if (FindLeadingOrTrailingAnchor(node.Child(i), leading) != anchor)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexTreeAnalyzer.cs (1)
85RegexNode child = node.Child(i);