Our Services

Get 15% Discount on your First Order

[rank_math_breadcrumb]

430 CMSC

CMSC 430 Project 3

The third project involves modifying the attached interpreter so that it interprets programs for the

complete language.

When the program is run on the command line, the parameters to the function should be supplied

as command line arguments. For example, for the following function header of a program in the

file text.txt:

function main x: integer, y: integer returns character;

One would execute the program as follows:

$ ./compile < test.txt 10 -10

In this case, the parameter x would be initialized to 10 and the parameter y to -10. An example

of a program execution is shown below:

$ ./compile < test.txt 10 -10

1 // Determines the quadrant of a point on the x-y plane

2

3 function main x: integer, y: integer returns character;

4 begin

5 if x > 0 then

6 if y > 0 then

7 ‘1’;

8 elsif y < 0 then

9 ‘4’;

10 else

11 ‘Y’;

12 endif;

13 elsif x < 0 then

14 if y > 0 then

15 ‘3’;

16 elsif y < 0 then

17 ‘2’;

18 else

19 ‘Y’;

20 endif;

21 else

22 if y <> 0 then

23 ‘X’;

24 else

25 ‘O’;

26 endif;

27 endif;

28 end;

Compiled Successfully

Result = 52

After the compilation listing is output, the value of the expression which comprises the body of

the function should be displayed as shown above.

The existing code evaluates some of the arithmetic, relational and logical operators together with

the case statement and decimal integer and real literals only. You are to add the necessary code

to include all of the following:

 Hexadecimal integer and character literals that include escape characters

 All additional arithmetic operators

 All additional relational and logical operators

 Both if and fold statements

 Functions with multiple variables

 Functions with parameters

The fold statement repeatedly applies the specified operation to the list of values, producing one

final value. A left fold associates the operator left to right and a right fold right to left. For

example, the following left fold:

fold left – (3, 2, 1) endfold;

would be evaluated as ((3 – 2) – 1) = 0, but using a right fold:

fold right – (3, 2, 1) endfold;

It would be evaluated as (3 – (2 – 1)) = 2. For operations that are associative, the result would be

the same whether it is as folded to the left or right.

This project requires modification to the bison input file, so that it defines the additional the

necessary computations for the above added features. You will need to add functions to the

library of evaluation functions already provided in values.cc. You must also make some

modifications to the functions already provided.

You are to submit two files.

1. The first is a .zip file that contains all the source code for the project. The .zip file

should contain the flex input file, which should be a .l file, the bison file, which should

be a .y file, all .cc and .h files and a makefile that builds the project.

2. The second is a Word document (PDF or RTF is also acceptable) that contains the

documentation for the project, which should include the following:

a. A discussion of how you approached the project

b. A test plan that includes test cases that you have created indicating what aspects

of the program each one is testing and a screen shot of your compiler run on that

test case

c. A discussion of lessons learned from the project and any improvements that could

be made

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

computering part 7

The goal of this project is to integrate your various components into polished, professional products. Follow the instructions below to ensure a successful submission: Apply Feedback: Review and incorporate all feedback received from previous submissions (Parts 2-6). Enhance and Improve: Refine any of the three required items (cover letter with

Discussion and Replies

Please see attachment for instructions     Discussion   In 250 words total, answer the questions below with 4 evidence base scholarly articles. APA format. Based on the readings this week, 1. Discuss some common strategies and pitfalls you have seen with business continuity. 2. Discuss some common strategies and

sociology

The goal of this project is to integrate your various components into polished, professional products. Follow the instructions below to ensure a successful submission: Apply Feedback: Review and incorporate all feedback received from previous submissions (Parts 2-6). Enhance and Improve: Refine any of the three required items (cover letter with

Python

  Instructions Create a simple Python application (Save as w5_firstname_lastname.py) . Create a Python script that takes two parameters to do the following:- 1) List all files names, size, date created in the given folder 2) Parameter1 = Root Folder name Parameter2= File size >>> to filter file size (

Python

  Instructions:  Describe methods for securing Python code. Pick at least ONE of the methods for securing node and deep dive into what it means and how it is used to secure code.   

Discussion 8 of 459

Follow the attach instruction to complete the work. 1. What is one specific technology you found the most intriguing throughout the course? 2. If you were to be a hacker, which building block vector would you choose to attack your selected technology and why?

WK 4 Discussion and Replies

Please see attachment for instructions     Discussion   In 250 words total, answer the questions below with 4 evidence base scholarly articles. APA format. Discussion on access control and physical security. These areas found to be one or more points of weakness in audit 1. Discuss some common points of

Node.js

  Instructions Create a simple Node.js server (Save as w4_firstname_lastname.js) . Create a restful application similar to the one in lesson 4 (ReSTFul Web Services). Document the routing table, and the application you created. Submit your week 4 work in w4_firstname_lastname.txt (Please save the file as a text file and

Computer Science- Python Gurobi assignment

I need the output following these steps: Put all of these files into the same folder, Open the python file, If there is any error, check if any file is missing, It has 105 counties and 4 districts, so it will take a while to finish running. I need it

Research Project

Please follow the instructions attached below:  I have choose the topic from the list is:   PROJECT TITLE Firm RTOS – Balancing Real-Time Performance and Flexibility Please check the abstract from my file and write the research project. 

provide me java based interview question.

Core Java Interview Questions (Basic Level) 1. What is Java? Java is a high-level, object-oriented, platform-independent programming language developed by Sun Microsystems. 2. What are the features of Java?  Object-Oriented  Platform Independent (via JVM)  Secure and Robust  Multithreaded  Architecture Neutral  High Performance (via JIT

Dynamons world Mod APK

 What are the best tips for playing RPG games like Dynamons World? I recently found a great resource at that offers a lot of insights and even MOD APKs for Dynamons World, but I’d love to hear personal strategies and gameplay advice from the community too! ???????? 

459 w7

Follow the attach instructions to complete this work. Questions: 1. What is Generative AI and how is it similar/different to Traditional AI? 2. Do you believe that work created by Generative AI (e.g. ChatGPT) is comparable in quality to human created content?  What challenges and opportunities  does Generative AI pose

Computer Science WK3 Assignment

Please see attachment for instructions ISSC680 Week 3 Homework Assignment Instructions: Please provide a one-page response to the following topic utilizing supporting documentation obtained from the attach books and the Internet. APA format and reference. Topic: Differentiate between the different types of cryptographic algorithms.

Discussion and Replies

Please see attachment for instructions     Discussion   In 250 words total, answer the questions below with 4 evidence base scholarly articles. APA format. Based on this weeks readings, 1. Discuss some effective strategies for Security Awareness in your organization or 2. What you would like to see implemented