Question: How would I write this in ML? Any help and explanation would be appreciated. Write an ML function named parse : string token list that

 How would I write this in ML? Any help and explanation

How would I write this in ML? Any help and explanation would be appreciated.

Write an ML function named parse : string token list that inputs the name of a text file. The file will contain a sequence of characters representing a (not necessarily proper) assignment statement. Your function will parse the text file character by character. The output will be a list of tokens that classify each type of word that was read in the file. The following tables shows all the possible words and their tokens. For example, if the text file is named input.txt and contains: profit=Revenuecost Then your function should work as follows: - parse("input.txt"); val it = [ID "profit", EQ, ID "Revenue", MI, ID "cost"] : token list

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!