130 likes | 235 Views
Finite Automata. COP 3402 System Software Spring 2008. A Sample Automata. 1 is the start state 4 is the final state abc : recognized abccabc : recognized ac : not recognized. a. b. c. a. 1. 2. 3. 4. c. Identifiers and Keywords. A-Za-z. 1. 2. A-Za-z 0-9.
E N D
Finite Automata COP 3402 System Software Spring 2008
A Sample Automata • 1 is the start state • 4 is the final state • abc : recognized • abccabc : recognized • ac : not recognized a b c a 1 2 3 4 c
Identifiers and Keywords A-Za-z 1 2 A-Za-z 0-9
Identifiers and Keywords 2 • Allows character ‘-’, e.g. Next_Line • Can not begin with ‘-’ • Can not have consecutive ‘-’ A-Za-z - 1 2 3 A-Za-z 0-9 A-Z 0-9
Integers • Can begin with 0, e.g. 000025 0-9 1 2 0-9
Integers 2 • Can not begin with 0 • Except integer 0, followed by space 0-9 1 2 0 space 3 4 0-9
. 0-9 1 2 4 Float Point Number • Can begin with “0” , e.g. 001.35 • Can end with “.”, e.g. 12. • Can end with “0”, e.g. 3.1400 0-9 0-9
All-In-One Automata A-Za-z . 1 2 3 0-9 4 ;,+-*() 5 : = 6 7 0-9 A-Za-z 0-9
All-In-One Automata A-Za-z . 1 2 3 0-9 4 ;,+-*() 5 : = 6 7 0-9 A-Za-z 0-9
Reserved Words n u l . l 0 33 34 35 1 b e g . i 36 37 38 39 n 21 e n d 40 41 22 i f 42 23
Special Symbols + 4 - 5 * 0 6 / 7 = 9 ( 15