Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The first assignment is to write a lexical analyzer (lexer) You can build your entire lexer using a FSM, Or build using at least FSMs

image text in transcribedimage text in transcribed

The first assignment is to write a lexical analyzer (lexer) You can build your entire lexer using a FSM, Or build using at least FSMs for identifier, integer and real (the rest can be written ad-hoc) but YOU HAVE TO CONSTRUCT A FSM for this assignment otherwise, there will be a deduction of 2 points! Note: In your documentation (design section), YOU MUST write the REs for Identifiers, Real and Integer, and also show the NFSM using Thompson. A major component of your assignment will be to write a procedure (Function) lexer 0, that returns a token when it is needed. Your lexer) should return a record, one field for the token and another field the actual "value" of the token (lexeme), i.e. the instance of a token. Your main program should test the lexer i.e., your program should read a file containing the source code of Rat18F to generate tokens and write out the results to an output file Make sure that you print both, the tokens and lexemes. Basically, your main program should work as follows while not finished (i.e. not end of the source file) do call the lexer for a token print the token and lexeme endwhile Do at least 3 test cases and make sure that you turn in proper documentation using the documentation template sim (Partial) Source code: while (fahr

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_2

Step: 3

blur-text-image_3

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

Icdt 88 2nd International Conference On Database Theory Bruges Belgium August 31 September 2 1988 Proceedings Lncs 326

Authors: Marc Gyssens ,Jan Paredaens ,Dirk Van Gucht

1st Edition

3540501711, 978-3540501718

More Books

Students also viewed these Databases questions

Question

You are designing a flight scheduler for an airline AlgorithmAir

Answered: 1 week ago

Question

Evaluate the importance of diversity in the workforce.

Answered: 1 week ago

Question

Identify the legal standards of the recruitment process.

Answered: 1 week ago