Consider the following grammar:
stmt −→ assignment
−→ subr call
assignment −→ id := expr
subr call −→ id ( arg list )
expr −→ primary expr tail
expr tail −→ op expr
−→
primary −→ id
−→ ( expr )
op −→ + | - | * | /
arg list −→ expr args tail
args tail −→ , arg list
(a) Construct a parse tree for the input string
foo(a, b).
(b) Give a canonical (right-most) derivation of this same string.
(c) Prove that the grammar is not LL(1).
(d) Modify the grammar so that it is LL(1).
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here