156 references to Child
System.Text.RegularExpressions.Generator (156)
RegexGenerator.cs (1)
344
if (HasCaseInsensitiveBackReferences(node.
Child
(i)))
RegexGenerator.Emitter.cs (38)
96
DescribeExpressionAsXmlComment(writer, regexMethod.Tree.Root.
Child
(0), regexMethod); // skip implicit root capture
755
RegexNode root = rm.Tree.Root.
Child
(0);
1624
node = node.
Child
(0);
1842
if (rm.Analysis.MayBacktrack(node.
Child
(i)))
1886
RegexNode child = node.
Child
(i);
1919
case RegexNodeKind.Concatenate when child.
Child
(0) == startingLiteralNode && (startingLiteralNode.Kind is RegexNodeKind.One or RegexNodeKind.Set or RegexNodeKind.Multi):
1927
RegexNode originalFirst = child.
Child
(0);
1929
child.
Child
(0).Kind is RegexNodeKind.Multi ?
1930
SliceOffMultiFirstChar(child.
Child
(0)) : // multi, so slice off the first character
2087
EmitNode(node.
Child
(i));
2283
RegexNode yesBranch = node.
Child
(0);
2284
RegexNode? noBranch = node.
Child
(1) is { Kind: not RegexNodeKind.Empty } childNo ? childNo : null;
2455
RegexNode condition = node.
Child
(0);
2459
RegexNode yesBranch = node.
Child
(1);
2460
RegexNode? noBranch = node.
Child
(2) is { Kind: not RegexNodeKind.Empty } childNo ? childNo : null;
2646
RegexNode child = node.
Child
(0);
2787
RegexNode child = node.
Child
(0);
2900
case RegexNodeKind.Atomic when !rm.Analysis.MayBacktrack(node.
Child
(0)):
2901
EmitNode(node.
Child
(0));
3002
Debug.Assert(rm.Analysis.MayBacktrack(node.
Child
(0)));
3030
Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional || rm.Analysis.MayBacktrack(node.
Child
(0)), "Expected lookaround/conditional or a child that may backtrack");
3044
EmitNode(node.
Child
(0), subsequent);
3105
RegexNode child = node.
Child
(i);
3158
EmitNode(node.
Child
(i), GetSubsequentOrDefault(i, node, subsequent), emitLengthChecksIfRequired: false);
3172
EmitNode(node.
Child
(i), GetSubsequentOrDefault(i, node, subsequent), emitLengthChecksIfRequired: emitLengthChecksIfRequired);
3185
RegexNode next = node.
Child
(i);
3788
RegexNode child = node.
Child
(0);
4377
Debug.Assert(!rm.Analysis.MayBacktrack(node.
Child
(0)), $"Expected non-backtracking node {node.Kind}");
4386
EmitNode(node.
Child
(0));
4397
RegexNode child = node.
Child
(0);
5725
RegexNodeKind.Atomic when node.
Child
(0).Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop or RegexNodeKind.Alternate => true,
5738
RegexNodeKind.ExpressionConditional when node.Parent.
Child
(0) == node => "Condition: ",
5739
RegexNodeKind.ExpressionConditional when node.Parent.
Child
(1) == node => "Matched: ",
5740
RegexNodeKind.ExpressionConditional when node.Parent.
Child
(2) == node => "Not Matched: ",
5742
RegexNodeKind.BackreferenceConditional when node.Parent.
Child
(0) == node => "Matched: ",
5743
RegexNodeKind.BackreferenceConditional when node.Parent.
Child
(1) == node => "Not Matched: ",
5770
DescribeExpressionAsXmlComment(writer, node.
Child
(i), rm, depth);
5772
node = node.
Child
(childCount - 1);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
26
RegexFindOptimizations positiveLookaheadOpts = new(positiveLookahead.
Child
(0), options, isLeadingPartial: true);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (79)
210
loopAsChild.AddChild(
Child
(0));
255
RegexNode child = node.
Child
(i);
409
RegexNode node = rootNode.
Child
(0); // skip implicit root capture node
416
node = node.
Child
(0);
421
node = node.
Child
(0);
486
node = node.
Child
(0);
497
RegexNode existingChild = node.
Child
(node.ChildCount() - 1);
518
node.
Child
(i).EliminateEndingBacktracking();
523
node = node.
Child
(0);
546
node = node.
Child
(0);
552
if (node.N == 1 || CanBeMadeAtomic(node.
Child
(0), node.
Child
(0), iterateNullableSubsequent: false, allowLazy: false))
559
node = node.
Child
(0);
616
1 =>
Child
(0),
635
u = u.
Child
(0);
661
RegexNode child =
Child
(0);
665
child = atomic.
Child
(0);
796
(child.
Child
(0).Kind is RegexNodeKind.Empty || child.
Child
(1).Kind is RegexNodeKind.Empty); // can be transformed into a ? or ??
803
child = atomic.
Child
(0);
836
RegexNode child = u.
Child
(0);
904
RegexNode child = u.
Child
(0);
1026
return
Child
(0);
1047
if (node.
Child
(1).Kind is RegexNodeKind.Empty)
1049
node = node.
Child
(0).MakeQuantifier(lazy: false, min: 0, max: 1);
1051
else if (node.
Child
(0).Kind is RegexNodeKind.Empty)
1053
node = node.
Child
(1).MakeQuantifier(lazy: true, min: 0, max: 1);
1213
RegexNode required = children[startingIndex].
Child
(0);
1233
RegexNode other = children[endingIndex].
Child
(0);
1426
ProcessOneOrMulti(branch.Kind == RegexNodeKind.Concatenate ? branch.
Child
(0) : branch, startingSpan);
1478
return alternation.ChildCount() == 1 ? alternation.
Child
(0) : alternation;
1491
RegexNode branch = Kind == RegexNodeKind.Concatenate ?
Child
(0) : this;
1528
if (
Child
(i).FindStartingLiteralNode(allowZeroWidth: false) is not RegexNode startingLiteralNode ||
1598
node = node.
Child
(0);
1691
return
Child
(0);
1698
RegexNode child =
Child
(i);
2005
Child
(i).FindAndMakeLoopsAtomic();
2036
node = node.
Child
(node.ChildCount() - 1);
2085
RegexNode loopChild = node.
Child
(0);
2088
loopChild = loopChild.
Child
(loopChild.ChildCount() - 1);
2101
!MayContainBacktracking(node.
Child
(0)))
2119
RegexNode child = node.
Child
(0);
2129
RegexNode child = node.
Child
(0);
2150
ProcessNode(node.
Child
(b), subsequent);
2170
if (Kind is RegexNodeKind.NegativeLookaround && ContainsKind(
Child
(0), [RegexNodeKind.Backreference, RegexNodeKind.BackreferenceConditional]) is false)
2176
ReplaceChild(0,
Child
(0));
2181
RegexNode node = parent.
Child
(nodeIndex);
2187
parent.ReplaceChild(nodeIndex, node.
Child
(0));
2211
RegexNode child =
Child
(0);
2270
if (ContainsKind(node.
Child
(i), kinds) is true)
2317
RegexNode condition =
Child
(0);
2320
ReplaceChild(0, condition.
Child
(0));
2325
condition =
Child
(0);
2347
node = node.
Child
(node.ChildCount() - 1);
2378
subsequent = subsequent.
Child
(0);
2405
if (!CanBeMadeAtomic(node, subsequent.
Child
(i), iterateNullableSubsequent, allowLazy: false))
2501
RegexNode loopChild = node.
Child
(0);
2631
if (MayContainBacktracking(node.
Child
(i)))
2730
return (int)Math.Min(int.MaxValue - 1, (long)M *
Child
(0).ComputeMinLength());
2737
int min =
Child
(0).ComputeMinLength();
2740
min = Math.Min(min,
Child
(i).ComputeMinLength());
2747
return Math.Min(
Child
(0).ComputeMinLength(),
Child
(1).ComputeMinLength());
2751
return Math.Min(
Child
(1).ComputeMinLength(),
Child
(2).ComputeMinLength());
2760
sum +=
Child
(i).ComputeMinLength();
2770
return
Child
(0).ComputeMinLength();
2838
if (
Child
(0).ComputeMaxLength() is int childMaxLength)
2854
if (
Child
(0).ComputeMaxLength() is not int maxLength)
2861
if (
Child
(i).ComputeMaxLength() is not int next)
2877
return
Child
(i).ComputeMaxLength() is int yes &&
Child
(i + 1).ComputeMaxLength() is int no ?
2889
if (
Child
(i).ComputeMaxLength() is not int length)
2908
return
Child
(0).ComputeMaxLength();
2970
RegexNode child =
Child
(i);
3073
RegexNode child =
Child
(childIndex);
3081
child =
Child
(exclusiveEnd);
3249
if (ExceedsMaxDepthAllowedDepth(node.
Child
(i), allowedDepth - 1))
3282
curNode = curNode.
Child
(curChild);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (36)
86
node = node.
Child
(0);
217
if (!FindPrefixesCore(node.
Child
(i), results, ignoreCase))
231
if (!FindPrefixesCore(node.
Child
(0), results, ignoreCase))
258
_ = FindPrefixesCore(node.
Child
(i), alternateBranchResults, ignoreCase);
368
if (!Process(node.
Child
(i), ref vsb))
385
Process(node.
Child
(0), ref vsb);
401
Process(node.
Child
(i), ref alternateSb);
445
if (!Process(node.
Child
(0), ref vsb))
456
return Process(node.
Child
(0), ref vsb);
494
node = node.
Child
(0);
684
return TryFindRawFixedSets(node.
Child
(0), results, ref distance, thorough);
693
TryFindRawFixedSets(node.
Child
(0), results, ref distance, thorough);
701
if (!TryFindRawFixedSets(node.
Child
(i), results, ref distance, thorough))
721
allSameSize &= TryFindRawFixedSets(node.
Child
(i), localResults, ref localDistance, thorough);
1032
return TryFindFirstOrLastCharClass(node.
Child
(0), findFirst, ref cc);
1039
return TryFindFirstOrLastCharClass(node.
Child
(0), findFirst, ref cc) switch
1057
bool? childResult = TryFindFirstOrLastCharClass(node.
Child
(i), findFirst, ref cc);
1068
bool? childResult = TryFindFirstOrLastCharClass(node.
Child
(i), findFirst, ref cc);
1087
bool? childResult = TryFindFirstOrLastCharClass(node.
Child
(i), findFirst, ref cc);
1105
return (TryFindFirstOrLastCharClass(node.
Child
(branchStart), findFirst, ref cc), TryFindFirstOrLastCharClass(node.
Child
(branchStart + 1), findFirst, ref cc)) switch
1140
node = node.
Child
(0);
1154
RegexNode firstChild = node.
Child
(0);
1157
firstChild = firstChild.
Child
(0);
1166
RegexNode nextChild = node.
Child
(1);
1174
nextChild = node.
Child
(2);
1227
nextChild = nextChild.
Child
(0);
1300
node = node.
Child
(0);
1306
FindLeadingPositiveLookahead(node.
Child
(0), ref positiveLookahead);
1314
if (!FindLeadingPositiveLookahead(node.
Child
(i), ref positiveLookahead))
1370
node = node.
Child
(0);
1385
RegexNode tmpChild = node.
Child
(i);
1416
if (node.
Child
(i).Kind is not (RegexNodeKind.Empty or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround))
1418
child = node.
Child
(i);
1481
RegexNodeKind anchor = FindLeadingOrTrailingAnchor(node.
Child
(0), leading);
1492
if (FindLeadingOrTrailingAnchor(node.
Child
(i), leading) != anchor)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexTreeAnalyzer.cs (1)
81
RegexNode child = node.
Child
(i);