1 instantiation of MatchingState
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (1)
168
state = new
MatchingState
<TSet>(key.Node, key.PrevCharKind);
58 references to MatchingState
System.Text.RegularExpressions (58)
System\Text\RegularExpressions\Symbolic\MatchingState.cs (1)
144
obj is
MatchingState
<TSet> s && PrevCharKind == s.PrevCharKind && Node.Equals(s.Node);
System\Text\RegularExpressions\Symbolic\StateFlags.cs (1)
9
/// for every state, for which they are created by <see cref="
MatchingState
{TSet}.BuildStateFlags(ISolver{TSet}, bool)"/>.
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (17)
28
private readonly Dictionary<(SymbolicRegexNode<TSet> Node, uint PrevCharKind),
MatchingState
<TSet>> _stateCache = new();
35
private
MatchingState
<TSet>?[] _stateArray;
111
private Span<int> GetDeltasFor(
MatchingState
<TSet> state)
125
private Span<int[]?> GetNfaDeltasFor(
MatchingState
<TSet> state)
149
private
MatchingState
<TSet> GetOrCreateState(SymbolicRegexNode<TSet> node, uint prevCharKind)
162
private
MatchingState
<TSet> GetOrCreateState_NoLock(SymbolicRegexNode<TSet> node, uint prevCharKind, bool isInitialState = false)
166
if (!_stateCache.TryGetValue(key, out
MatchingState
<TSet>? state))
191
/// <see cref="
MatchingState
{TSet}"/> allocated with <see cref="GetOrCreateState(SymbolicRegexNode{TSet}, uint)"/>,
209
MatchingState
<TSet> coreState = GetOrCreateState(node, prevCharKind);
249
/// <summary>Gets the <see cref="
MatchingState
{TSet}"/> corresponding to the given state ID.</summary>
250
private
MatchingState
<TSet> GetState(int stateId)
253
MatchingState
<TSet>? state = _stateArray[stateId];
269
MatchingState
<TSet> sourceState, int mintermId, int offset, bool checkThreshold, [NotNullWhen(true)] out
MatchingState
<TSet>? nextState)
276
MatchingState
<TSet>? targetState = _stateArray[_dfaDelta[offset]];
312
MatchingState
<TSet> coreState = GetState(coreId);
341
MatchingState
<TSet> coreState = GetState(GetCoreStateId(nfaStateId));
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (14)
86
private readonly
MatchingState
<TSet>[] _initialStates;
90
private readonly
MatchingState
<TSet>[] _dotstarredInitialStates;
94
private readonly
MatchingState
<TSet>[] _reverseInitialStates;
173
_stateArray = new
MatchingState
<TSet>[InitialDfaStateCapacity];
203
var initialStates = new
MatchingState
<TSet>[statesCount];
213
var dotstarredInitialStates = new
MatchingState
<TSet>[statesCount];
229
var reverseInitialStates = new
MatchingState
<TSet>[statesCount];
698
MatchingState
<TSet> initialState = _initialStates[GetCharKind<TInputReader>(input, i - 1)];
773
MatchingState
<TSet> endState = GetState(GetCoreStateId(endStateId));
899
public void InitializeFrom(SymbolicRegexMatcher<TSet> matcher,
MatchingState
<TSet> dfaMatchingState)
915
public CurrentState(
MatchingState
<TSet> dfaState)
982
if (matcher.TryCreateNewTransition(matcher.GetState(state.DfaStateId), mintermId, dfaOffset, checkThreshold: true, out
MatchingState
<TSet>? nextState))
1042
MatchingState
<TSet> coreState = matcher.GetState(matcher.GetCoreStateId(nfaState.Key));
1058
MatchingState
<TSet> coreState = matcher.GetState(matcher.GetCoreStateId(nfaState.Key));
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Dgml.cs (8)
31
foreach (
MatchingState
<TSet> state in _stateCache.Values)
51
foreach (
MatchingState
<TSet> initialState in GetInitialStates(this))
76
foreach (
MatchingState
<TSet> state in _stateCache.Values)
147
foreach (
MatchingState
<TSet> source in matcher._stateCache.Values)
203
static IEnumerable<
MatchingState
<TSet>> GetInitialStates(SymbolicRegexMatcher<TSet> matcher)
205
foreach (
MatchingState
<TSet> state in matcher._dotstarredInitialStates)
207
foreach (
MatchingState
<TSet> state in matcher._initialStates)
209
foreach (
MatchingState
<TSet> state in matcher._reverseInitialStates)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Explore.cs (17)
19
HashSet<
MatchingState
<TSet>> seen = new();
22
Queue<
MatchingState
<TSet>> toExplore = new();
37
MatchingState
<TSet> state = toExplore.Peek();
44
if (!TryCreateNewTransition(state, mintermId, offset, true, out
MatchingState
<TSet>? nextState))
57
MatchingState
<TSet>[] toBreakUp = toExplore.ToArray();
59
foreach (
MatchingState
<TSet> dfaState in toBreakUp)
65
static (int nfaId, (SymbolicRegexMatcher<TSet> Matcher, HashSet<
MatchingState
<TSet>> Seen, Queue<
MatchingState
<TSet>> ToExplore) args) =>
67
MatchingState
<TSet>? coreState = args.Matcher.GetState(args.Matcher.GetCoreStateId(nfaId));
75
MatchingState
<TSet> state = toExplore.Dequeue();
92
static void EnqueueAll(
MatchingState
<TSet>[] states, HashSet<
MatchingState
<TSet>> seen, Queue<
MatchingState
<TSet>> toExplore)
94
foreach (
MatchingState
<TSet> state in states)
100
static void EnqueueIfUnseen(
MatchingState
<TSet> state, HashSet<
MatchingState
<TSet>> seen, Queue<
MatchingState
<TSet>> queue)