An ELENA module consists of one or more source files. A source file is an ordered sequence of Unicode characters (usually encoded with the UTF-8 encoding).
There are several sequences of input elements: white space, comments and tokens. The tokens are the identifiers, keywords, literals, operators and punctuators.
The raw input stream of Unicode characters is reduced by ELENA DFA into a sequence of <input elements>.
Of these basic elements, only tokens are significant in the syntactic grammar of an ELENA program.
ELENA White space are a space, a horizontal tab and line terminators. They are used to separate tokens.
ELENA uses c++-style comments:
ELENA comments do not nest. Comments do not occur inside string literals
An identifier is a sequence of letters, underscore and digits starting with letter or underscore. An identifier length is restricted in the current compiler design (maximal 255 characters)
ELENA identifiers are case sensitive.
A full identifier is a sequence of identifiers separated with "'" characters. It consists of a namespace and a proper name. A full identifier length is restricted in the current compiler design (maximal 255 characters)
A local identifier is a sequence of letters, underscore and digits starting with '$' character. A local identifier length is restricted in the current compiler design (maximal 255 characters)
A keyword is a sequence of letters starting with '#' character. Currently only following keywords are used though others reserved for future use: #class, #symbol, #static, #field, #method, #constructor, #var, #loop, #define, #type, #throw, #break. Keywords can be placed only in the beginning of the statement.
A literal is the source code representation of a value.
An integer literal may be expressed in decimal (base 10) or hexadecimal(16).
A floating-point literal has the following parts: a whole-number part, a decimal point, and fractional part, an exponent. The exponent, if present, is indicated by the Unicide letter 'e' or 'E' followed by an optionally signed integer.
At least one digit, in either the whole number or the fraction part, and a decimal point or an exponent are required. All other parts are optional.
Real literals are represented with 64-bit double-precision binary floating-point formats.
A string literal consists of zero or more characters enclosed in double quotes. Characters may be represented by escape sequences.
String literal escape sequences
The string literal escape sequences allow for the representation of some non-graphic character as well as the double quote and percent character.
Operators and punctuators
There are several kinds of operators and punctuators. Operators are short-cut form of messages taking one operand. Punctuators are for grouping and separating.