Display the semantic errors in the compilation listing

Assignment Help Computer Engineering
Reference no: EM13189201

The third project involves writing the semantic analyzer for the compiler that was begun in the previous projects. To simplify the semantic error checking, you are to remove the ability to have multiple functions from the grammar and the ability to make function calls.

In order to perform semantic analysis, the symbol table must be completed in this project. The 70 points that you will receive for the functionality portion of your grade on this project will be based on how many of the following errors that you can detect:

Using Boolean Expression with Arithmetic Operator 5 points
Using Boolean Expression with Relational Operator 5 points
Using Arithmetic Expression with Logical Operator 10 points
Conditional Expression Type Mismatch 5 points
If Condition Not Boolean 5 points
Narrowing Variable Initialization 5 points
Variable Initialization Mismatch 5 points
Undeclared Variable 10 points
Duplicate Variable 10 points
Narrowing Function Return 10 points

Test data that contains each of the following errors will be provided.

This project requires modification to the bison input file, so that it defines the semantic checks necessary to produce these errors and the inclusion of a symbol table to keep track of the declared identifiers.

Variables and parameter names have local scope. The scope rules require that all names be declared and prohibit duplicate names within the same scope. The type correspondence rules are as follows:

  • Boolean operators cannot be used with arithmetic or relational operators.
  • Arithmetic expressions cannot be used with logical operators.
  • The two expressions in a conditional expression must match in type. No coercion is performed.
  • The type of the if condition must be Boolean.
  • A narrowing variable initialization or function return occurs when a real value is being forced into integer. Widening is permitted.
  • Boolean types cannot be mixed with numeric types in variable initializations or function returns.
  • Type coercion from an integer to a real type is performed within arithmetic expressions.

Like syntax errors, the compiler should display the semantic errors in the compilation listing, after the line in which they occur.

Reference no: EM13189201

Questions Cloud

Levels of protection-functionality and limitations : Explain a Class Three ensemble. Include levels of protection, functionality, and limitations. Identify the proper respiratory protection for a Class Three ensemble,
What is the expected monetary value with the survey : A market research is available for $10,000. Using a decison tree analysis, it is found that the expecyed monetary value with no survey is $75,000. If the expected value of sample information is 62,000, what is the expected monetary value with the ..
What is the size of the labor force : Suppose the number of employed people in an economy is 121,166,640. The unemployment rate in this economy is 10.4 percent, or .104, and the labor force participation rate is 72.5 percent, or .725. a. What is the size of the labor force
Find the dimensions of the plot : A farmer wants to set aside a rectangular plot of land to contain 160 square meters. If the width is 19 less than the length, find the dimensions of the plot.
Display the semantic errors in the compilation listing : Variables and parameter names have local scope. The scope rules require that all names be declared and prohibit duplicate names within the same scope
What is the public budget deficit : In a closed economy the following holds: Household consumption C is given by the consumption function: C = 100 + 0.75Yd Planned investments are I = 250 (independent of Y ). Household disposable income: Yd = Y - T, where Y is production. Taxes depend ..
Decontamination process : Describe the four stages of decontamination and their importance in the decontamination process. Explain at least two initial decontamination considerations, and why and when these considerations are important. Support your analysis with appropriate ..
How many disserent sundaes are possible : Sam can chose among 3 flavors of ice cream, 2 toppings and 3 types of candy for his ice cream sundae. How many disserent sundaes are possible?
What will the radius of this larger sphere be : A jeweler has three small solid spheres made of silver, of radius 2 mm, 6 mm, and 6 mm. He decides to melt these down and make just one sphere out of them. What will the radius of this larger sphere be?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Explain java programming with commented code

Java Programming with Commented Code, A marketing research company has hired you to develop a program. Analytics Nation, Inc. has gathered information from about five different products. They would like to follow up with 1% of these households.

  Use that both versions of average()

Create a class called CollegeCourse with. use that both versions of average()

  Discuss the effectiveness of these security features

Secure Web sites often include 'enhanced security questions' or 'security images' in an attempt to assure that only authorized users could access the sites. Research and discuss effectiveness of these security features.

  Program on bst

Program on BST

  Basic strategic planning questions

What the basic strategic planning questions must be addressed for the infrastructure? Suppose that x and y are “int” variables and “ch” is a char variable.

  The c++ libraries on strings have many functions

The C++ libraries on strings have many functions that can be used to handle various string operations. Write a function called stringlast that can be used to find the last n characters in a string and return a pointer to this new string

  Implement needham-schroeder protocol using python

Implement Needham-Schroeder protocol using python

  Explaining dynamic programming approach

Assume we have a directed the acyclic graph G = (V,E) with the real-valued edge weights and two distinguished vertices s and t.

  Selecting the operating system

What operating system must the library consider for this facility? And also explain why?

  Various counter controlled repetitive control structures

Write down the example that demonstrates different techniques of passing arguments: by value, by reference, and as pointers. Discuss the three methods.

  Which is a method for copying a file or folder

Which of the following locations is not a valid place from that to delete a file and send it to the Recycle Bin.

  Structured error handling in appropriate places in program

Add a form that includes the RichTextBox control and several predefined template letters. This part of the program would be used to write letters to your customers when there is a specific issue you will like to address with them, so use your imag..

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