CMSC430 Week 1 Discussion

Question # 00853818 Posted By: wildcraft Updated on: 04/30/2024 03:18 AM Due on: 04/30/2024
Subject Computer Science Topic General Computer Science Tutorials:
Question
Dot Image

CMSC 430

Week 1 Discussion

Contains unread posts

Starts Mar 13

The projects for this course require a Linux environment that has the compiler tools flex and bison together with make and the GNU g++ compiler. Explain what Linux environment you plan to use and post a screen shot demonstrating that your environment has the required tools.

The language that you will be expected to write a compiler for is a language created for this course. A functional language was chosen because such languages can be easily interpreted without generating any intermediate code. It is important that you understand the language first, so examine the lexical rules that are provided in the project 1 specification in week 2 and the syntax rules that are provided with the project 2 specification in week 4. Write a short program in this language that contains one function, and has at least one input, one variable and one statement of your choice. Show the output of that program on two different inputs. Here is an example of the kind of program you should create:

// A Simple Program with a When and Switch Statement

function main a: integer returns integer;     b: integer is when a > 10, 1 : 2; begin     switch b is         case 1 => 10;         case 2 => 20;         others => 30;       endswitch;     end;

If this program is run with an input of 5, it returns 10. If it is run with an input of 15, it returns 20. If you have any questions on the semantics of this language, post your question as a response to this topic.

Dot Image
Tutorials for this Question
  1. Tutorial # 00849301 Posted By: wildcraft Posted on: 04/30/2024 03:19 AM
    Puchased By: 2
    Tutorial Preview
    The solution of CMSC430 Week 1 Discussion...
    Attachments
    CMSC430_Week_1_Discussion.ZIP (18.96 KB)

Great! We have found the solution of this question!

Whatsapp Lisa