Lexical analyzer and the compilation listing generator code

modifying the attached lexical analyzer and the compilation listing generator code
The project requires a Linux environment that has the compiler tools flex and bison together with make and the GNU g++ compiler.

CMSC 430 Project 1 The first project involves modifying the attached lexical analyzer and the compilation listing generator code. You need to make the following modifications to the lexical analyzer,
scanner.l: 1. A new token ARROW should be added for the two character punctuation symbol =>. 2. The following reserved words should be added:
case, else, endcase, endif, if, others, real, then, when Each reserved words should be a separate token. The token name should be the same as the lexeme, but in all upper case. 3. Two additional logical operators should be added. The lexeme for the first should be or and its token should be OROP. The second logical operator added should be not and its token should be NOTOP. 4. Five relational operators should be added. They are =, /=, >, >= and <=. All of the lexemes should be represented by the single token RELOP. 5. One additional lexeme should be added for the ADDOP token. It is binary -. 6. One additional lexeme should be added for the MULOP token. It is/. 7. A new token REMOP should be added for the remainder operator. Its lexeme should be
rem. 8. A new token EXPOP should be added for the exponentiation operator. Its lexeme should be **. 9. A second type of comment should be added that begins with // and ends with the end of line. As with the existing comment, no token should be returned. 10. The definition for the identifiers should be modified so that underscores can be included, however, consecutive underscores, leading and trailing underscores should not be permitted. 11. A real literal token should be added. It should begin with a sequence of one or more digits following by a decimal point followed by zero or more additional digits. It may optionally end with an exponent. If present, the exponent should begin with an e or E, followed by an optional plus or minus sign followed by one or more digits. The token should be named REAL_LITERAL. 12. A Boolean literal token should be added. It should have two lexemes, which are true and
false. The token should be named BOOL_LITERAL. You must also modify the header file tokens.h to include each the new tokens mentioned above. The compilation listing generator code should be modified as follows: 1. The lastLine function should be modified to compute the total number of errors. If any errors occurred the number of lexical, syntactic and semantic errors should be displayed. If no errors occurred, it should display Compiled Successfully. It should return the total number of errors. 2. The appendError function should be modified to count the number of lexical, syntactic and semantic errors. The error message passed to it should be added to a queue of messages that occurred on that line. 3. The displayErrors function should be modified to display all the error messages that have occurred on the previous line and then clear the queue of messages. An example of the output of a program with no lexical errors is shown below:
1 (* Program with no errors *)
2
3 function test1 returns boolean;
4 begin
5 7 + 2 > 6 and 8 = 5 * (7 – 4);
6 end;
Compiled Successfully Here is the required output for a program that contains more than one lexical error on the same line:
1 — Function with two lexical errors
2
3 function test2 returns integer;
4 begin
5 7 $ 2 ^ (2 + 4);
Lexical Error, Invalid Character $
Lexical Error, Invalid Character ^
6 end;
Lexical Errors 2
Syntax Errors 0
Semantic Errors 0 You are to submit two files. 1. The first is a .zip file that contains all the source code for the project. The .zip file should contain the flex input file, which should be a .l file, all .cc and .h files and a
makefile that builds the project. 2. The second is a Word document (PDF or RTF is also acceptable) that contains the documentation for the project, which should include the following: a. A discussion of how you approached the project b. A test plan that includes test cases that you have created indicating what aspects of the program each one is testing and a screen shot of your compiler run on that test case c. A discussion of lessons learned from the project and any improvements that could be made
Grading Rubric
Criteria Meets Does Not Meet
Functionality
70 points 0 points
Defines new comment lexeme (5) Does not define new comment lexeme
(0)
Correctly modifies identifier definition
to include underscores (5)
Does not correctly modify identifier
definition to include underscores (0)
Adds real and Boolean tokens (5) Does not add real and Boolean tokens
(0)
Defines additional logical operators (5) Does not define additional logical
operators (0)
Defines additional relational operators
(5)
Does not define additional relational
operators (0)
Defines additional arithmetic operators
(5)
Does not define additional arithmetic
operators (0)
Defines additional reserved words and
arrow symbol(5)
Does not define additional reserved
words and arrow symbol (0)
Adds new tokens to the token header
file (5)
Does not add new tokens to the token
header file (0)
Implements modifications to display
multiple errors on the same line (15)
Does not implement modifications to
display multiple errors on the same line
(0)
Implements modifications to count and
display each type of compilation error
(15)
Does not Implement modifications to
count and display each type of
compilation error (0)
Test Cases
15 points 0 points
Includes test case containing all
lexemes (5)
Does not include test case containing
all lexemes (0)
Includes test case with multiple errors
on one line (5)
Does not include test case with
multiple errors on one line (0)
Includes test case with no errors (5) Does not include test case with no
errors (0)
Documentation
15 points 0 points
Discussion of approach included (5) Discussion of approach not included (0)
Lessons learned included (5) Lessons learned not included (0)
Comment blocks with student name,
project, date and code description
included in each file (5)
Comment blocks with student name,
project, date and code description not
included in each file (0)

Don't use plagiarized sources. Get Your Custom Essay on
Lexical analyzer and the compilation listing generator code
Just from $10/Page
Order Essay

Get professional assignment help cheaply

Are you busy and do not have time to handle your assignment? Are you scared that your paper will not make the grade? Do you have responsibilities that may hinder you from turning in your assignment on time? Are you tired and can barely handle your assignment? Are your grades inconsistent?

Whichever your reason may is, it is valid! You can get professional academic help from our service at affordable rates. We have a team of professional academic writers who can handle all your assignments.

Our essay writers are graduates with diplomas, bachelor, masters, Ph.D., and doctorate degrees in various subjects. The minimum requirement to be an essay writer with our essay writing service is to have a college diploma. When assigning your order, we match the paper subject with the area of specialization of the writer.

Why choose our academic writing service?

  • Plagiarism free papers
  • Timely delivery
  • Any deadline
  • Skilled, Experienced Native English Writers
  • Subject-relevant academic writer
  • Adherence to paper instructions
  • Ability to tackle bulk assignments
  • Reasonable prices
  • 24/7 Customer Support
  • Get superb grades consistently

 

 

 

 

 

 

Order a unique copy of this paper
(550 words)

Approximate price: $22

Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

We value our customers and so we ensure that what we do is 100% original..
With us you are guaranteed of quality work done by our qualified experts.Your information and everything that you do with us is kept completely confidential.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

The Product ordered is guaranteed to be original. Orders are checked by the most advanced anti-plagiarism software in the market to assure that the Product is 100% original. The Company has a zero tolerance policy for plagiarism.

Read more

Free-revision policy

The Free Revision policy is a courtesy service that the Company provides to help ensure Customer’s total satisfaction with the completed Order. To receive free revision the Company requires that the Customer provide the request within fourteen (14) days from the first completion date and within a period of thirty (30) days for dissertations.

Read more

Privacy policy

The Company is committed to protect the privacy of the Customer and it will never resell or share any of Customer’s personal information, including credit card data, with any third party. All the online transactions are processed through the secure and reliable online payment systems.

Read more

Fair-cooperation guarantee

By placing an order with us, you agree to the service we provide. We will endear to do all that it takes to deliver a comprehensive paper as per your requirements. We also count on your cooperation to ensure that we deliver on this mandate.

Read more

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Open chat
1
You can contact our live agent via WhatsApp! Via +1 817 953 0426

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 20% with the discount code VICTORY