Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The assignment is to write a lexical analyzer (scanner) for PASCAL programming language, taking in consideration the following: (*) You will be a given a

image text in transcribedThe 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 comment

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions