Question
The assignment is to write a lexical analyzer (scanner) for PASCAL programming language, taking in consideration the following: (*) You will be a given a
The assignment is to write a lexical analyzer (scanner) for PASCAL programming language, taking in consideration the following: (*) You will be a given a list of the reserved words, standard identifiers(names), and a set of special symbols. 1. Every reserved word is given a unique id-number. 2. Every standard identifier(name) also have a unique id-number. 3. Identifiers ; variable names, procedure names, function names , ...etc. are given the same id. number. 4. Integers have an id-number. 5. Real numbers have an id-number. 6. Every special symbol has an id-number. .... and so on so forth. (*) The input to your program is the users program written in PASCAL. (*) The output of your program is : A list of tokens in the program showing: Token Id-Number (*) Your program should handle the lexical errors encountered. (*) Use C programming language only.
Special Symbols Reserved Words Pascal Standard Reserved Words andfile repeat set then to type nil for forwardnot function of begin or packeduntil procedure var programwhile div if do downto label else with Pascal Pre-declared Standard Identifiers false sin page pred booleanut arctan get sqr integer readsucc In maxint a true readlntext disposenew reset trunc rewniteite roundwritel odd ord output eof eoln Comments: This is a commento This is a comment Special Symbols Reserved Words Pascal Standard Reserved Words andfile repeat set then to type nil for forwardnot function of begin or packeduntil procedure var programwhile div if do downto label else with Pascal Pre-declared Standard Identifiers false sin page pred booleanut arctan get sqr integer readsucc In maxint a true readlntext disposenew reset trunc rewniteite roundwritel odd ord output eof eoln Comments: This is a commento This is a commentStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started