CMSC430 Week 1 Discussion

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.

-
Rating:
5/
Solution: CMSC430 Week 1 Discussion