Home / Expert Answers / Computer Science / hi-i-need-help-with-this-problem-this-needs-to-be-written-in-haskell-thanks-problem-consider-the-pa195

(Solved): Hi I need help with this problem. This needs to be written in Haskell. Thanks! Problem Consider the ...



student submitted image, transcription available below

Hi I need help with this problem. This needs to be written in Haskell. Thanks!

Problem Consider the following partial grammar: We have a datatype s to represent this: data E Char I Char E deriving (Show, Eq) data Char I S2 Char E deriving (Show, Eq) This grammar is LL. Write the corresponsing parsing function parses :: [Char ] -> (S, [Char ]) that takes a list of characters and returns the corresponding tree and remaining input. You can assume the existence of a properly written parseE that you may call, and that the portion of the grammar (not shown here) introduces no ambiguities. If you need to test locally, you can pretend that accepts any character given to it, and use this function: data Char deriving (Show, Eq) parseE : : [Char] Char parseE data Char deriving (Show, Eq) parseE :: [Char] Char parseE Please don't submit that with your code or you will break the autograder and not get credit. Example Prelude> parses "ayza333"


We have an Answer from Expert

View Expert Answer

Expert Answer



Given, partial grammar, It involves understanding LL grammars, constructing syntax trees, and implem...
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe