1 instantiation of MatchingState
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (1)
256state = new MatchingState<TSet>(key.Node, key.PrevCharKind);
59 references to MatchingState
System.Text.RegularExpressions (59)
System\Text\RegularExpressions\Symbolic\MatchingState.cs (1)
172obj is MatchingState<TSet> s && PrevCharKind == s.PrevCharKind && Node.Equals(s.Node);
System\Text\RegularExpressions\Symbolic\MatchReversal.cs (2)
12internal MatchReversalInfo(MatchReversalKind kind, int fixedLength, MatchingState<TSet>? adjustedStartState = null) 37internal MatchingState<TSet>? AdjustedStartState { get; }
System\Text\RegularExpressions\Symbolic\StateFlags.cs (1)
9/// for every state, for which they are created by <see cref="MatchingState{TSet}.BuildStateFlags(bool)"/>.
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (18)
29private readonly Dictionary<(SymbolicRegexNode<TSet> Node, uint PrevCharKind), MatchingState<TSet>> _stateCache = []; 36private MatchingState<TSet>?[] _stateArray; 46/// _nullabilityArray[stateId] == the <see cref="MatchingState{TSet}.NullabilityInfo"/> for that state. 127private Span<int> GetDeltasFor(MatchingState<TSet> state) 141private Span<int[]?> GetNfaDeltasFor(MatchingState<TSet> state) 165private MatchingState<TSet> GetOrCreateState(SymbolicRegexNode<TSet> node, uint prevCharKind) 250private MatchingState<TSet> GetOrCreateState_NoLock(SymbolicRegexNode<TSet> node, uint prevCharKind, bool isInitialState = false) 254if (!_stateCache.TryGetValue(key, out MatchingState<TSet>? state)) 281/// <see cref="MatchingState{TSet}"/> allocated with <see cref="GetOrCreateState(SymbolicRegexNode{TSet}, uint)"/>, 299MatchingState<TSet> coreState = GetOrCreateState(node, prevCharKind); 339/// <summary>Gets the <see cref="MatchingState{TSet}"/> corresponding to the given state ID.</summary> 340private MatchingState<TSet> GetState(int stateId) 343MatchingState<TSet>? state = _stateArray[stateId]; 358private bool TryCreateNewTransition(MatchingState<TSet> sourceState, int mintermId, int offset, bool checkThreshold, long timeoutOccursAt, [NotNullWhen(true)] out MatchingState<TSet>? nextState) 364MatchingState<TSet>? targetState = _stateArray[_dfaDelta[offset]]; 401MatchingState<TSet> coreState = GetState(coreId); 430MatchingState<TSet> coreState = GetState(GetCoreStateId(nfaStateId));
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (12)
100private readonly MatchingState<TSet>[] _initialStates; 104private readonly MatchingState<TSet>[] _dotstarredInitialStates; 108private readonly MatchingState<TSet>[] _reverseInitialStates; 190_stateArray = new MatchingState<TSet>[InitialDfaStateCapacity]; 228var initialStates = new MatchingState<TSet>[statesCount]; 238var dotstarredInitialStates = new MatchingState<TSet>[statesCount]; 258var reverseInitialStates = new MatchingState<TSet>[statesCount]; 1008MatchingState<TSet> initialState = _initialStates[GetCharKind(input, i - 1)]; 1083MatchingState<TSet> endState = GetState(GetCoreStateId(endStateId)); 1216public void InitializeFrom(SymbolicRegexMatcher<TSet> matcher, MatchingState<TSet> dfaMatchingState) 1232public CurrentState(MatchingState<TSet> dfaState) 1285if (matcher.TryCreateNewTransition(matcher.GetState(dfaStateId), mintermId, dfaOffset, checkThreshold: true, timeoutOccursAt, out MatchingState<TSet>? nextState))
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Dgml.cs (8)
31foreach (MatchingState<TSet> state in _stateCache.Values) 51foreach (MatchingState<TSet> initialState in GetInitialStates(this)) 76foreach (MatchingState<TSet> state in _stateCache.Values) 147foreach (MatchingState<TSet> source in matcher._stateCache.Values) 203static IEnumerable<MatchingState<TSet>> GetInitialStates(SymbolicRegexMatcher<TSet> matcher) 205foreach (MatchingState<TSet> state in matcher._dotstarredInitialStates) 207foreach (MatchingState<TSet> state in matcher._initialStates) 209foreach (MatchingState<TSet> state in matcher._reverseInitialStates)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Explore.cs (17)
19HashSet<MatchingState<TSet>> seen = new(); 22Queue<MatchingState<TSet>> toExplore = new(); 37MatchingState<TSet> state = toExplore.Peek(); 46if (!TryCreateNewTransition(state, mintermId, offset, true, 0, out MatchingState<TSet>? nextState)) 63MatchingState<TSet>[] toBreakUp = toExplore.ToArray(); 65foreach (MatchingState<TSet> dfaState in toBreakUp) 71static (int nfaId, (SymbolicRegexMatcher<TSet> Matcher, HashSet<MatchingState<TSet>> Seen, Queue<MatchingState<TSet>> ToExplore) args) => 73MatchingState<TSet>? coreState = args.Matcher.GetState(args.Matcher.GetCoreStateId(nfaId)); 81MatchingState<TSet> state = toExplore.Dequeue(); 98static void EnqueueAll(MatchingState<TSet>[] states, HashSet<MatchingState<TSet>> seen, Queue<MatchingState<TSet>> toExplore) 100foreach (MatchingState<TSet> state in states) 106static void EnqueueIfUnseen(MatchingState<TSet> state, HashSet<MatchingState<TSet>> seen, Queue<MatchingState<TSet>> queue)