Perform an early removeRedundancy call on graph

This allows sibling character classes to be merged together before graph
component splitting is done by calcComponents().

In particular, this transforms (A|a)(B|b)(C|c) into [Aa][Bb][Cc]
earlier.
This commit is contained in:
Justin Viiret 2015-12-10 15:35:12 +11:00 committed by Matthew Barr
parent 86a52971ca
commit 326abeb3ee

View File

@ -402,6 +402,13 @@ bool NG::addGraph(NGWrapper &w) {
dumpDotWrapper(w, "03_early", cc.grey);
// Perform a reduction pass to merge sibling character classes together.
if (cc.grey.performGraphSimplification) {
removeRedundancy(w, som);
}
dumpDotWrapper(w, "04_reduced", cc.grey);
// If we've got some literals that span the graph from start to accept, we
// can split them off into Rose from here.
if (!som) {