mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-18 18:20:35 +03:00
mcclellan: Remove the use of state numbering
McClellan and Haig only need to know which states are not participants (i.e. unused start, startDs)
This commit is contained in:
committed by
Matthew Barr
parent
5dd4aa9c13
commit
839c90594c
@@ -281,6 +281,17 @@ void dropUnusedStarts(NGHolder &g, ue2::unordered_map<NFAVertex, u32> &states) {
|
||||
}
|
||||
}
|
||||
|
||||
flat_set<NFAVertex> findUnusedStates(const NGHolder &g) {
|
||||
flat_set<NFAVertex> dead;
|
||||
if (startIsRedundant(g)) {
|
||||
dead.insert(g.start);
|
||||
}
|
||||
if (proper_out_degree(g.startDs, g) == 0) {
|
||||
dead.insert(g.startDs);
|
||||
}
|
||||
return dead;
|
||||
}
|
||||
|
||||
/** Construct a reversed copy of an arbitrary NGHolder, mapping starts to
|
||||
* accepts. */
|
||||
void reverseHolder(const NGHolder &g_in, NGHolder &g) {
|
||||
|
||||
Reference in New Issue
Block a user