 |
 |
| |
|
Search Engine |
|
Manfaatkan Google untuk memperoleh sejumlah informasi
yang Anda inginkan dalam hansmichael.com.
|
|
| Kutipan |
True genius resides in the capacity for evaluation of uncertain, hazardous and conflicting information.
Winston L.S. Churchill
|
|
|
Tokoh Hari Ini
|
|
David A. Huffman
Dikenal sebagai penemu Huffman Code yang digunakan untuk kompresi data digital pada komputer, facsimile, modem, televisi dan banyak peripheral lainnya. Ia meninggal pada 7 Oktober 1999 dalam usia 74 tahun. Huffman Code disajikannya melalui sebuah paper saat ia kuliah di M.I.T. Ia menerima Golden Jubilee Award untuk inovasi teknologi dari IEEE Information Theory Society pada tahun 1998. Ia juga menerima Medali Richard W. Hamming dari IEEE pada tahun 1999 untuk kontribusinya yang luar biasa di Information Sciences. Pada akhir hidupnya Huffman adalah staf Departemen Computer Science di University of California di Santa Cruz, Amerika Serikat.
|
|
|
|
|
Teknik Kompilasi (ID844)
Contoh Soal
| 1. |
Construct a predictive
parser table for the grammar:
S
-> (L) | a
L
-> S L'
L'
-> , S L' | l
Hints: S = { ( ) ,
a } ; N = { S L L' } ; Start symbol =
S. For elements sequence in row
and column, use sequence above (in the brackets).
|
| 2. |
Construct the sets of LR(0)
items for the grammar:
S
-> A S | b
A
-> S A | a
Hints: Separate
between kernel(s) items and non-kernel items. It's
enough. Don't draw the parser table ! S
= { a b } ; N = { S A } ; Start symbol = S |
| 3. |
LR(0) items for grammar G :
S
-> A S | b
A
-> S A | a
with augmented production
rule S' -> S are:
0
: S'-> . S 4 : A -> a .
S -> . A S
S -> . b 5 : A -> S A .
A -> . S A S -> A .
S
A -> . a S
-> . A S
S -> . b
1
: S'-> S .
A -> . S A
A -> S . A A -> . a
A -> . S A
A -> . a 6 : A -> S .
A
S -> . A S A -> . S
A
S -> . b A
-> . a
S -> . A S
S -> . b
2
: S -> A . S
S -> . A S 7 : S -> A S .
S -> . b A
-> S . A
A -> . S A S -> . A
S
A -> . a S
-> . b
A -> . S A
3
: S -> b .
A -> . a
-
Construct
the SLR parse table for grammar G.
-
Check every possibles of
conflict. Is this grammar SLR? Why or why not?
Hints: S
= { a b } ; N = { S A } ;
Start symbol = S. For elements sequence in column, use sequence
above (in the brackets) plus a '$'. |
| 4. |
Grammar G :
S
-> (L) | a First(S) = (
a Follow(S) = , ) $
L
-> S L' First(L)
= ( a Follow(L) = )
L'
-> , S L' | l
First(L')= , l
Follow(L')= )
Complete
the predictive parsing table for grammar G ( for a and
$ columns only ) !
| Symbol |
( |
) |
, |
a |
$ |
| S |
S -> ( L ) |
error |
error |
|
|
| L |
L -> S L' |
error |
error |
|
|
| L' |
error |
L' -> l |
L' -> , S L' |
|
|
Show the behavior of the
parser on the sentences '(a,((a,a),(a,a)))' (complete
with every changes on stack table and input pointer) . Draw the parse
tree. |
|
 |
 |