Lexical structure
The input is divided into a sequence of symbols of the following kinds:
- a punctuation character: one of ``( ) , ; [ ]'',
- an identifier:
either
- 1.
- a letter or underscore followed by zero or more letters, underscores or digits
(followed by zero or more single quotes), or
- 2.
- a sequence of graphic characters that are neither white-space, letters,
underscores, digits, punctuation nor one of ``! " ''',
- a numeric literal:
a sequence of digits
(on some systems, optionally with an embedded decimal point
and an optionally signed exponent),
- a character literal:
either a single character (but not a newline),
or a character escape sequence (as in the C language),
enclosed in single quotes, or
- a string literal:
a sequence of zero or more characters
(but not newlines of double quotes) or character escape sequences,
enclosed in double quotes.
Symbols may be separated by white-space and comments.
A comment is introduced by `!' and continues to the end of the line.
The following identifiers are reserved by the language:
++ --- : <= == => |
abstype data dec display else edit exit if in
infix infixr lambda let letrec private save then
type typevar uses where whererec write
The following identifers are also reserved,
for compatability with other implementations:
end module nonop pubconst pubfun pubtype
Also, the following synonyms are available:
\
for lambda,
use for uses and
infixrl for infixr.
Ross Paterson <ross@soi.city.ac.uk>