Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Tutorial 3
Nội dung xem thử
Mô tả chi tiết
TUTORIAL 3
1. Consider the following grammar
E à T+E | T
T à id
a. Construct the collection of sets of LR(0) items for this grammar
b. Construct the parsing table using SLR method
c. Show the moves according to the table constructed above on the inputs of id+id and
id+id+id
2. Show that the following grammar is LL(1) but not SLR(1). Also, show that the
grammar is LR(1) as well.
S à AaAb | BbBa
A à Œ
B à Œ
Hint: Note that S à ·Œ is concurrently equivalent to S à Œ·, or we can write S à ·
3. Show that the following grammar is LR(1) but not SLR(1)
S à Aa | bAc | dc | bda
A à d
4. Show that the following grammar is LR(1) but not LALR(1)
S à As | bAc | Bc | bBa
A à d
B à d
PDF created with pdfFactory Pro trial version www.pdffactory.com