Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Assignment 1 Construction of a Lexical Analyzer Due Mar 10 by 11:59pm Points 20 Submitting an external tool Available Feb 19 at 11am -

image text in transcribed
Programming Assignment 1 Construction of a Lexical Analyzer Due Mar 10 by 11:59pm Points 20 Submitting an external tool Available Feb 19 at 11am - Mar 13 at 11:59pm 23 days In this programming assignment, you will be building a lexical analyzer for small programming language and a program to test it. This assignment will be followed by two other assignments to build a parser and interpreter to the same language. You will write a ledcal analyzer function called getNextToken, and a driver program for testing it. The getNextToken function must have the following Signature: Lexdtem getNextToken (istream& in, int& linenumber): The first argument to getNextToken is a reference to an stream object that the function should read from. The second argument to getNextToken is a reference to an integer that contains the current line number.getNextToken should update this integer every time it reads a newline from the input stream getNextToken returns a Lexitem object. A Lexitem is a class that contains a token, a string for the lexeme, and the line number as data members. A header file, lexh, is provided for you. It contains a definition of the Lexitem class, and a definition of an enumerated type of token symbols, called Token. You MUST use the header file that is provided. You may NOT change it. It is recommended to implement the lexical analyzer in one source file, and the main test program in another source file. The testing program is a main function that takes several command line flags For more details, see the assignment description and review the recitation class slides. This tool was successfully loaded in a new browser window. Reload the page to access the tool again. mpus

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 Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

Students also viewed these Databases questions

Question

Tell the merits and demerits of Mendeleev's periodic table.

Answered: 1 week ago