Dana Vrajitoru
C311 Programming Languages

C311 Class Exercise 3

Date: Wednesday, March 29, 2023.
Due Date:Wednesday, April 5, 2023.

Ex. 1 Formal grammar classification

For each of the following sets of production rules, state which type of grammar they belong to in Chomsky's classification, where tokens starting with an uppercase letter are non-terminal symbols, and everything else is terminal symbols.

a.

Y => {
Y => { Z
Z => # Z
Z => # W
W => }

b.

Y => { Z } W
{ Z => # Z
( Z => @ Z
# Z => # # Z
@ Z => @ @ Z
Z => 
W => ( Z )

c.

Y => { Z } W
Z => # Z
Z => #
W => ( Q )
Q => Z
Ex. 2 Formal grammar production

For each of the sets of rules from Ex. 1, considering it a grammar where Y is the starting symbol, what kind of strings can you produce with each of them?

Canvas Submission

Upload to Canvas, Assignments, Class Exercise 3, a file containing the solution, or just the text of the solution as the submission entry. Add a comment mentioning all the people in the team. One submission per team is sufficient.