Table of Contents
This chapter specifies the lexical structure of the XL programming language. This structure is based on the lexical structure of the Java programming language. Thus, the following features are taken over; for the term definitions see the Java Language Specification.
Programmes are written using the Unicode character set. Unicode
escapes of the form
xxxx is a hexadecimal value, are
translated into the corresponding Unicode character. Following,
the input stream is translated into input characters and line terminators.
The resulting stream is translated into input elements, from which white space and comments are discarded. The result is a stream of tokens that are the terminal symbols of the syntactic grammar. Tokens are identifiers (Section 5.1, “Identifiers”), keywords (Section 5.2, “Keywords”), literals, separators and operators (Section 5.3, “Separators and Operators”).
As for the Java programming language, an identifier is an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter. An identifier cannot have the same spelling as a keyword or a literal.
The XL programming language introduces three new keywords
(Section 5.2, “Keywords”), namely
In order to be able to address existing entities of the Java
runtime environment that have these keywords as simple name,
e.g., the field
System.in or the method
identifiers undergo an additional translation:
If a raw identifier (resulting from the stream of input elements)
happens to be equal to one of the character
$yield, the leading
$ is discarded
and the identifier is subsequently treated as being equal
to the character sequence