summaryrefslogtreecommitdiff
path: root/javascripts/Nfa.js
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2010-05-23 04:29:05 +0200
committerPatrick Simianer <p@simianer.de>2010-05-23 04:29:05 +0200
commit3d9e4d9737fdb534b07638ff5d47b0e74922fe7b (patch)
tree03ffdab43f93be5fcc20d983cef10e4c4c015b1e /javascripts/Nfa.js
parent2ca46da6f7995cf6d8e79f72ccb51a5919b47328 (diff)
implemented labels, arrow heads and began animation; things a little slower now
Diffstat (limited to 'javascripts/Nfa.js')
-rw-r--r--javascripts/Nfa.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/javascripts/Nfa.js b/javascripts/Nfa.js
index 2edc4b7..a214700 100644
--- a/javascripts/Nfa.js
+++ b/javascripts/Nfa.js
@@ -1,6 +1,6 @@
/*
* Nfa
- *
+ * NFA consisting of several NfaStates, following Thompson's algorithm.
*/
function Nfa(symbol) {
this.startState = null;
@@ -13,13 +13,13 @@ function Nfa(symbol) {
};
};
-//
+// Accessor functions.
Nfa.prototype.getStartState = function() { return this.startState; };
Nfa.prototype.setStartState = function(s) { this.startState = s; };
Nfa.prototype.getFinalState = function() { return this.finalState; };
Nfa.prototype.setFinalState = function(s) { this.finalState = s; };
-//
+// Concatenations: ab
Nfa.prototype.concat = function(nfa) {
this.getFinalState().setFollowUp(0, nfa.getStartState());
this.setFinalState(nfa.getFinalState());
@@ -27,7 +27,7 @@ Nfa.prototype.concat = function(nfa) {
return this;
};
-//
+// Union: (a|b)
Nfa.prototype.union = function(nfa) {
var s = new NfaState();
var t = new NfaState();
@@ -44,7 +44,7 @@ Nfa.prototype.union = function(nfa) {
return this;
};
-//
+// Kleene Star: a*
Nfa.prototype.kleene = function() {
var s = new NfaState();
var t = new NfaState();