[fpc-pascal] Free Pascal Language Diagram

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Sun Sep 23 12:41:14 CEST 2018

On 11/09/18 19:49, Anthony Walter wrote:
> https://www.getlazarus.org/learn/language/lexical/

I found a few small bugs in your diagrams.

1) Identifier

It should look as follows:

>>─── identifier ──┬─ letter ─┬─┬──────────────┬───────────────────><
                   └─── _ ────┘ ^─┬─ letter ─┬─┘
                                  ├─ digit ──┤
                                  └─── _ ────┘

Note that identifiers can also start with a <underscore>

2) The Program unit structure

Strictly speaking (but mostly not used these days), the PROGRAM syntax
can also take a parenthesis with input,output identifiers.

   program MyUnit (input,output);

3) Unit Header

Again, your syntax is incomplete and should look as follows:

  Unit -> UNIT Ident [HintDirective] ';'

I didn't go through the rest in detail, but these are the ones I spotted


fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

My public PGP key:  http://tinyurl.com/graeme-pgp

More information about the fpc-pascal mailing list