No More Worries!

image Our orders are delivered strictly on time without delay

Paper Formatting

  • Double or single-spaced
  • 1-inch margin
  • 12 Font Arial or Times New Roman
  • 300 words per page

No Lateness!

image Our orders are delivered strictly on time without delay

Our Guarantees

image

  • Free Unlimited revisions
  • Guaranteed Privacy
  • Money Return guarantee
  • Plagiarism Free Writing

Theory and design

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.

  1. 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.
  2. Five relational operators should be added. They are =, /=, >, >= and <=. All of the lexemes should be represented by the single token RELOP.
  3. One additional lexeme should be added for the ADDOP token. It is binary -.
  4. One additional lexeme should be added for the MULOP token. It is/.
  5. A new token REMOP should be added for the remainder operator. Its lexeme should be rem.
  6. A new token EXPOP should be added for the exponentiation operator. Its lexeme should be **.
  7. 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.
  8. 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.
  9. 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.
  10. 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.

  1. 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.
  2. 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

Sample Solution

Control and the Freedom of Speech in the United States GuidesorSubmit my paper for examination The First Amendment of the Constitution of the United States ensures each American resident the ability to speak freely, which implies an option to uninhibitedly communicate one's contemplations and thoughts. The right to speak freely is a fundamental American worth—one of the columns on which American culture was fabricated. Nonetheless, the option to communicate one's contemplations without limitation can be questionable; communicating disdain, for instance, is additionally permitted. The principle issue here is to ensure others' wellbeing and ensure an individual communicating contempt would not go farther than communicating their situation without submitting unlawful acts. Restriction is intended to control such debates; then again, oversight can be contrasted with a noxious gas: it can betray the aggressor if the breeze changes (ACLU). opportunity The principal recorded instance of oversight in the United States happened in 1734-1735, when a New York-based paper printer John Peter Zenger, who was blamed for defaming the legislative head of New York (Zenger distributed a rebellious defamation scrutinizing the specialists) and was arrested. Zenger was guarded in court by Andrew Hamilton, who broadcasted in his well known discourse "Truth can't be Libel." This legal dispute was notable regarding engaging the opportunity of press by the Constitution, despite the fact that there were various endeavors to constrain it, for example, John Adams' Alien and Sedition Acts embraced in 1798, or the Sedition Act of 1917 (Censorship in America). Today, the U.S. media ends up in an irresolute circumstance. It is protected from uncovering their sources, as it is secured by the First Amendment, and Obama's organization even offered a government protecting law for writers. Also, advanced media sources and the Internet are progressively hard to control, screen, and blue pencil. Then again, media proprietorship, joined with money related issues, conventional establishments attempting to remain above water and forestall the presence of undesired data and political partisanship, just as the administration's endeavor to uncover informants, contrarily influence the right to speak freely (Index on Censorship). With respect to the nature of substance being distributed on the web and in printed media, restriction is generally applied to materials that match such criteria as foulness, incitements, sex entertainment, strictly or socially touchy issues, calls for viciousness, and certain other risky subjects, for example, racial separation. Simultaneously, it appears oversight isn't restricted distinctly by these fields. Copyright assembly and observation present perhaps the greatest risk for a free appropriation of data over the Internet. With respect to reconnaissance by and large, Google Transparency reports affirm the United States comes out ahead of the pack on the planet for the quantities of solicitations for clients' very own information; the quantity of court orders for content evacuation is additionally among the most elevated on the planet (after Brazil). Taking into account that media organizations in the United States will in general consent to administrative solicitations with respect to clients' very own information, Americans keep an eye on self-control their electronic correspondences to stay away from conceivable authoritative issues (Index on Censorship). The circumstance with the ability to speak freely in the United States is disputable. In spite of the fact that it is ensured by the First Amendment as an option to unreservedly communicate one's contemplations and thoughts, there are points that are being checked and controlled, for example, sex entertainment, vulgarity, strictly and socially delicate issues, calls for savagery, and a few others. American writers are typically secured by state laws, which promise them their capacity to work. Simultaneously, the American government is known to demand media transmission organizations for clients' very own information, which results into Americans self-blue penciling their electronic interchanges. Copyright enactment is additionally viewed as a danger to the free circulation of data in media. References "US: Free Expression Constrained by Cultural and Political Factors." Index on Censorship. N.p., n.d. Web. 15 Jan. 2014. . "Oversight." American Civil Liberties Union. N.p., n.d. Web. 16 Jan. 2014. . "History of Censorship in The U.S.A." Censorship in America. N.p., n.d. Web. 14 Jan. 2014. .
PLACE AN ORDER NOW

Price Calculator

Subject:
Type:
Pages/Words:
Single spaced
approx 275 words per page
Urgency:
Level:
Currency:
Total Cost:

12% Discount

image

  • Research Paper Writing
  • Essay Writing
  • Dissertation Writing
  • Thesis Writing

Why Choose Us

image

  • Money Return guarantee
  • Guaranteed Privacy
  • Written by Professionals
  • Paper Written from Scratch
  • Timely Deliveries
  • Free Amendments