Complete the lexical specification of Tiger

Assignment Help Computer Engineering
Reference no: EM131850854

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

Reference no: EM131850854

Questions Cloud

Consider the potential for trade in jus and fizz : Imagine a world with just two countries, called France and Germany. Both have 25 million workers. Consider the potential for trade in jus and fizz
Retrieve the title of the course along with the number di : Retrieve the title of the course along with the number DI students who registered in this course in order of the student registration number.
Create a presentation about a place to which you have travel : Create a presentation about a place to which you have traveled or would like to travel.Begin by opening a new Microsoft PowerPoint file.
How the jamaicas country financial system : How the Jamaicas country's financial system is related to key macroeconomic variables?- with Peer-reviewed source that i can use to guide me.
Complete the lexical specification of Tiger : CS 433-Assignment - Lexical Analysis Construction. Complete the lexical specification of Tiger, as begun in the skeleton Tiger.flex file
Increase in bread demand : How many workers will C&A need to add in order to meet an anticipated 25% increase in bread demand?
How to define net exports and net capital outflow : How to define net exports and net capital outflow? What is it and its purpose, how is it used. Explain the relationship among saving, investment
What should ted have done when elizabeth first joined team : To what stage in its life cycle does the assembly team seem to have regressed? Is the trouble Elizabeth Jennings' fault? If not, then whose fault is that?
Analyze the business-level strategies for the corporation : Analyze the business-level strategies for the corporation you chose to determine the business-level strategy you think is most important to the long-term.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd