All elements of the Pascal language are explained in syntax diagrams. Syntax diagrams are like flow charts. Reading a syntax diagram means getting from the left side to the right side, following the arrows. When the right side of a syntax diagram is reached, and it ends with a single arrow, this means the syntax diagram is continued on the next line. If the line ends on two arrows pointing to each other, then the diagram is ended.
Syntactical elements are written like this
Keywords which must be typed exactly as in the diagram:
When something can be repeated, there is an arrow around it:
When there are different possibilities, they are listed in rows:
Note, that one of the possibilities can be empty:
This
means that both the first or second possibility are optional. Of course, all these elements can be
combined and nested.
For some syntactical elements you will find no definition in the various diagrams. This is because they are defined implicitly in the pascal parser: the tokens of the pascal language.
The following elements are defined implicitly:
This is a literal string.
This can be an integer number or a floating point number.
This is basically a name the programmer has given to an item he wishes to use in his code. This item can be a type, a variable, a constant or even the name of a procedure or unit.
Comments or whitespace will not appear in the syntax diagrams.