0.0.21 • Published 10 years ago

fsajs v0.0.21

Weekly downloads
5
License
MIT
Repository
github
Last release
10 years ago

fsajs

Library for creating finite state automata and testing if they accept a given string.

fsajs = require('fsajs').fsajs # import the module

fsa = fsajs.createFSA() # configure fsa
	.addState 
	  name: 'pepe' 
	  transitions:[{stateName:'other', symbol:'c'},{stateName:'otherState', symbol:'b'}]
	  initialState: true
	.addState 
	  name: 'otherState', 
	  transitions:[{stateName:'other', symbol:'c'},{stateName:'otherState', symbol:'b'}], 
	  finalState: true
	.addState 
	  name: 'other', 
	  transitions:[{stateName:'pepe', symbol:'c'},{stateName:'otherState', symbol:'b'}] 

fsa.acceptsString 'bcccb' # returns true 

fsa.acceptsString 'bccbb' # returns false 
0.0.21

10 years ago

0.0.2

10 years ago

0.0.15

10 years ago

0.0.14

10 years ago

0.0.131

10 years ago

0.0.13

10 years ago

0.0.122

10 years ago

0.0.121

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago