Question: We have learned how LL(1) PREDICT sets are constructed from FIRST and FOLLOW sets In the second part of Project 2, you will build a

 We have learned how LL(1) PREDICT sets are constructed from FIRSTand FOLLOW sets In the second part of Project 2, you willbuild a parser generator that implements these constructions in a purely functional

We have learned how LL(1) PREDICT sets are constructed from FIRST and FOLLOW sets In the second part of Project 2, you will build a parser generator that implements these constructions in a purely functional subset of Scheme. The key function you are to implement is the following: (define parse-table (lambda (grammar) your code here; grammar. The The input grammar must consist of a list of lists, one per non-terminal in the first element of each sublist should be the non-terminal; the remaining elements should be the right- hand sides of the productions for which that non-terminal is the left-hand side. The sublist for the start symbol must come first. Every grammar symbol must be represented as a quoted string. As an example, here is our familiar LL(1) calculator grammar in the required format: (define calc-gram ("S" ("id" ":-" "E") ("read" "id") ("write" "E"))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!