summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2010-05-18 11:43:40 +0200
committerPatrick Simianer <p@simianer.de>2010-05-18 11:43:40 +0200
commit8c183055faf4d79c3c704170bd0d22fffe2795b3 (patch)
tree65a3115c0718a5897ac701f56b9e3bb599b96329
parentb90042ebc1f37fa5f911df54ce0d3827da074892 (diff)
fixed final state bug
-rw-r--r--javascripts/Nfa2Dfa.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/javascripts/Nfa2Dfa.js b/javascripts/Nfa2Dfa.js
index f08ee86..cbdd766 100644
--- a/javascripts/Nfa2Dfa.js
+++ b/javascripts/Nfa2Dfa.js
@@ -64,17 +64,15 @@ Nfa2Dfa.prototype.do = function() {
if (!ttable[q]) {
ttable[q] = new Object();
- ttable[q].isFinal = true;
- }
-
- var isFinal = false;
- for (var zz=0; zz < x.length; zz++) {
- if (StateCmp(x.get(zz), this.acceptingState)) {
+ if(q.split('_').indexOf(''+this.getAcceptingState().id) >= 0) {
+ ttable[q].isFinal = true;
+ } else {
ttable[q].isFinal = false;
- break;
- }
+ }
}
+
+
ttable[q][a] = qq;
if (x.length > 0 && !adone) {