[Oberon] Null record fieldlists (was: Oberon Wiki)
Chris Burrows
chris at cfbsoftware.com
Mon Jan 10 00:00:59 CET 2011
>-----Original Message-----
>From: Frans-Pieter Vonck [mailto:fp at vonck.nl]
>Sent: Monday, 10 January 2011 7:56 AM
>To: oberon at lists.inf.ethz.ch
>Subject: [Oberon] Oberon Wiki ; what happend with WITH
>
>Is there anyone of the oberonlist maintaining the wiki page of
>Oberon-2?
>http://en.wikipedia.org/wiki/Oberon-2_%28programming_language%29
>
>I found the following flaw in the "Type binding" section
>
>MODULE Birds;
> TYPE
> Bird* = RECORD
> sound* : ARRAY 10 OF CHAR;
> END;
>END Birds.
>
>The semicolon after CHAR is superfluous.
It is true that the additional semicolon is superfluous in Oberon-2 but it
is not an error. Oberon-2 allows null fieldlists (i.e. ";") similarly to the
way null statements are allowed.
>Actually the Oberon07 compiler of Astrobe rendered the following error.
> 5 36: ident missing
>
That error results because the compiler is expecting the start of another
fieldlist which is an 'ident'.
As well as some obvious syntax changes from Oberon to Oberon-07 there are
some much more subtle ones. This error report results from one of those.
Oberon-07 no longer allows null fieldlists in records. This is a consequence
of this syntax rule in the EBNF:
The EBNF for Oberon is:
FieldList = [IdentList : type]
Now in Oberon it is:
FieldList = IdentList : type
where the [] in EBNF indicate that an item is optional.
I find issues like this easier to understand by following the trail through
syntax diagrams rather than EBNF. The syntax diagrams for Oberon-07 are on
my website at:
http://www.cfbsoftware.com/astrobe/Oberon-07.aspx
Regards,
Chris Burrows
CFB Software
Astrobe v3.2: ARM Oberon-07 Development System
http://www.astrobe.com
More information about the Oberon
mailing list