Question: Question #1 (25 Marks) Consider the below language specifications. Write a program to show token, token type, line no. and appropriate error message if there

 Question #1 (25 Marks) Consider the below language specifications. Write a

Question #1 (25 Marks) Consider the below language specifications. Write a program to show token, token type, line no. and appropriate error message if there is any lexical error? Note: You need to firstly remove white spaces and comments from the program. A LEXICAL CONVENTIONS OF C- 1. The keywords of the language are the following: .... 18'dnt return vold while All keywords are reserved, and must be written in lowercase. 2. Special symbols are the following: DOR. 3. Other tokens are ID and NOM, defined by the following regular expressions: ID letter lettert NUM - digit digit. letter al.. Iza- digit - 01-19 Lower- and uppercase letters are distinct. 4. White space consists of blanks, newlines, and tabs. White space is ignored except that it must separate ID's, MUM's, and keywords 5. Comments are surrounded by the usual C notations /*...*1. Comments can be placed anywhere white space can appear (that is, comments cannot be placed within tokens) and may include more than one line. Comments may not be nested. Question #1 (25 Marks) Consider the below language specifications. Write a program to show token, token type, line no. and appropriate error message if there is any lexical error? Note: You need to firstly remove white spaces and comments from the program. A LEXICAL CONVENTIONS OF C- 1. The keywords of the language are the following: .... 18'dnt return vold while All keywords are reserved, and must be written in lowercase. 2. Special symbols are the following: DOR. 3. Other tokens are ID and NOM, defined by the following regular expressions: ID letter lettert NUM - digit digit. letter al.. Iza- digit - 01-19 Lower- and uppercase letters are distinct. 4. White space consists of blanks, newlines, and tabs. White space is ignored except that it must separate ID's, MUM's, and keywords 5. Comments are surrounded by the usual C notations /*...*1. Comments can be placed anywhere white space can appear (that is, comments cannot be placed within tokens) and may include more than one line. Comments may not be nested

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!