53 references to CharKind
System.Text.RegularExpressions (53)
System\Text\RegularExpressions\Symbolic\MatchingState.cs (9)
34/// this will always be set to <see cref="CharKind.General"/>, which can reduce the number of states created. 59Debug.Assert(CharKind.IsValidCharKind(nextCharKind)); 60uint context = CharKind.Context(PrevCharKind, nextCharKind); 77uint context = CharKind.Context(PrevCharKind, nextCharKind); 93uint context = CharKind.Context(PrevCharKind, nextCharKind); 107Debug.Assert(nextCharKind is >= 0 and < CharKind.CharKindCount); 162for (uint charKind = 0; charKind < CharKind.CharKindCount; charKind++) 164nullabilityInfo |= (byte)(Node.IsNullableFor(CharKind.Context(PrevCharKind, charKind)) ? 1 << (int)charKind : 0); 179$"({CharKind.DescribePrev(PrevCharKind)},{Node})";
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (11)
117/// Character kinds <see cref="CharKind"/> for all minterms in <see cref="_minterms"/> as well as two special 218int statesCount = _pattern._info.ContainsSomeAnchor ? CharKind.CharKindCount : 1; 221Debug.Assert(CharKind.General == 0); 251_initialStateId = _dotstarredInitialStates[CharKind.General].Id; 275return CharKind.BeginningEnd; 282return CharKind.NewLineS; 291return CharKind.Newline; 297return CharKind.WordLetter; 302return CharKind.General; 335CharKind.General : // The previous character kind is irrelevant when anchors are not used. 1088CharKind.Context(endState.PrevCharKind, GetCharKind(input, iEnd)), (Registers: endRegisters, Pos: iEnd));
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Dgml.cs (1)
33string info = CharKind.DescribePrev(state.PrevCharKind);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Sample.cs (4)
90if (flags.IsNullable() || SymbolicRegexMatcher<TSet>.NfaStateHandler.IsNullableFor(this, in statesWrapper, CharKind.BeginningEnd)) 96if (SymbolicRegexMatcher<TSet>.NfaStateHandler.IsNullableFor(this, in statesWrapper, CharKind.Newline)) 102if (SymbolicRegexMatcher<TSet>.NfaStateHandler.IsNullableFor(this, in statesWrapper, CharKind.WordLetter)) 108if (SymbolicRegexMatcher<TSet>.NfaStateHandler.IsNullableFor(this, in statesWrapper, CharKind.General))
System\Text\RegularExpressions\Symbolic\SymbolicRegexNode.cs (28)
71_nullabilityCache = info.StartsWithSomeAnchor && info.CanBeNullable ? new byte[CharKind.ContextLimit] : null; 244Debug.Assert(context < CharKind.ContextLimit); 273is_nullable = CharKind.Prev(context) == CharKind.BeginningEnd; 277is_nullable = CharKind.Next(context) == CharKind.BeginningEnd; 283is_nullable = (CharKind.Prev(context) & CharKind.NewLineS) != 0; 289is_nullable = (CharKind.Next(context) & CharKind.NewLineS) != 0; 294is_nullable = ((CharKind.Prev(context) & CharKind.WordLetter) ^ (CharKind.Next(context) & CharKind.WordLetter)) != 0; 299is_nullable = ((CharKind.Prev(context) & CharKind.WordLetter) ^ (CharKind.Next(context) & CharKind.WordLetter)) == 0; 305is_nullable = (CharKind.Next(context) & CharKind.BeginningEnd) != 0; 324is_nullable = (CharKind.Prev(context) & CharKind.BeginningEnd) != 0; 2093return prevKind == CharKind.BeginningEnd ? 2098return ((prevKind & CharKind.BeginningEnd) != 0) ? 2103return (prevKind == CharKind.WordLetter ? contWithNWL : contWithWL) ? 2110return (prevKind == CharKind.WordLetter ? contWithWL : contWithNWL) ? 2256/// is #(this) if there are no anchors else <see cref="CharKind.CharKindCount"/>x#(this). 2259internal int EstimateNfaSize() => Times(_info.ContainsSomeAnchor ? CharKind.CharKindCount : 1, Sum(1, CountSingletons()));