[NEXT] [PREV]    HANDBOOK / CASE STUDY / The Source Language /

Notation, Terminology, and Vocabulary

Gentle
Applications
Concepts
Examples
Handbook
Support
Download

The syntax is described in Extended Backus Naur Form. Syntactic constructs are denoted by (abbreviated) English words consisting of upper- and lower-case letters, and containing at least one lower-case letter. The angular brackets < and > are omitted. Strings of letters consisting solely of upper-case letters stand for themselves, i.e. for reserved identifiers of the language. Strings of characters enclosed in single quotes ' ' are also to be taken literally. Square brackets [ ] denote optional constructs. Curly brackets { } stand for zero or more repetitions of the enclosed construct. Alternative constructs are separated by a vertical bar |. Parentheses ( ) are used for grouping.

The basic vocabulary of MiniLAX consists of basic symbols classified into delimiters, identifiers, and constants.

Spaces, line ends, and comments may occur anywhere in a program except within a basic symbol. At least one space, line end or comment must occur between any two adjacent identifiers or constants. Otherwise, spaces, line ends, and comments do not influence the meaning of a program.

A comment has the form


   '(*' any sequence of characters not containing *) '*)'

Delimiters

Delimiters are reserved identifiers or (strings of) special characters.

Delim ::= ':' | ';' | ':=' | '(' | ')' | '.' | ','
      | '..' | '[' | ']' | '+' | '*' | '<'
      | 'ARRAY' | 'BEGIN' | 'BOOLEAN' | 'DECLARE' | 'DO'
      | 'ELSE' | 'END' | 'FALSE' | 'IF' | 'INTEGER'
      | 'NOT' |'OF' | 'PROCEDURE' | 'PROGRAM' | 'READ'
      | 'REAL' |'THEN' | 'TRUE' | 'VAR' | 'WHILE'
      | 'WRITE'

Identifiers

Identifiers serve to denote variables and procedures. Their association must be unique within their scope of validity, i.e. within the procedure or function in which they are declared.

Id ::= Letter { Letter | Digit }
All letters and digits of an identifier are significant. Upper and lower case letters are distinguished. Delimiters are reserved identifiers that cannot be used otherwise.

Numbers

The usual decimal notation is used for numbers, which are the constants of the data types integer and real. The letter 'E' preceding the scale factor is pronounced as "'times"10

IntConst    ::= Digit { Digit }
RealConst   ::= [ IntConst ] '.' IntConst [ ScaleFactor ]
ScaleFactor ::= 'E' [ '+' | '-' ] IntConst
Examples:


1   100   .1   87.35E-8





[NEXT] [PREV]