Next: Reserved words
Up: Lexical Considerations
Previous: Lexical Considerations
The following regular expressions are used in the lexical analyser:
letter [a-zA-Z]
digit [0-9]
integer {digit}({digit})*
exponent [Ee][+-]?{integer}
i {integer}
real ({i}\.{i}|{i}{exponent}|{i}\.{i}{exponent})
identifier ({letter}({letter}|{digit}|_)*)
comment --.*
string \"(([^\"\n])|\"\")*\"
In english:
- Integers are strings of digits.
- Reals are strings of digits containing a decimal point; or are
strings of digits with an optional decimal point, followed by an
exponent.
- Identifiers start with a letter and may contain letters, digits, and
underscores.
- Strings are enclosed withing double quotes. Strings may not
be longer than one line. When an unterminated string is found, it will
be noted, and a terminating double quote will be automatically applied.
- We will allow standard ANSI C quoting conventions (i.e., backslashes)
in strings and character constants.
- Comments are introduced by two hyphens and extend to the end of the
line. At this time, the lexer silently ignores all comments.
faith@particle.cs.unc.edu
Wed Aug 31 15:43:33 EDT 1994