Continued... Show file and line info when possible on internal graph errors.

This commit is contained in:
Wilson Snyder
2018-07-14 20:44:43 -04:00
parent 22939d7473
commit 43694ec87c
6 changed files with 32 additions and 14 deletions
+6 -4
View File
@@ -40,11 +40,11 @@ DfaVertex* DfaGraph::findStart() {
for (V3GraphVertex* vertexp = this->verticesBeginp(); vertexp; vertexp=vertexp->verticesNextp()) {
if (DfaVertex* vvertexp = dynamic_cast<DfaVertex*>(vertexp)) {
if (vvertexp->start()) {
if (startp) v3fatalSrc("Multiple start points in NFA graph");
if (startp) vertexp->v3fatalSrc("Multiple start points in NFA graph");
startp = vvertexp;
}
} else {
v3fatalSrc("Non DfaVertex in DfaGraph");
vertexp->v3fatalSrc("Non DfaVertex in DfaGraph");
}
}
if (!startp) v3fatalSrc("No start point in NFA graph");
@@ -116,7 +116,9 @@ private:
DfaVertex* nfaStatep = static_cast<DfaVertex*>(dfaEdgep->top());
hash ^= hashVertex(nfaStatep);
if (debug()) {
if (nfaStatep->user()==m_step) v3fatalSrc("DFA state points to duplicate NFA state.");
if (nfaStatep->user()==m_step) {
nfaStatep->v3fatalSrc("DFA state points to duplicate NFA state.");
}
nfaStatep->user(m_step);
}
}
@@ -444,7 +446,7 @@ private:
vertexp->user(1);
} else {
// If ever remove this, need dyn cast below
v3fatalSrc("Non DfaVertex in dfa graph");
vertexp->v3fatalSrc("Non DfaVertex in dfa graph");
}
}