Question: CMSC 4 3 0 Project 3 The third project involves modifying the attached interpreter so that it interprets programs for the complete language. When the

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
// Determines the quadrant of a point on the x-y plane
function main x : integer, y : integer returns character;
begin
if x>0 then
if y>0 then
'1';
elsif y0 then
'4';
else
''';
endif;
elsif x0 then
if y>0 then
'3';
elsif y0 then
'2';
else
'Y';
endif;
else
if y>0 then
'x';
else
'O';
endif;
endif;
end;
Compiled Successfully
Result =52
 CMSC 430 Project 3 The third project involves modifying the attached

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!