[SOLVED] COSC450/550 HW 3

10.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (3 votes)

1. Perform the pairwise disjointness test for the following grammar rules.
a. A à aB | b | cBB
b. B à aB | bA | aBb
c. C à aaA | b | caB
2. Show a trace of the recursive descent parser given in Section 4.4.1 for the string a + b * c
3. Given the following grammar and the right sentential form, draw a parse tree and show
the phrases and simple phrases, as well as the handle for bBab.
S à aAb | bBA
A à ab | aAB
B à aB | b
4. Construct LR parsing table for the following grammar:
S à Aa | dAb |dca |cb
A à c
5. Show a complete parse, including the parse stack contents, input string, and action for
the string id * ( id + id ), using the grammar and parse table in Section 4.5.3

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.