Let the following grammar describes the syntax of expression that has the form: G = list -> list + digit list -> list – digit list -> digit digit -> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Give...


Let the following grammar describes the syntax of expression that has the form:



G
= list
of
digit separated by + or - signs>



  list ->
 list

+

digit



  list ->
list



digit



  list ->
digit


  digit -> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9


Give leftmost and rightmost derivation for the CFG above to resolve the example  9 - 5 + 2  and draw parse trees for both of the derivations



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here