Finite Automata
-
Upload
kasimir-sullivan -
Category
Documents
-
view
16 -
download
1
description
Transcript of Finite Automata
COP 3402 System SoftwareSpring 2008
1 is the start state 4 is the final state abc : recognized abccabc : recognized ac : not recognized
1 2 3 4a b c
a
c
1 2
A-Za-z 0-9
A-Za-z
Allows character ‘-’, e.g. Next_Line Can not begin with ‘-’ Can not have consecutive ‘-’
1 2
A-Z 0-9
A-Za-z 3-
A-Za-z 0-9
Can begin with 0, e.g. 000025
1 2
0-9
0-9
Can not begin with 0 Except integer 0, followed by space
1 2
0-9
0-9
3 4space
0
Can begin with “0” , e.g. 001.35 Can end with “.”, e.g. 12. Can end with “0”, e.g. 3.1400
Float Point Number
1 2
0-9
0-9 4.
0-9
Token Code
PROGRAM 2
VAR 2
BEGIN 2
END 2
END. 3
INTEGER 2
FOR 2
READ 2
WRITE 2
TO 2
DO 2
1 2
A-Za-z 0-9
A-Za-z
4
3.
0-9
0-9
5
;,+-*()
6 7: =
Token Code
; 5
: 6
, 5
:= 7
+ 5
- 5
* 5
DIV 2
( 5
) 5
id 2
int 4
1 2
A-Za-z 0-9
A-Za-z
4
3.
0-9
0-9
5
;,+-*()
6 7: =
Reserved WordsToken Code
null 1
begin 21
end 22
if 23
then 24
while 25
do 26
call 27
const 28
X 2
Y 2
A 2
0 n 1.
23i f
33
u 34
l 35
l
21
.36
e 37
g 38
ib 39
n
2240
n 41
de
42
Special SymbolsToken Code
+ 4
- 5
* 6
/ 7
= 9
( 15
) 16
, 17
; 18
. 19
0
4
7/
6
+
*
5-
9=
15(