LAPORAN
AKHIR PRAKTIKUM
Mata
Praktikum : Teknik Kompilasi
Kelas :
Praktikum : 4(Empat)
Tanggal : 06 Januari
2016
Materi : First dan Follow
NPM :
Nama :
Ketua
Asisten :
Paraf
Asisten :
Jumlah
Lembar : 4 lembar
LABORATORIUM
INFORMATIKA
UNIVERSITAS
GUNADARMA
Soal
S
-> AB
A
-> aA | ø
B
-> b|bB
Input
abba
aababa
aabbaba
First dan Follow
First
First
(S) = First (A) = { a, ø }
First
(B) = b, b
Follow
Follow
(S) = { $ }
Follow (A) = { $, a }
Follow
(B) = { $, b }
Tabel Parsing Input abba
Stack
|
Input
|
Ouput
|
$S
|
abba$
|
S -> AB
|
$BA
|
abba$
|
A -> aA
|
$BAa
|
abba$
|
Pop (a)
|
$BA
|
bba$
|
A -> ø
|
$B
|
bba$
|
B -> bB
|
$Bb
|
bba$
|
Pop (b)
|
$B
|
ba$
|
B -> bB
|
$Bb
|
ba$
|
Pop (b)
|
$B
|
a$
|
B -> b
|
$b
|
a$
|
Error / Not Success
|
Tabel Parsing aababa
Stack
|
Input
|
Ouput
|
$S
|
aababa$
|
S -> AB
|
$BA
|
aababa$
|
A -> aA
|
$BAa
|
aababa$
|
Pop (a)
|
$BA
|
ababa$
|
A -> aA
|
$BAa
|
ababa$
|
Pop (a)
|
$BA
|
baba$
|
A -> ø
|
$B
|
baba$
|
B -> bB
|
$Bb
|
baba$
|
Pop (b)
|
$B
|
aba$
|
B -> b
|
$b
|
aba$
|
Error / Not Success
|
Tabel Parsing aabbaba
Stack
|
Input
|
Ouput
|
$S
|
aabbaba$
|
S -> AB
|
$BA
|
aabbaba$
|
A -> aA
|
$BAa
|
aabbaba$
|
Pop (a)
|
$BA
|
abbaba$
|
A -> aA
|
$BAa
|
abbaba$
|
Pop (a)
|
$BA
|
bbaba$
|
A -> ø
|
$B
|
bbaba$
|
B -> bB
|
$Bb
|
bbaba$
|
Pop (b)
|
$B
|
baba$
|
B -> bB
|
$Bb
|
baba$
|
Pop (b)
|
$B
|
aba$
|
B -> b
|
$b
|
aba$
|
Error / Not Success
|
Comments
Post a Comment