13 writes to Parent
System.Text.RegularExpressions.Generator (13)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (10)
1094
atChildren[k].
Parent
= this;
1101
atChild.
Parent
= this;
1750
atChildren[k].
Parent
= this;
1757
atChild.
Parent
= this;
3147
newChild.
Parent
= this; // so that the child can see its parent while being reduced
3149
newChild.
Parent
= this; // in case Reduce returns a different node that needs to be reparented
3169
newChild.
Parent
= this; // so that the child can see its parent while being reduced
3171
newChild.
Parent
= this; // in case Reduce returns a different node that needs to be reparented
3181
newChild.
Parent
= this; // so that the child can see its parent while being reduced
3183
newChild.
Parent
= this; // in case Reduce returns a different node that needs to be reparented
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (3)
2066
_group!.
Parent
= _stack;
2067
_alternation!.
Parent
= _group;
2068
_concatenation!.
Parent
= _alternation;
23 references to Parent
System.Text.RegularExpressions.Generator (23)
RegexGenerator.Emitter.cs (8)
1816
Debug.Assert(node.
Parent
is not null);
5723
RegexNodeKind.Concatenate when node.
Parent
is not { Kind: RegexNodeKind.Alternate or RegexNodeKind.BackreferenceConditional or RegexNodeKind.ExpressionConditional } => true,
5737
string tag = node.
Parent
?.Kind switch
5739
RegexNodeKind.ExpressionConditional when node.
Parent
.Child(0) == node => "Condition: ",
5740
RegexNodeKind.ExpressionConditional when node.
Parent
.Child(1) == node => "Matched: ",
5741
RegexNodeKind.ExpressionConditional when node.
Parent
.Child(2) == node => "Not Matched: ",
5743
RegexNodeKind.BackreferenceConditional when node.
Parent
.Child(0) == node => "Matched: ",
5744
RegexNodeKind.BackreferenceConditional when node.
Parent
.Child(1) == node => "Not Matched: ",
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (12)
46
/// During parsing, top-level nodes are also stacked onto a parse stack (a stack of trees) using <see cref="
Parent
"/>.
47
/// After parsing, <see cref="
Parent
"/> is the node in the tree that has this node as or in <see cref="Children"/>.
205
if (
Parent
is not { Kind: RegexNodeKind.Atomic })
256
Debug.Assert(child.
Parent
== node, $"{child.Describe()} missing reference to parent {node.Describe()}");
373
Debug.Assert(rootNode.
Parent
is null);
426
if (node.
Parent
is { Kind: RegexNodeKind.Concatenate } parent)
499
node.
Parent
is not { Kind: RegexNodeKind.Atomic }) // validate grandparent isn't atomic
1261
if (alternation.
Parent
is RegexNode { Kind: RegexNodeKind.Atomic })
1465
if (alternation.
Parent
is RegexNode parent && parent.Kind == RegexNodeKind.Atomic)
2557
RegexNode? parent = subsequent.
Parent
;
2657
node.
Parent
is not RegexNode parent)
3297
curNode = curNode.
Parent
;
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (3)
2076
_alternation = _concatenation!.
Parent
;
2077
_group = _alternation!.
Parent
;
2078
_stack = _group!.
Parent
;