Language Description

Introduction

The S06 language will be similar to standard algorithmic languages, but will not follow any one in particular. You will not have an extensive library for input, output, system calls, or memory allocation.

The lexigraphical structure of the language is defined as follows:

Tokens do not cross new lines. If lex cannot produce a string or number, you do not have to either. An error message is appropriate if you truncate something, however. An underflow (a floating point number that rounds off to 0 instead of whatever it really is in infinite precision arithmetic), however, is not an error, and should be treated as 0.

There are several special functions for reading and printing data types (double, integer, and string). These will be provided as C code for use by your compiled programs. However, you will have to pass information to these functions correctly. This will be much clearer when you get to the code generation part of the project.

Defining It by Example

The easiest way to see what the language really is, is to study one or more examples. The base example code is contained in two files: mg-s06.h and mg.s06. The target machine is defined in s06.c. A sample of what your compiler should produce is in yourmain.h.

Class examples are also a nice way to spark discussions since none of your languages will be quite the same. Below are samples submitted as part of the parsing portion of the class project.

Name Short Examples
(< 20 Lines)
Long Examples
(20-40 Lines)
Longer Example
(41+ Lines)
Eli Arnaudova 18 LOC
Divya Bansal 35 LOC
Cindy Burklow 67 LOC
Pete Carey 36 LOC
Soham Chakraborty 35 LOC
Aarthi Jayaram 21 LOC
Wei Li 34 LOC
Nathan Liang 23 LOC
Mark Maynard 14 LOC
Derrick Spell 28 LOC
Jianzhong Wang 12 LOC
Li Wang 18 LOC