The following words are reserved:
abstract end extends integer is of string syntax tree with
A keyword can be used as an identifier by prefixing it by a sharp symbol (``#'') as in ``#string''.
Identifiers are made of letters (lower or upper case letters), digits, and underscores (``_''). They must begin with a letter or an underscore and may end by an arbitrary number of quotes (``''').
If a keyword is used as an identifier, it must be prefixed by a sharp symbol (``#'').
It is also possible to use an arbitrary string. In this case, it must be inclosed between single quotes, and quotes inside the string itself must be doubled. This possibility will be useful when names are generated in some way.
The following lex syntax is used to define identifiers.
Syntax:
id --> [a-zA-Z][a-zA-Z0-9\_]*'* | #[a-zA-Z][a-zA-Z0-9\_]*'* | '([^'\n|''])*'
Upper and lower case letters must be considered as different. An identifier prefixed with a sharp sign is equivalent to one without.
Examples:
plus, Exp, #integer, op'', '+_exp'
Note that the as pretty-printer will produce only the sharp symbols (``#'') and quotes (``''') that are necessary.
Comments begin with the double minus sign (``-'') anywhere on the line and continue to the end of the line.
Example:
-- This is a comment
Unlike in most computer languages, empty lines cannot be found anywhere in the text. They can appear only inside a list of declarations and generate a node in the abstract syntax. Such empty lines do not have any semantical meaning, but are there to give a textual structure to the text. This features is only used as a test in the current Centaur environment and may not survive in a future version of the language.
Here is the lex definition of a line:
Syntax:
line --> \n[ ]*\n