Question: Why do I keep getting this error in my terminal after running this SML code? I need the parse function to work correctly fun parse

Why do I keep getting this error in my terminal after running this SML code? I need the parse function to work correctly

Why do I keep getting this error in my terminal after running

fun parse (fileName: string) : token list = let val file = TextIo. openIn(fileName) in createlist(TextIo. input1(file), file, []) end; fun createlist (c:char, file:TextIo.instream, acc:token list) : token list = if Char, isAlpha(c) then getword(Textio.input1(file), file, acc, [c]) case c of #"= createlist(Textio.input1(file), file, acc) #"= createlist(TextIO. input1(file), file, acc @ [EQ]) #"+ createlist(TextIo.input1(file), file, acc [ [PL]) | \#"-" createlist(TextIo.input1(file), file, acc @ [MI]) | "*" createlist(TextIo.input1(file), file, acc @ [TI]) "/" createlist(TextIo.input1(file), file, acc [ [DI]) else if c=nil then acc else print("Compilation error"); fun getword (c:char, file:TextIo.instream, acc:token list, tmp:char list) = if Char. isAlpha(c) then getword(TextIO.input1(file), file, acc, temp \& c) let val word = implode (tmp) In createlist(TextI0.input1(file), file, acc [ID word]) else if c=nil then acc else print("Compilation error") end

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!