Jianguo Lu : regular expression and automata
Jianguo Lu 2 Try RegexTester Running at course web site as an applet; – Write regular expressions and try the match(), find() methods; Try the string 3314 instead of 3.14
Jianguo Lu 3 Try FSM simulator Run the simulator –The java code can be downloaded at –Unzip the zip file >unzip fsm.zip –Go to the directory fsmsim_bgm/classes –Run the java program: >java FSM Define the FSM in the text file; –The text files are in fsm-sources Generate the transition diagram; –Machine/new machine Run the simulator and observe how strings are recognized.
Jianguo Lu 4 select “save target as”
Jianguo Lu 5 Construct and run a dfa from a text file
Jianguo Lu 6 NFA //Type (a|b)*abb Fig in dragon book a b // input alphabet q0 q1 q2 q3 // Machine states q0// the initial state q3 // final state q0 b q0 // transitions: input state, input symbol, output state q3 b q0 q1 a q1 q2 a q1 q3 a q1 q0 a q1 q1 b q2 q2 b q3 end
Jianguo Lu 7
8
9
10 Construct a dfa in GUI
Jianguo Lu 11
Jianguo Lu 12 JFLAP: RE NFA DFA m. DFA
Jianguo Lu 13
Jianguo Lu 14
Jianguo Lu 15
Jianguo Lu 16
Jianguo Lu 17
Jianguo Lu 18
Jianguo Lu 19
Jianguo Lu 20
Jianguo Lu 21
Jianguo Lu 22