From 8c183055faf4d79c3c704170bd0d22fffe2795b3 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Tue, 18 May 2010 11:43:40 +0200 Subject: fixed final state bug --- javascripts/Nfa2Dfa.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'javascripts') 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) { -- cgit v1.2.3