summaryrefslogtreecommitdiff
path: root/javascripts/NfaState.js
blob: 6e7a4138cf8cd7160c1433eb51fb0aa8a2f61b55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * State
 *
 */
function NfaState(symbol) {
    if(!symbol) {
        this.symbol = EPSILON;
    } else {
		this.symbol = symbol;
	}
    this.followUps = [];
    this.marked    = false;
	this.id		   = NEXTSTATE++;
}

NfaState.prototype.mark = function(bool) { this.marked = bool }
NfaState.prototype.getFollowUp = function(index) { return this.followUps[index] }
NfaState.prototype.setFollowUp = function(index, state) {
    if (!((index == 0) || (index==1)) ) return;
    this.followUps[index] = state;
}