diff options
| author | Patrick Simianer <p@simianer.de> | 2010-05-13 03:19:48 +0200 | 
|---|---|---|
| committer | Patrick Simianer <p@simianer.de> | 2010-05-13 03:19:48 +0200 | 
| commit | ec3f1801c258dbba07dfccbd9864f9b2de0bfae6 (patch) | |
| tree | 95397dc4e009ddd8c6e5a361e9d0df9e06bff1d6 /javascripts/RegexVis.js | |
| parent | 072e9069333ce9fdf7f575b5f9fd54277a76912f (diff) | |
some advancement
Diffstat (limited to 'javascripts/RegexVis.js')
| -rw-r--r-- | javascripts/RegexVis.js | 77 | 
1 files changed, 0 insertions, 77 deletions
diff --git a/javascripts/RegexVis.js b/javascripts/RegexVis.js deleted file mode 100644 index c14f52f..0000000 --- a/javascripts/RegexVis.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * RegexParser - * - */ -function RegexParser(str) { -    this.str = str; -} - -RegexParser.prototype.parse = function() { -    for (var i = 0; i < this.str.length; i++) { -        switch(this.str[i]) { -            case '(': -                break; -            case '|': -                break; -            case ')': -                break -            case '*': -                break -             -            default: -                //alert(this.str[i]); -        } -    }; -} - - -/* - * State - * - */ -function State(symbol) { -    if(!symbol) { -        symbol = '#'; -    } -    this.symbol    = symbol; -    this.followUps = []; -    this.marked    = false; -} - -State.prototype.mark = function(b) { -    this.marked = b; -} - -State.prototype.setFollowUp = function(index, state) { -    if (!((index == 0) || (index==1)) ) return; -    this.followUps[index] = state; -} - - -/* - * Nfa - * - */ -function Nfa(symbol) { -    this.startState; -    this.endState; -    if (symbol) { -        this.startState = new State(symbol); -        this.endState   = new State(false); -        this.startState.setFollowUp(0, this.endState); -    } -} - -Nfa.prototype.concatination = function(nfa) { -    this.endState.setFollowUp(0, nfa); -    this.endState = nfa.endState; -} - -Nfa.prototype.union = function(nfa) { -    var s0 = new State(); -    var s1 = new State(); - -    s0.setFollowUp(0, ); -    s1.setFollowUp(1, ); -} -  | 
