[fpc-pascal] Pascal Lexical Diagrams

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Mon Feb 1 10:53:48 CET 2016


On 2016-01-30 12:26, Jürgen Hestermann wrote:
> The look of the diagrams is very good.

Call me old-fashioned, but what is wrong with the EBNF (Extended
Backus-Naur Form) which is also an ISO standard.

   https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_Form

I think the EBNF syntax is crystal clear to read and follow.

Here is an extract from my "Object Pascal Grammar" addendum to the
official FPC Language Reference documentation:

===========================================================
Number -> [ "-" ], digit, { digit } ;

String ->  "'" , { all characters - "'" }, "'" ;

alphabetic character ->  "A" | "B" | "C" | "D" | "E" | "F" | "G"
                      | "H" | "I" | "J" | "K" | "L" | "M" | "N"
                      | "O" | "P" | "Q" | "R" | "S" | "T" | "U"
                      | "V" | "W" | "X" | "Y" | "Z" ;

digit ->  "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;

all characters ->  ? all visible characters ? ;

===========================================================


Regards,
  - Graeme -

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



More information about the fpc-pascal mailing list