[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
[https://www.getlazarus.org/learn/language/lexical/#identifier]
It should look as follows:
┌────────────────────────────────────────────────────────────────────┐
Identifiers
>>─── identifier ──┬─ letter ─┬─┬──────────────┬───────────────────><
└─── _ ────┘ ^─┬─ letter ─┬─┘
├─ digit ──┤
└─── _ ────┘
└─────────────────────────────────────────────────────────────────────┘
Note that identifiers can also start with a <underscore>
2) The Program unit structure
[https://www.getlazarus.org/learn/language/lexical/#program_header]
Strictly speaking (but mostly not used these days), the PROGRAM syntax
can also take a parenthesis with input,output identifiers.
eg:
program MyUnit (input,output);
....
3) Unit Header
[https://www.getlazarus.org/learn/language/lexical/#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
immediately.
Regards,
Graeme
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
My public PGP key: http://tinyurl.com/graeme-pgp
More information about the fpc-pascal
mailing list