The first project involves modifying the attached lexical analyzer and the compilation listing generator code. You need to make the following modifications to the lexical analyzer, scanner.l:
case, else, endcase, endif, if, others, real, then, when
Each reserved words should be a separate token. The token name should be the same as the lexeme, but in all upper case.
You must also modify the header file tokens.h to include each the new tokens mentioned above.
The compilation listing generator code should be modified as follows:
If no errors occurred, it should display Compiled Successfully. It should return the total number of errors.
An example of the output of a program with no lexical errors is shown below:
1 (* Program with no errors *)
3 function test1 returns boolean;
5 7 + 2 > 6 and 8 = 5 * (7 – 4);
Here is the required output for a program that contains more than one lexical error on the same line:
1 — Function with two lexical errors
3 function test2 returns integer;
5 7 $ 2 ^ (2 + 4);
Lexical Error, Invalid Character $
Lexical Error, Invalid Character ^
Lexical Errors 2
Syntax Errors 0
Semantic Errors 0
You are to submit two files.
a. A discussion of how you approached the project
b. A test plan that includes test cases that you have created indicating what aspects of the program each one is testing and a screen shot of your compiler run on that test case