Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Modula 3 > Re: Modula-3 gr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 105 of 151
Post > Topic >>

Re: Modula-3 grammar ambiguity (a puzzle)

by Olaf Wagner <wagner@[EMAIL PROTECTED] > Dec 1, 2004 at 07:05 AM

In comp.lang.modula3 Dragi?a Duri&#263; <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            | 
\/////////////////////////////////////////////////////////////////
 




 2 Posts in Topic:
Modula-3 grammar ambiguity (a puzzle)
dragisha@[EMAIL PROTECTED  2004-11-29 22:52:35 
Re: Modula-3 grammar ambiguity (a puzzle)
Olaf Wagner <wagner@[E  2004-12-01 07:05:58 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 23:07:23 CDT 2008.