lexical description problem in language report?

Simon Peyton-Jones simonpj@microsoft.com
Wed, 25 Jul 2001 05:21:18 -0700


I agree with Thomas's suggestion:

a) Change the definition of lexeme
b) Move lexical discussion from 5.5.1 to 2.4

It also looks that Christian is correct in revising the details of (a).

Thomas, do you agree?

Would this resolve the various lexical issues?

Thanks for your help.

Simon


| -----Original Message-----
| From: Christian Sievers [mailto:sievers@ips.cs.tu-bs.de]=20
| Sent: 24 July 2001 20:45
| To: haskell@haskell.org
| Subject: Re: lexical description problem in language report?
|=20
|=20
| Thomas Hallgren wrote:
|=20
| >   program ->  {lexeme | whitespace }
| >   lexeme  ->  varid | conid | varsym | consym | literal | special |
| > reservedop | reservedid
| >=20
| > There is no reference to qualified names here. I thought=20
| the purpose=20
| > of
| > these productions were to say that a Haskell program is=20
| correct on the=20
| > lexical level iff there is a derivation of it in the=20
| lexical grammar,=20
| > starting from the nonterminal "program". Since qualified=20
| names are not=20
| > part of this grammar, they are not part of the lexical=20
| syntax, which=20
| > contradicts the text in section 5.5.1.
| >=20
| > So, I repeat my improvment suggestions: include qvarid,=20
| qconid, etc,=20
| > in
| > the production for lexeme. Move the explanation of the lexical=20
| > properties of qualified names from section 5.5.1 to section 2.4.
|=20
| You could still parse a qualified name as three lexemes.
| Of course you don't want this, as this would allow white=20
| space between them. For the same reason, you want backquoted=20
| functions and constructors to be only one lexeme. In order to=20
| achieve this, just use qop instead of qvarsym and qconsym.=20
| And we need opencom, as the report says {- is a lexeme.
|=20
| So I suggest:
|=20
|   lexeme  -> qvarid  | qconid  | qop
|            | literal | special | reservedop | reservedid | opencom
|=20
|=20
| It's all not new. See:=20
| http://www.dcs.gla.ac.uk/mail-| www/haskell/msg01596.html
|=20
|=20
http://www.dcs.gla.ac.uk/mail-www/haskell/msg01730.html


All the best
Christian Sievers

_______________________________________________
Haskell mailing list
Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell