ScholarMatic | 24/7 Homework Help

ScholarMatic Will Help You Write Your Essays and Term Papers

Answered » You can buy a ready-made answer or pick a professional tutor to order an original one.

project 3

by | Nov 30, 2023 | questions

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.

ScholarMatic: Explanation & Answer

Your ready answer from a verified tutor is just a click away for as little as $14.99


  

Click Order Now to get 100% Original Answer Customized to your instructions!

HOME TO CERTIFIED WRITERS

Why Place An Order With Us?

  • Certified Editors
  • 24/7 Customer Support
  • Profesional Research
  • Easy to Use System Interface
  • Student Friendly Pricing

Have a similar question?

PLAGIRAISM FREE PAPERS

All papers we provide are well-researched, properly formatted and cited.

TOP QUALITY

All papers we provide are well-researched, properly formatted and cited.

HIGHLY SECURED

All papers we provide are well-researched, properly formatted and cited.

ScholarMatic: Get Started

Assignment Writing Service

Feel safe and secure when placing an order on our portal!
Fruitful cooperation begins with solid guarantees, and we are professional enough to promise perfect results. Let’s get it started!