The lexical elements of the DSL are:

A program is described by the following context-free grammar (CFG) [Note: this grammar is typeset differently in the PostScript version of the paper.]

program ::= *statement-list*

statement ::= **Id** `=` *expression*

statement-list ::= *statement*

statement-list ::= *statement-list* *statement*

expr ::= **Id**

expr ::= **Num**

expr ::= *expr* `+` *expr*

expr ::= `length``(` *expr* `)`

expr ::= `range``(` *expr* `)`

expr ::= `dist``(` *expr* `,` *expr* `)`

expr ::= `(/` *expr-list* `/)`

expr ::= `(/` **Id** `in` *expr* `:` *expr* `/)`

For this example, we use the array constructor notation from
Fortran 90 to specify literal sequences and a similar notation to specify
the sequence comprehension construct. However, the sequence comprehension
construct creates arbitrarily nested, *irregular* sequences. (In
contrast, the array constructor from Fortran 90 can only generate vectors or
rectangular arrays.)