Csc 4330/6330, Programming Language Concepts (Summer 2020)

Homework 4 (Not to be turned in)

  1. Eliminate left recursion in the following grammar:
    S --> SX
    S --> SSb
    S --> XS
    S --> a
    
  2. Determine if the following grammar passes the pairwise disjointness test.
    A --> aB | b | CBB
    B --> aB | ba | aBb
    C --> aaA | b | caB
    
  3. Using the Grammar on slide 10 and LR Parsing table on slide 20 of Chapter 4 Part II slides, show a rightmost derivation (if possible) and the Stack/Input/Action for the following strings:
    • (id + id) * id
    • (id + id( * id