 |
 |
| |
|
Search Engine |
|
Manfaatkan Google untuk memperoleh sejumlah informasi
yang Anda inginkan dalam hansmichael.com.
|
|
| Kutipan |
We are part of all we have met.
John H. Patterson
|
|
|
Tokoh Hari Ini
|
|
Blaise Pascal
Blaise Pascal lahir pada 19 Juni 1623 di Rouen, Perancis. Ia meninggal dunia pada tahun 1666 di Perancis.
Pascal adalah ahli matematika, fisika, penulis prosa, dan dikenal sebagai salah satu filsuf Kristen abad pertengahan. Pascal menemukan mesin penjumlah yang mengatur penambahan carry antar digit dan segitiga Pascal yang memuat koefisien-koefisien deret binomial. Ia juga penemu roda gerobak sampai roda rolet. Pascal juga meletakkan dasar bagi teori modern probabilitas: hukum Pascal untuk Tekanan. Menariknya, walaupun ia ahli dalam berbagai bidang sains, pemikiran religiusnya sebagai filsuf Kristen menekankan doktrin yang lebih mengutamakan pengalaman dengan Tuhan lebih melalui hati daripada melalui nalar.
|
|
|
|
|
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. |
|
 |
 |