Csc 4330/6330, Programming Language Concepts (Spring 2018)

Homework 3c (Due: 18 February (Sunday))

Handin under Assignment 3c

  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 4-33 and LR Parsing table on slide 4-34 of Chapter 4 slides, show a rightmost derivation (if possible) and the Stack/Input/Action for the following strings:
    • (id + id) * id
    • (id + id( * id