The executable must be called ada, it will take one command-line argument (the input file), and is to output (to stdout) any errors found and just before the end of every scope, the scope level and the names and types of all visible Idents.

I need to build a simple compiler for Ada productions(short version). In general the phases of every compiler are :Lexical Analysis ( my first project), Syntax Analysis ( proj2) , Semantic Analysis( the recent project3) and one more for the last project. Project 2 is completed works ok ( 95% was graded) and I will provide it I will provide you my instructors website dough. At the hand outs there are examples for Fortran– productions,flex,bison ( for that I could send it to you .l .y .c .h files -for example in the dropbox folder for project 3 is a file check.c – project3 supposed to be similar but for Ada production ). Just to say one more time you gonna need proj 2 for proj 3 and in proj 2 folder it is a test ada file.

here is the project:

Part 3:

Your third part of the project is to traverse the tree, checking the types and generating the

symbol table. The fields in the symbol table is up to you; I would expect at least the name

of the variable, the type, its scope level, and for arrays the upper and the lower limits in

the declaration and the basetype (but it is your choice). You must handle scopes, although

you may want to start with only one level, make sure it works, and then add the support

for multiple scopes. The declarations in a DECLARE section start a scope ending at the

corresponding end.

The restrictions in the program are:

•a DECLARE starts a new scope that ends at the corresponding END

•the type of the LHS and the RHS of an assignment must agree;

•the expressions in an IF must have type Boolean;

•for a FOR loop, the 2 values in the range must be the same type and the identifier is

(implicitly) declared in a new scope that encases the body of the FOR loop

•the operands for OR, AND, XOR, and NOT must be Boolean, and the result is Boolean;

•the operands for the relational operators must agree, and the result is Boolean;

•the operands for the arithmetic operators (including unary + and -) must be Integer,

and the result is Integer;

•the an Ident used with an index (A(3)) must be declared as an array variable, and the index must be of type Integer. Note there 3 places where a scope starts: the start of the program, every DECLARE, and every FOR.

The executable must be called ada, it will take one command-line argument (the input file),

and is to output (to stdout) any errors found and just before the end of every scope, the

scope level and the names and types of all visible Idents. You must turn in all the source

files: the .l, .y files, the files containing the main program and the checking routines, all the needed .h

files, and a Makefile with extension .mak.

It is my feeling that you should start with one scope with assignments and expressions; then

add the DECLARE construct, WHILE, EXIT, and FOR; and finally the declaration and

use of array variables.

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

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

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

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

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:
The price is based on these factors:
Academic level
Number of pages

Order your essay today and save 7% with the discount code DISSERT7