COSC 4400 - Compiler Construction Spring 2019 Gustave Programming Language This semester we will be working on a compiler for a subset of Eiffel. Eiffel is an object-oriented language which is particularly known for its support of "design by contract". Eiffel is named after the builder of the Eiffel tower, Gustave Eiffel. Therefore, our "little" version of Eiffel will be called Gustave. A formal grammar for Gustave is attached, as well as a sample program which uses most of the features in Gustave. You can find many tokens in the grammar. Here is a brief mention of aspects of the language not apparent from the grammar. Comments are indicated by two dashes ("--") and extend to the end of the current line. Strings are available for use in output statements (put_string). There is no string type and no string operations in Gustave. String literals are enclosed in double quotes. There are three special symbols within strings: %" represents a double quote character, %N represents a newline, and %% represents a percent character. For example, the string The "sale" was 1% off!, with a newline after, would be written "The %"sale%" was 1%% off!%N" . Identifiers begin with a letter and can continue with letters, digits, and underscore ("_"). Within functions, the name Result is a special variable to hold the return value of the function. It is automatically declared to match the function return type. I would recommend that the lexeme "Result" be given its own token (like a keyword). The convention in Eiffel is that class names consist entirely of upper-case letters (ACCOUNT rather than Account) and that constants begin with a capital letter followed by lower-case (Maxargs rather than MAXARGS). This is the opposite of the convention in Java. Some Eiffel compilers require the class names to be upper-case. We won't worry about it in Gustave, but I will try to always declare class names in upper-case. Numeric constants consist of an unsigned string of digits (0-9). Boolean literals are the keywords true and false.