Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Assignment - Lexical Analysis Construction

Overview - Over the rest of the semester, you will implement a compiler for the Tiger programming language. Tiger, developed by Prof. Andrew Appel, is a traditional imperative-style programming language, with a syntax similar to that of the ML family (though it lacks advanced features such as polymorphic type inference and first-class functions).

The language is described in Prof. Appel's series of texts, Modern Compiler Implementation in Java (1st Ed.), Modern Compiler Implementation in C, and Modern Compiler Implementation in ML. A short yet fairly complete guide to the language has been written by Prof. Stephen Edwards (see "Reading", above).

In this assignment, you will complete a JFlex specification of the lexical analysis for Tiger. To get you started, a skeleton distribution and supporting files are available (attached).

Your Job - Complete the lexical specification of Tiger, as begun in the skeleton Tiger.flex file. The keywords and operators in the language are given in the reference document, and you will need to make sure that you have implemented recognition of all of them. In addition, pay attention to the following:

Within string literals, escape sequences should be properly translated into their meanings.

Be sure that unclosed comments and unclosed strings are detected at the end of file. Remember that comments can be nested.

Be sure that all unclosed strings are detected at the end of a line, unless the \ ... \ line continuation form is used.

Note that all integers are positive. This means, for example, that -5 should be detected as two separate tokens.

Reading -

Mogensen, Ch. 2, for the background on why a tool like JFlex works in the first place.

User manual for JFlex (available from the main page for this site): pay particular attention to section 3 ("A simple example").

Stephen Edwards, Tiger Language Reference Manual (link), to get a sense of the source language and knowledge of the keywords and constants your lexer will need to recognize.

Andrew Appel, Modern Compiler Implementation in Java (1st ed.) (Appendix A), for another presentation of the Tiger language.

Attachment:- Assignment.rar

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92679212

Have any Question?


Related Questions in Computer Engineering

You have an opportunity to buy a bond with a face value of

You have an opportunity to buy a bond with a face value of $10,000 and coupon rate of 14%, payable semi-annually. NOTE: Interest per 6-month period is 7% of Face Value (i.e. $10,000x0.07 = $700 per 6-month period).  (i) ...

Question suppose that a bayesian spam filter is trained on

Question : Suppose that a Bayesian spam filter is trained on a set of 10000 spam messages and 5000 messages that are not spam. The word "opportunity" appears in 175 spam messages and 20 messages that are not spam. Would ...

What are some of the basic principles involved with

What are some of the basic principles involved with utilizing the ADT stack? What are some applications that could effectively utilize a stack?

In my sample database i need to use select statements to

In my sample database I need to use SELECT statements to find the following: 1) Find the full names of supervisors together with the total number of employees directly supervised by each one of them. 2) Find the full nam ...

Systems analysis projectpersonal trainer inc owns and

Systems analysis project Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a new "superce ...

What is a good analogy of subnetting whats a break down of

What is a good analogy of Subnetting? What's a break down of how it is used within a company?

What is vsftpd name two other server packages that may be

What is vsftpd? Name two other server packages that may be used for the same purpose

Suppose you are a manager in the it department for the

Suppose you are a manager in the IT department for the government of a corrupt dictator, who has a collection of computers that need to be connected together to create a communication network for his spies. You are given ...

What is a survey and pros and cons of using this method to

What is a Survey and pros and cons of using this method to collect data are? Have you done a survey? How successful were your results?

42 of the cars in a dealer lot are red 21 are black and 10

42% of the cars in a dealer lot are red, 21% are black and 10% are white. The remainder are some other unspecified color. Salespersons randomly shows three cars to three different customers. What is the probability the f ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As