1 instantiation of SymbolicRegexNode
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\SymbolicRegexNode.cs (1)
85
node = new
SymbolicRegexNode
<TSet>(builder, kind, left, right, lower, upper, setOrStartSet, info);
271 references to SymbolicRegexNode
System.Text.RegularExpressions (271)
System\Text\RegularExpressions\Symbolic\MatchingState.cs (6)
13
internal MatchingState(
SymbolicRegexNode
<TSet> node, uint prevCharKind)
21
internal
SymbolicRegexNode
<TSet> Node { get; }
53
/// fixed length, <see cref="
SymbolicRegexNode
{TSet}.ResolveFixedLength(uint)"/>. The context is defined
74
internal
SymbolicRegexNode
<TSet> Next(SymbolicRegexBuilder<TSet> builder, TSet minterm, uint nextCharKind)
90
internal List<(
SymbolicRegexNode
<TSet> Node, DerivativeEffect[] Effects)> NfaNextWithEffects(SymbolicRegexBuilder<TSet> builder, TSet minterm, uint nextCharKind)
101
/// This is functionally equivalent to <see cref="
SymbolicRegexNode
{TSet}.IsNullableFor(uint)"/>, but using cached
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (24)
13
/// <summary>Provides functionality to convert <see cref="RegexNode"/>s to corresponding <see cref="
SymbolicRegexNode
{S}"/>s.</summary>
19
/// <summary>The builder to use to create the <see cref="
SymbolicRegexNode
{S}"/> nodes.</summary>
26
/// <summary>Converts the root <see cref="RegexNode"/> into its corresponding <see cref="
SymbolicRegexNode
{S}"/>.</summary>
28
/// <returns>The generated <see cref="
SymbolicRegexNode
{S}"/> that corresponds to the supplied <paramref name="root"/>.</returns>
29
internal
SymbolicRegexNode
<BDD> ConvertToSymbolicRegexNode(RegexNode root)
34
DoublyLinkedList<
SymbolicRegexNode
<BDD>> rootResult = new();
37
Stack<(RegexNode Node, DoublyLinkedList<
SymbolicRegexNode
<BDD>> Result, DoublyLinkedList<
SymbolicRegexNode
<BDD>>[]? ChildResults)> stack = new();
42
while (stack.TryPop(out (RegexNode Node, DoublyLinkedList<
SymbolicRegexNode
<BDD>> Result, DoublyLinkedList<
SymbolicRegexNode
<BDD>>[]? ChildResults) popped))
45
DoublyLinkedList<
SymbolicRegexNode
<BDD>> result = popped.Result;
46
DoublyLinkedList<
SymbolicRegexNode
<BDD>>[]? childResults = popped.ChildResults;
98
childResults[i] = new DoublyLinkedList<
SymbolicRegexNode
<BDD>>();
214
foreach (DoublyLinkedList<
SymbolicRegexNode
<BDD>> childResult in childResults)
226
SymbolicRegexNode
<BDD> or = _builder._nothing;
231
DoublyLinkedList<
SymbolicRegexNode
<BDD>> childResult = childResults[i];
234
SymbolicRegexNode
<BDD> elem = childResult.Count == 1 ?
244
SymbolicRegexNode
<BDD>.CreateAlternate(_builder, elem, or);
254
DoublyLinkedList<
SymbolicRegexNode
<BDD>> childResult = childResults[0];
257
SymbolicRegexNode
<BDD> body = childResult.Count == 1 ?
270
DoublyLinkedList<
SymbolicRegexNode
<BDD>> childResult = childResults[0];
310
SymbolicRegexNode
<BDD> ConvertSet(RegexNode node)
320
DoublyLinkedList<
SymbolicRegexNode
<BDD>>[]? CreateChildResultArray(int k) => k == 0 ? null : new DoublyLinkedList<
SymbolicRegexNode
<BDD>>[k];
System\Text\RegularExpressions\Symbolic\SymbolicRegexBuilder.cs (94)
22
internal readonly
SymbolicRegexNode
<TSet> _nothing;
23
internal readonly
SymbolicRegexNode
<TSet> _anyChar;
24
internal readonly
SymbolicRegexNode
<TSet> _anyStar;
25
internal readonly
SymbolicRegexNode
<TSet> _anyStarLazy;
27
private
SymbolicRegexNode
<TSet>? _epsilon;
28
internal
SymbolicRegexNode
<TSet> Epsilon => _epsilon ??=
SymbolicRegexNode
<TSet>.CreateEpsilon(this);
30
private
SymbolicRegexNode
<TSet>? _beginningAnchor;
31
internal
SymbolicRegexNode
<TSet> BeginningAnchor => _beginningAnchor ??=
SymbolicRegexNode
<TSet>.CreateAnchor(this, SymbolicRegexNodeKind.BeginningAnchor);
33
private
SymbolicRegexNode
<TSet>? _endAnchor;
34
internal
SymbolicRegexNode
<TSet> EndAnchor => _endAnchor ??=
SymbolicRegexNode
<TSet>.CreateAnchor(this, SymbolicRegexNodeKind.EndAnchor);
36
private
SymbolicRegexNode
<TSet>? _endAnchorZ;
37
internal
SymbolicRegexNode
<TSet> EndAnchorZ => _endAnchorZ ??=
SymbolicRegexNode
<TSet>.CreateAnchor(this, SymbolicRegexNodeKind.EndAnchorZ);
39
private
SymbolicRegexNode
<TSet>? _endAnchorZReverse;
40
internal
SymbolicRegexNode
<TSet> EndAnchorZReverse => _endAnchorZReverse ??=
SymbolicRegexNode
<TSet>.CreateAnchor(this, SymbolicRegexNodeKind.EndAnchorZReverse);
42
private
SymbolicRegexNode
<TSet>? _bolAnchor;
43
internal
SymbolicRegexNode
<TSet> BolAnchor => _bolAnchor ??=
SymbolicRegexNode
<TSet>.CreateAnchor(this, SymbolicRegexNodeKind.BOLAnchor);
45
private
SymbolicRegexNode
<TSet>? _eolAnchor;
46
internal
SymbolicRegexNode
<TSet> EolAnchor => _eolAnchor ??=
SymbolicRegexNode
<TSet>.CreateAnchor(this, SymbolicRegexNodeKind.EOLAnchor);
48
private
SymbolicRegexNode
<TSet>? _wbAnchor;
49
internal
SymbolicRegexNode
<TSet> BoundaryAnchor => _wbAnchor ??=
SymbolicRegexNode
<TSet>.CreateAnchor(this, SymbolicRegexNodeKind.BoundaryAnchor);
51
private
SymbolicRegexNode
<TSet>? _nwbAnchor;
52
internal
SymbolicRegexNode
<TSet> NonBoundaryAnchor => _nwbAnchor ??=
SymbolicRegexNode
<TSet>.CreateAnchor(this, SymbolicRegexNodeKind.NonBoundaryAnchor);
57
private readonly Dictionary<TSet,
SymbolicRegexNode
<TSet>> _singletonCache = new();
60
/// This cache is used in <see cref="
SymbolicRegexNode
{TSet}.Create"/> to keep all nodes associated with this builder
64
internal readonly Dictionary<NodeCacheKey,
SymbolicRegexNode
<TSet>> _nodeCache = new();
72
SymbolicRegexNodeKind kind,
SymbolicRegexNode
<TSet>? left,
SymbolicRegexNode
<TSet>? right,
77
public readonly
SymbolicRegexNode
<TSet>? Left = left;
78
public readonly
SymbolicRegexNode
<TSet>? Right = right;
106
/// Cache for <see cref="
SymbolicRegexNode
{TSet}.CreateDerivative(SymbolicRegexBuilder{TSet}, TSet, uint)"/> keyed by:
112
internal readonly Dictionary<(
SymbolicRegexNode
<TSet>, TSet elem, uint context),
SymbolicRegexNode
<TSet>> _derivativeCache = new();
115
/// Cache for <see cref="
SymbolicRegexNode
{TSet}.PruneLowerPriorityThanNullability(SymbolicRegexBuilder{TSet}, uint)"/> keyed by:
120
internal readonly Dictionary<(
SymbolicRegexNode
<TSet>, uint),
SymbolicRegexNode
<TSet>> _pruneLowerPriorityThanNullabilityCache = new();
123
/// Cache for <see cref="
SymbolicRegexNode
{TSet}.Subsumes(SymbolicRegexBuilder{TSet},
SymbolicRegexNode
{TSet}, int)"/> keyed by:
128
internal readonly Dictionary<(
SymbolicRegexNode
<TSet>,
SymbolicRegexNode
<TSet>), bool> _subsumptionCache = new();
146
_nothing =
SymbolicRegexNode
<TSet>.CreateFalse(this);
147
_anyChar =
SymbolicRegexNode
<TSet>.CreateTrue(this);
148
_anyStar =
SymbolicRegexNode
<TSet>.CreateLoop(this, _anyChar, 0, int.MaxValue, isLazy: false);
149
_anyStarLazy =
SymbolicRegexNode
<TSet>.CreateLoop(this, _anyChar, 0, int.MaxValue, isLazy: true);
159
internal
SymbolicRegexNode
<TSet> Alternate(List<
SymbolicRegexNode
<TSet>> nodes)
161
HashSet<
SymbolicRegexNode
<TSet>> seenElems = new();
178
SymbolicRegexNode
<TSet> or = _nothing;
181
or =
SymbolicRegexNode
<TSet>.CreateAlternate(this, nodes[i], or, deduplicated: true);
192
internal
SymbolicRegexNode
<TSet> CreateConcatAlreadyReversed(IEnumerable<
SymbolicRegexNode
<TSet>> nodes)
194
SymbolicRegexNode
<TSet> result = Epsilon;
198
foreach (
SymbolicRegexNode
<TSet> node in nodes)
206
result =
SymbolicRegexNode
<TSet>.CreateConcat(this, node, result);
212
internal
SymbolicRegexNode
<TSet> CreateConcat(
SymbolicRegexNode
<TSet> left,
SymbolicRegexNode
<TSet> right) =>
SymbolicRegexNode
<TSet>.CreateConcat(this, left, right);
217
internal
SymbolicRegexNode
<TSet> CreateLoop(
SymbolicRegexNode
<TSet> node, bool isLazy, int lower = 0, int upper = int.MaxValue)
248
return
SymbolicRegexNode
<TSet>.CreateLoop(this, node._left, 0, 1, isLazy);
255
return
SymbolicRegexNode
<TSet>.CreateLoop(this, node, lower, upper, isLazy);
259
internal
SymbolicRegexNode
<TSet> CreateSingleton(TSet set)
263
ref
SymbolicRegexNode
<TSet>? result = ref CollectionsMarshal.GetValueRefOrAddDefault(_singletonCache, set, out _);
264
return result ??=
SymbolicRegexNode
<TSet>.CreateSingleton(this, set);
268
internal
SymbolicRegexNode
<TSet> CreateFixedLengthMarker(int length) =>
SymbolicRegexNode
<TSet>.CreateFixedLengthMarker(this, length);
270
internal
SymbolicRegexNode
<TSet> CreateEffect(
SymbolicRegexNode
<TSet> node,
SymbolicRegexNode
<TSet> effectNode) =>
SymbolicRegexNode
<TSet>.CreateEffect(this, node, effectNode);
272
internal
SymbolicRegexNode
<TSet> CreateCapture(
SymbolicRegexNode
<TSet> child, int captureNum) => CreateConcat(CreateCaptureStart(captureNum), CreateConcat(child, CreateCaptureEnd(captureNum)));
274
internal
SymbolicRegexNode
<TSet> CreateCaptureStart(int captureNum) =>
SymbolicRegexNode
<TSet>.CreateCaptureStart(this, captureNum);
276
internal
SymbolicRegexNode
<TSet> CreateCaptureEnd(int captureNum) =>
SymbolicRegexNode
<TSet>.CreateCaptureEnd(this, captureNum);
278
internal
SymbolicRegexNode
<TSet> CreateDisableBacktrackingSimulation(
SymbolicRegexNode
<TSet> child)
280
return child == _nothing ? _nothing :
SymbolicRegexNode
<TSet>.CreateDisableBacktrackingSimulation(this, child);
283
internal
SymbolicRegexNode
<TNewSet> Transform<TNewSet>(
SymbolicRegexNode
<TSet> node, SymbolicRegexBuilder<TNewSet> builder, Func<SymbolicRegexBuilder<TNewSet>, TSet, TNewSet> setTransformer)
333
return
SymbolicRegexNode
<TNewSet>.CreateAlternate(builder,
346
List<
SymbolicRegexNode
<TSet>> concatElements = node.ToList();
347
SymbolicRegexNode
<TNewSet>[] reverseTransformed = new
SymbolicRegexNode
<TNewSet>[concatElements.Count];
System\Text\RegularExpressions\Symbolic\SymbolicRegexInfo.cs (1)
8
/// <summary>Misc information of structural properties of a <see cref="
SymbolicRegexNode
{S}"/> that is computed bottom up.</summary>
System\Text\RegularExpressions\Symbolic\SymbolicRegexKind.cs (6)
6
/// <summary>Kinds of <see cref="
SymbolicRegexNode
{S}"/>.</summary>
39
/// <see cref="
SymbolicRegexNode
{S}._lower"/> stores the fixed length. This node is used to avoid the second phase
51
/// Effect nodes are created in the rule for concatenation in <see cref="
SymbolicRegexNode
{TSet}.CreateDerivative(SymbolicRegexBuilder{TSet}, TSet, uint)"/>,
65
/// <see cref="
SymbolicRegexNode
{TSet}.ApplyEffects"/> finds which effects would be encountered by the backtracking
70
/// <remarks><see cref="
SymbolicRegexNode
{S}._lower"/> stores the associated capture number.</remarks>
73
/// <remarks><see cref="
SymbolicRegexNode
{S}._lower"/> stores the associated capture number.</remarks>
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (17)
27
/// <see cref="
SymbolicRegexNode
{TSet}"/> and the kind of the previous character.
29
private readonly Dictionary<(
SymbolicRegexNode
<TSet> Node, uint PrevCharKind), MatchingState<TSet>> _stateCache = [];
165
private MatchingState<TSet> GetOrCreateState(
SymbolicRegexNode
<TSet> node, uint prevCharKind)
182
private MatchReversalInfo<TSet> CreateOptimizedReversal(
SymbolicRegexNode
<TSet> node)
205
SymbolicRegexNode
<TSet>? left = node._left;
250
private MatchingState<TSet> GetOrCreateState_NoLock(
SymbolicRegexNode
<TSet> node, uint prevCharKind, bool isInitialState = false)
252
SymbolicRegexNode
<TSet> prunedNode = node.PruneAnchors(_builder, prevCharKind);
253
(
SymbolicRegexNode
<TSet> Node, uint PrevCharKind) key = (prunedNode, prevCharKind);
281
/// <see cref="MatchingState{TSet}"/> allocated with <see cref="GetOrCreateState(
SymbolicRegexNode
{TSet}, uint)"/>,
293
private int? CreateNfaState(
SymbolicRegexNode
<TSet> node, uint prevCharKind)
404
SymbolicRegexNode
<TSet> targetNode = coreTargetId > 0 ?
433
List<(
SymbolicRegexNode
<TSet> Node, DerivativeEffect[] Effects)>? transition = coreState.NfaNextWithEffects(_builder, minterm, nextCharKind);
437
foreach ((
SymbolicRegexNode
<TSet> Node, DerivativeEffect[] Effects) entry in transition)
452
/// Iterates through the alternation branches <see cref="
SymbolicRegexNode
{TSet}.EnumerateAlternationBranches(SymbolicRegexBuilder{TSet})"/>
454
/// include dead ends as <see cref="CreateNfaState(
SymbolicRegexNode
{TSet}, uint)"/> will filter those out.
462
private void ForEachNfaState<T>(
SymbolicRegexNode
<TSet> node, uint prevCharKind, T arg, Action<int, T> action)
466
foreach (
SymbolicRegexNode
<TSet> nfaNode in node.EnumerateAlternationBranches(_builder))
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (8)
35
/// <summary>Builder used to create <see cref="
SymbolicRegexNode
{S}"/>s while matching.</summary>
38
/// produce new <see cref="
SymbolicRegexNode
{S}"/>s as we match. Once in NFA mode, we also use
61
internal readonly
SymbolicRegexNode
<TSet> _dotStarredPattern;
64
internal readonly
SymbolicRegexNode
<TSet> _pattern;
73
internal readonly
SymbolicRegexNode
<TSet> _reversePattern;
150
SymbolicRegexBuilder<BDD> bddBuilder,
SymbolicRegexNode
<BDD> rootBddNode, ISolver<TSet> solver,
164
SymbolicRegexNode
<TSet> rootNode = bddBuilder.Transform(rootBddNode, builder, (builder, bdd) => builder._solver.ConvertFromBDD(bdd, charSetSolver));
169
private SymbolicRegexMatcher(SymbolicRegexBuilder<TSet> builder,
SymbolicRegexNode
<TSet> rootNode, int captureCount, RegexFindOptimizations findOptimizations, TimeSpan matchTimeout)
System\Text\RegularExpressions\Symbolic\SymbolicRegexNode.cs (112)
39
internal readonly
SymbolicRegexNode
<TSet>? _left;
40
internal readonly
SymbolicRegexNode
<TSet>? _right;
62
private SymbolicRegexNode(SymbolicRegexBuilder<TSet> builder, SymbolicRegexNodeKind kind,
SymbolicRegexNode
<TSet>? left,
SymbolicRegexNode
<TSet>? right, int lower, int upper, TSet set, SymbolicRegexInfo info)
78
private static
SymbolicRegexNode
<TSet> Create(SymbolicRegexBuilder<TSet> builder, SymbolicRegexNodeKind kind,
SymbolicRegexNode
<TSet>? left,
SymbolicRegexNode
<TSet>? right, int lower, int upper, TSet? set, SymbolicRegexInfo info)
83
if (!builder._nodeCache.TryGetValue(key, out
SymbolicRegexNode
<TSet>? node))
101
private static bool IsHighPriorityNullableFor(
SymbolicRegexNode
<TSet> node, uint context)
185
public List<
SymbolicRegexNode
<TSet>> ToList(List<
SymbolicRegexNode
<TSet>>? list = null, SymbolicRegexNodeKind listKind = SymbolicRegexNodeKind.Concat)
192
static void AppendToList(
SymbolicRegexNode
<TSet> concat, List<
SymbolicRegexNode
<TSet>> list, SymbolicRegexNodeKind listKind)
200
SymbolicRegexNode
<TSet> node = concat;
378
internal static
SymbolicRegexNode
<TSet> CreateFalse(SymbolicRegexBuilder<TSet> builder) =>
381
internal static
SymbolicRegexNode
<TSet> CreateTrue(SymbolicRegexBuilder<TSet> builder) =>
384
internal static
SymbolicRegexNode
<TSet> CreateFixedLengthMarker(SymbolicRegexBuilder<TSet> builder, int length) =>
387
internal static
SymbolicRegexNode
<TSet> CreateEpsilon(SymbolicRegexBuilder<TSet> builder) =>
390
internal static
SymbolicRegexNode
<TSet> CreateAnchor(SymbolicRegexBuilder<TSet> builder, SymbolicRegexNodeKind kind)
406
internal static
SymbolicRegexNode
<TSet> CreateSingleton(SymbolicRegexBuilder<TSet> builder, TSet set) =>
409
internal static
SymbolicRegexNode
<TSet> CreateLoop(SymbolicRegexBuilder<TSet> builder,
SymbolicRegexNode
<TSet> body, int lower, int upper, bool isLazy)
422
internal static
SymbolicRegexNode
<TSet> CreateEffect(SymbolicRegexBuilder<TSet> builder,
SymbolicRegexNode
<TSet> node,
SymbolicRegexNode
<TSet> effectNode)
439
internal static
SymbolicRegexNode
<TSet> CreateCaptureStart(SymbolicRegexBuilder<TSet> builder, int captureNum) =>
442
internal static
SymbolicRegexNode
<TSet> CreateCaptureEnd(SymbolicRegexBuilder<TSet> builder, int captureNum) =>
445
internal static
SymbolicRegexNode
<TSet> CreateDisableBacktrackingSimulation(SymbolicRegexBuilder<TSet> builder,
SymbolicRegexNode
<TSet> child) =>
449
internal static
SymbolicRegexNode
<TSet> CreateConcat(SymbolicRegexBuilder<TSet> builder,
SymbolicRegexNode
<TSet> left,
SymbolicRegexNode
<TSet> right)
488
internal static
SymbolicRegexNode
<TSet> CreateAlternate(SymbolicRegexBuilder<TSet> builder,
SymbolicRegexNode
<TSet> left,
SymbolicRegexNode
<TSet> right, bool deduplicated = false, bool hintRightLikelySubsumes = false)
497
SymbolicRegexNode
<TSet> head = right._kind == SymbolicRegexNodeKind.Alternate ? right._left! : right;
498
SymbolicRegexNode
<TSet> tail = right._kind == SymbolicRegexNodeKind.Alternate ? right._right! : builder._nothing;
506
if (head.Subsumes(builder, left) && TryFoldAlternation(builder, left, head, out
SymbolicRegexNode
<TSet>? result))
516
SymbolicRegexNode
<TSet> current = right;
540
List<
SymbolicRegexNode
<TSet>> elems = left.ToList(listKind: SymbolicRegexNodeKind.Alternate);
546
HashSet<
SymbolicRegexNode
<TSet>> seenElems = [];
565
SymbolicRegexNode
<TSet> or = builder._nothing;
574
SymbolicRegexNode
<TSet> or = right;
611
internal bool Subsumes(SymbolicRegexBuilder<TSet> builder,
SymbolicRegexNode
<TSet> other, int depth = 0)
647
static bool? ApplySubsumptionRules(SymbolicRegexBuilder<TSet> builder,
SymbolicRegexNode
<TSet> left,
SymbolicRegexNode
<TSet> right, int depth)
670
SymbolicRegexNode
<TSet> rl = right._left;
674
if (TrySkipPrefix(left, rl._left, out
SymbolicRegexNode
<TSet>? tail))
684
SymbolicRegexNode
<TSet> ll = left._left;
688
if (TrySkipPrefix(right, ll._left, out
SymbolicRegexNode
<TSet>? tail))
709
static bool TrySkipPrefix(
SymbolicRegexNode
<TSet> node,
SymbolicRegexNode
<TSet> prefix, [NotNullWhen(true)] out
SymbolicRegexNode
<TSet>? tail)
747
private
SymbolicRegexNode
<TSet> UnwrapEffects()
749
SymbolicRegexNode
<TSet> current = this;
771
private static bool TryFoldAlternation(SymbolicRegexBuilder<TSet> builder,
SymbolicRegexNode
<TSet> left,
SymbolicRegexNode
<TSet> right, [NotNullWhen(true)] out
SymbolicRegexNode
<TSet>? result,
772
SymbolicRegexNode
<TSet>? rightEffects = null)
803
if (TryFoldAlternation(builder, left._left, right, out
SymbolicRegexNode
<TSet>? innerResult, rightEffects))
824
if (right._left.IsNullable && TrySplitConcatSubsumption(builder, left, right, out
SymbolicRegexNode
<TSet>? prefix))
837
static bool TrySplitConcatSubsumption(SymbolicRegexBuilder<TSet> builder,
SymbolicRegexNode
<TSet> left,
SymbolicRegexNode
<TSet> right,
838
[NotNullWhen(true)] out
SymbolicRegexNode
<TSet>? prefix)
840
List<
SymbolicRegexNode
<TSet>> prefixElements = [];
841
SymbolicRegexNode
<TSet> suffix = right;
980
public
SymbolicRegexNode
<TSet> AddFixedLengthMarkers(SymbolicRegexBuilder<TSet> builder, int lengthSoFar = 0)
1035
internal
SymbolicRegexNode
<TSet> CreateDerivativeWithoutEffects(SymbolicRegexBuilder<TSet> builder, TSet elem, uint context) => CreateDerivativeWrapper(builder, elem, context).StripEffects(builder);
1054
internal List<(
SymbolicRegexNode
<TSet>, DerivativeEffect[])> CreateNfaDerivativeWithEffects(SymbolicRegexBuilder<TSet> builder, TSet elem, uint context)
1056
List<(
SymbolicRegexNode
<TSet>, DerivativeEffect[])> transitions = [];
1064
private
SymbolicRegexNode
<TSet> CreateDerivativeWrapper(SymbolicRegexBuilder<TSet> builder, TSet elem, uint context)
1070
SymbolicRegexNode
<TSet> derivative = _left.CreateDerivative(builder, elem, context);
1077
SymbolicRegexNode
<TSet> node = PruneLowerPriorityThanNullability(builder, context);
1083
private
SymbolicRegexNode
<TSet> PruneLowerPriorityThanNullability(SymbolicRegexBuilder<TSet> builder, uint context)
1089
(
SymbolicRegexNode
<TSet>, uint) key = (this, context);
1090
if (builder._pruneLowerPriorityThanNullabilityCache.TryGetValue(key, out
SymbolicRegexNode
<TSet>? prunedNode))
1158
static
SymbolicRegexNode
<TSet> PruneLoop(SymbolicRegexBuilder<TSet> builder, uint context,
SymbolicRegexNode
<TSet> loop,
SymbolicRegexNode
<TSet> tail)
1190
SymbolicRegexNode
<TSet> skipLoopCase = CreateConcat(builder, loop._left.PruneLowerPriorityThanNullability(builder, context),
1212
private
SymbolicRegexNode
<TSet> CreateLoopContinuation(SymbolicRegexBuilder<TSet> builder)
1250
private
SymbolicRegexNode
<TSet> CreateDerivative(SymbolicRegexBuilder<TSet> builder, TSet elem, uint context)
1257
(
SymbolicRegexNode
<TSet>, TSet, uint) key = (this, elem, context);
1258
if (builder._derivativeCache.TryGetValue(key, out
SymbolicRegexNode
<TSet>? derivative))
1295
SymbolicRegexNode
<TSet> leftDerivative = builder.CreateConcat(_left.CreateDerivative(builder, elem, context), _right);
1296
SymbolicRegexNode
<TSet> rightDerivative = builder.CreateEffect(_right.CreateDerivative(builder, elem, context), _left);
1364
internal
SymbolicRegexNode
<TSet> StripEffects(SymbolicRegexBuilder<TSet> builder)
1392
List<
SymbolicRegexNode
<TSet>> elems = ToList(listKind: SymbolicRegexNodeKind.Alternate);
1427
internal void StripAndMapEffects(SymbolicRegexBuilder<TSet> builder, uint context, List<(
SymbolicRegexNode
<TSet>, DerivativeEffect[])> alternativesAndEffects,
1471
(
SymbolicRegexNode
<TSet> node, DerivativeEffect[] effects) = alternativesAndEffects[i];
1509
(
SymbolicRegexNode
<TSet> node, DerivativeEffect[] effects) = alternativesAndEffects[i];
1768
static void ToStringGrouped(
SymbolicRegexNode
<TSet> node, StringBuilder sb)
1871
SymbolicRegexNode
<TSet> conc = this;
1904
public
SymbolicRegexNode
<TSet> Reverse(SymbolicRegexBuilder<TSet> builder)
1920
SymbolicRegexNode
<TSet> rev = _left.Reverse(builder);
1921
SymbolicRegexNode
<TSet> rest = _right;
1925
SymbolicRegexNode
<TSet> rev1 = rest._left.Reverse(builder);
1929
SymbolicRegexNode
<TSet> restr = rest.Reverse(builder);
2008
private static TSet ComputeStartSet(SymbolicRegexBuilder<TSet> builder, SymbolicRegexNodeKind kind,
SymbolicRegexNode
<TSet>? left,
SymbolicRegexNode
<TSet>? right)
2065
internal
SymbolicRegexNode
<TSet> PruneAnchors(SymbolicRegexBuilder<TSet> builder, uint prevKind)
2079
private
SymbolicRegexNode
<TSet> PruneAnchorsImpl(SymbolicRegexBuilder<TSet> builder, uint prevKind, bool contWithWL, bool contWithNWL)
2118
SymbolicRegexNode
<TSet> body = _left.PruneAnchorsImpl(builder, prevKind, contWithWL, contWithNWL);
2126
SymbolicRegexNode
<TSet> left1 = _left.PruneAnchorsImpl(builder, prevKind, contWithWL, contWithNWL);
2127
SymbolicRegexNode
<TSet> right1 = _left.IsNullable ? _right.PruneAnchorsImpl(builder, prevKind, contWithWL, contWithNWL) : _right;
2138
SymbolicRegexNode
<TSet> left1 = _left.PruneAnchorsImpl(builder, prevKind, contWithWL, contWithNWL);
2139
SymbolicRegexNode
<TSet> right1 = _right.PruneAnchorsImpl(builder, prevKind, contWithWL, contWithNWL);
2150
SymbolicRegexNode
<TSet> left1 = _left.PruneAnchorsImpl(builder, prevKind, contWithWL, contWithNWL);
2158
SymbolicRegexNode
<TSet> child = _left.PruneAnchorsImpl(builder, prevKind, contWithWL, contWithNWL);
2218
internal IEnumerable<
SymbolicRegexNode
<TSet>> EnumerateAlternationBranches(SymbolicRegexBuilder<TSet> builder)
2226
foreach (
SymbolicRegexNode
<TSet> element in _left.EnumerateAlternationBranches(builder))
2234
SymbolicRegexNode
<TSet> current = this;
System\Text\RegularExpressions\Symbolic\SymbolicRegexRunnerFactory.cs (1)
23
SymbolicRegexNode
<BDD> rootNode = converter.ConvertToSymbolicRegexNode(regexTree.Root);
System\Text\RegularExpressions\Symbolic\SymbolicRegexThresholds.cs (2)
11
/// <summary>Maximum number of <see cref="
SymbolicRegexNode
{TSet}"/> instances before switching over to NFA mode.</summary>
27
/// Default maximum estimated safe expansion size of a <see cref="
SymbolicRegexNode
{TSet}"/> AST