



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




I. Regular Expressions.
Problem 1. Consider the following regular expression divided into parts:
(aa|bb)โ^ ((ab|ba) (aa|bb)โ^ (ab|ba) (aa|bb)โ)โ For each string below either write that it is generated by the regular expression or that it is not generated by it:
II. Context-free grammars, ambiguity and precedence.
Problem 1. Consider the following grammar with two operators, # and $. Capital letters denote nonterminals, and small letters denote terminals.
S ::= B B ::= B#E | B$E | E E ::= B | a | b
1
III. LL and LR Grammars.
Problem 1. Consider the if-then-else grammar below. S and E denote nonterminals and i, t, e, b and a denote terminals:
S ::= iEtSeS | iEtS | a E ::= b
Suppose that we want the string โid + id + id to have only one possible rightmost derivation (call this property P ): S โ E โ E+E โ E+E+E โ E+E+id โ E+id+id โ โE+id+id โ โid+id+id