程序代写代做代考 chain prob1

prob1

Problem 1

(b)

For STRING#STRING#REVERSE(STRING) , we have two different parse trees.

S -> E -> E#E -> E#E#E -> STRING#E#E -> STRING#STRING#E ->
STRING#STRING#REVERSE(STRING)

S -> E -> E#E -> STRING#E -> STRING#E#E -> STRING#STRING#E ->
STRING#STRING#REVERSE(STRING)

Thus, the grammar for CHAIN given above is ambiguous.

(c)

Problem 1
(b)
(c)