Consider the grammar:
S → aSbS | bSaS | 𝜖
Right most derivations for abab:
Case 1:
S → aSbS
→ aSb (applying S → 𝜖)
→ abSaSb (applying S → bSaS)
→ abSab (applying S → 𝜖)
→ abab (applying S → 𝜖)
Case 2:
S → aSbS
→ aSbaSbS (applying S → aSbS)
→ aSbaSb (applying S → 𝜖)
→ aSbab (applying S → 𝜖)
→ abab (applying S → 𝜖)
Show that no left recursive grammar can be LL(1). Show that no LL(1) grammar can be ambiguous.
Draw the syntax tree and DAG from the following expression.
if x>0 then x=3*(y+1) else y=y+1
Explain different stages of compiler with a suitable example. What is token, Patterns and Lexeme?
Write short notes on:
Difference between ISO and CMM standards.
What is the Modularity of a Software System ?
Create a Sparse Matrix in C.