An adaptable FSA simulator
暂无分享,去创建一个
The paper describes the author's experience in building applications that simulate the behaviour of finite state machine or finite state automata /FSM, FSA/ as recognizers of strings that belong to automata languages or languages defined with regular expressions or languages defined with linear grammars. The solution of two tasks is being discussed: First, the external and internal representation of the FSA transition function. Second, the implementation of an algorithm to simulate FSA behaviour. The principle to fill the transition table at run time after reading data for internal states, valid input characters and transition function produces a flexible universal table-driven adaptable FSA simulator. The program illustrates the lectures given in the COS401 Compiler Theory course at the American University in Bulgaria.
[1] Alfred V. Aho,et al. Compilers: Principles, Techniques, and Tools (2nd Edition) , 2006 .
[2] Alfred V. Aho,et al. The Theory of Parsing, Translation, and Compiling , 1972 .
[3] Ivan Stoyanov,et al. Resolving non-determinism in NFA , 2003, CompSysTech '03.