Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up NonBacktracking DgmlWriter #66363

Merged
merged 2 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<Compile Include="System\Text\RegularExpressions\Symbolic\CharKind.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\CharSetSolver.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\DerivativeEffect.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\DgmlWriter.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\DfaMatchingState.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\IBooleanAlgebra.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\ICharAlgebra.cs" />
Expand All @@ -82,10 +83,6 @@
<Compile Include="System\Text\RegularExpressions\Symbolic\SymbolicRegexSet.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\TransitionRegex.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\TransitionRegexKind.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\Dgml\DgmlWriter.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\Dgml\IAutomaton.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\Dgml\Move.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\Dgml\RegexAutomaton.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\Unicode\GeneratorHelper.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\Unicode\IgnoreCaseRelation.cs" />
<Compile Include="System\Text\RegularExpressions\Symbolic\Unicode\IgnoreCaseRelationGenerator.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,21 @@ internal static bool EnableDebugTracing
}

/// <summary>Unwind the regex and save the resulting state graph in DGML</summary>
/// <param name="bound">roughly the maximum number of states, 0 means no bound</param>
/// <param name="hideStateInfo">if true then hide state info</param>
/// <param name="addDotStar">if true then pretend that there is a .* at the beginning</param>
/// <param name="inReverse">if true then unwind the regex backwards (addDotStar is then ignored)</param>
/// <param name="onlyDFAinfo">if true then compute and save only general DFA info</param>
/// <param name="writer">dgml output is written here</param>
/// <param name="writer">Writer to which the DGML is written.</param>
/// <param name="nfa">True to create an NFA instead of a DFA.</param>
/// <param name="addDotStar">True to prepend .*? onto the pattern (outside of the implicit root capture).</param>
/// <param name="reverse">If true, then unwind the regex backwards (and <paramref name="addDotStar"/> is ignored).</param>
/// <param name="maxStates">The approximate maximum number of states to include; less than or equal to 0 for no maximum.</param>
/// <param name="maxLabelLength">maximum length of labels in nodes anything over that length is indicated with .. </param>
/// <param name="asNFA">if true creates NFA instead of DFA</param>
[ExcludeFromCodeCoverage(Justification = "Debug only")]
internal void SaveDGML(TextWriter writer, int bound, bool hideStateInfo, bool addDotStar, bool inReverse, bool onlyDFAinfo, int maxLabelLength, bool asNFA)
internal void SaveDGML(TextWriter writer, bool nfa, bool addDotStar, bool reverse, int maxStates, int maxLabelLength)
{
if (factory is not SymbolicRegexRunnerFactory srmFactory)
{
throw new NotSupportedException();
}

srmFactory._matcher.SaveDGML(writer, bound, hideStateInfo, addDotStar, inReverse, onlyDFAinfo, maxLabelLength, asNFA);
srmFactory._matcher.SaveDGML(writer, nfa, addDotStar, reverse, maxStates, maxLabelLength);
}

/// <summary>
Expand Down

This file was deleted.

This file was deleted.

Loading