In comp.lang.modula3 Dragi?a Durić <dragisha@[EMAIL PROTECTED]
> wrote:
> I am writing a parser for Modula-3 and this production puzzled me:
> ObjectType = [TypeName | ObjectType] [Brand] OBJECT Fields
> [METHODS Methods] [OVERRIDES Overrides] END.
> This rule is single left recursive piece of Modula-3 grammar, IIRC.
> And also, it does not look correct - I can't remember I've seen
> anything except "TypeName" (meaning "qualId | [UNTRACED] ROOT")
> denoting parent type anywhere in Modula-3 sources. It is also
> illogical (to me, at least) to have anonymous type as parent of
> anything, and we will have that if this is declared:
> TYPE
> My = OBJECT a: CARDINAL; END OBJECT b: CARDINAL; END;
> This "My" is in proper syntax according to above production, but pm3
> did not accept it. I have no reason to believe any Modula-3 compiler
> will. Is there a reason? Do we have an ommision in Modula-3 syntax or
> implementation restriction in our compilers?
Probably, but I wouldn't worry very much, as the feature
to inherit from anonymous object types is of no practical
interest, I think. Have you tried the CM3 compiler, too?
At least I cannot think of a good reason to allow it, but
perhaps I'm missing something.
--
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|| Olaf Wagner | wagner(at)luthien.in-berlin.de (priv.)|
|| Cranachstrasse 7 | wagner(at)elego.de (business) |
|| D-12157 Berlin | phone: +49 30 85 60 26 70 |
|| Germany / Deutschland | fax: +49 30 85 58 01 88 |
\/////////////////////////////////////////////////////////////////
--
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|| Olaf Wagner | wagner(at)luthien.in-berlin.de (priv.)|
|| Cranachstrasse 7 | wagner(at)elego.de (business) |
|| D-12157 Berlin | phone: +49 30 85 60 26 70 |
|| Germany / Deutschland | fax: +49 30 85 58 01 88 |
\/////////////////////////////////////////////////////////////////


|