Question: Coding a Calculator Language Lexer and Parser Using Racket Language. Need full source code using Racket Language in DrRacket Here are two files to test

Coding a Calculator Language Lexer and Parser Using Racket Language. Need full source code using Racket Language in DrRacket
Here are two files to test the source code with. The parser should stop executing on the file once it gets to the line with "$$"
read A read B write (A + 1) * ((B - 2) + A - (B * A)) $$ This should parse OK.
read A read B write (A + 1) * + ((B - 2) + A - (B * A)) $$ Syntax error on line 3 (mult-op followed by add-op).
Note that we're writing only a parser, not a full interpreter (although interpreters in Racket aren't that difficult-). Also, your program only needs to pass a verdict on the syntactical correctness of the program, not produce a full parse tree. Your code should have a function called parse, which takes one parameterthe name of the file of source code to be processed: (parse source.css) It should return a string: either Accept, indicating the program is syntactically correct; or a message as to which line the first syntax error was found: So output will be either: Accept or something like: Syntax error found on line 25 In the case of a syntax error, printing the offending line would also be helpful. It is not necessary to continue scanning for additional syntax errors. Note that we're writing only a parser, not a full interpreter (although interpreters in Racket aren't that difficult-). Also, your program only needs to pass a verdict on the syntactical correctness of the program, not produce a full parse tree. Your code should have a function called parse, which takes one parameterthe name of the file of source code to be processed: (parse source.css) It should return a string: either Accept, indicating the program is syntactically correct; or a message as to which line the first syntax error was found: So output will be either: Accept or something like: Syntax error found on line 25 In the case of a syntax error, printing the offending line would also be helpful. It is not necessary to continue scanning for additional syntax errors
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
