Previous - Up - Next

4.2   Lexical Structure

For the most part, the lexical structure of DML resembles that of C. However, DML distinguishes between "object context" and "C context", so that some C keywords such as register, signed and unsigned, are allowed as identifiers in object context, while on the other hand many words that look like keywords in the object context, such as bank, event and data, are in fact allowed as identifiers in all contexts.

Another major difference from C is that names do not generally need to be defined before their first use. This is quite useful, but might sometimes appear confusing to C programmers.

Reserved words
All ISO/ANSI C reserved words are reserved words in DML (even if currently unused). In addition, the C99 and C++ reserved words restrict, inline, this, new, delete, throw, try, catch, and template are also reserved in DML. The C++ reserved words class, namespace, private, protected, public, using, and virtual, are reserved in DML for future use.

The following words are reserved specially by DML: after, assert, call, cast, defined, error, foreach, in, is, local, log, parameter, select, sizeoftype, typeof, undefined, vect, and where.

Identifiers in DML are defined as in C; an identifier may begin with a letter or underscore, followed by any number of letters, numbers, or underscores. Within C context, object-context identifiers are always prefixed by a $ character.
Constant Literals
DML does not support octal constants (written with a leading 0 in C); however, DML adds binary constants, written "0b...", as in 0b1111 or 0b11000011.
Both ordinary C-style (/*...*/) comments and C++/C99 (//...) comments are allowed in DML.

Previous - Up - Next