RE: [sv-bc] Keywords

From: Kevin Cameron <sv-xx_at_.....>
Date: Tue Apr 26 2005 - 23:09:00 PDT
> From - Tue Apr 26 19:16:39 PDT 2005
> Z-Region: grfx.com = commercial
> Z-Region: [smtp3.]stanford.edu = educational
> Z-Region: [cis.]stanford.edu = educational
> Z-Reflector: eda.org
> X-Authentication-Warning: server.eda.org: majordom set sender to owner-sv-bc@eda.org using -f
> Message-Id: <200504270209.j3R29rI01493@quicksand.Cadence.COM>
> Date: Tue, 26 Apr 2005 22:09:53 -0400 (EDT)
> From: Steven Sharp <sharp@cadence.com>
> Subject: RE: [sv-bc] Keywords
> To: sv-xx@grfx.com, mac@verisity.com
> Cc: sv-bc@eda.org
> Content-MD5: MNphzsaOl8yi2V48iYhzDw==
> X-Received: By mx-sanjose.cadence.com as j3R29tch009842 at Tue Apr 26 19:09:56 2005
> X-Virus-Scanned: ClamAV 0.83/855/Tue Apr 26 06:40:32 2005 on server.eda.org
> X-Virus-Scanned: ClamAV 0.83/855/Tue Apr 26 06:40:32 2005 on server.eda.org
> X-Virus-Status: Clean
> Z-EndOfHeader: 31, Strikes = 0, Save = 2
> 
> Mac wrote:
> 
> >But in truth the real issues with context sensitive keywords are
> >elsewhere:
> >
> >  - with the human, who is not as good remembering that there was some
> >  keyword 10k bytes back that made 'xyzzy' a keyword now, where as
> >  usualy one would be free to use it as a variable name...
> 
> It makes _reading_ the code hard for humans too, who see a keyword in
> unexpected syntax and don't realize it is a variable, not some weird
> syntax they never learned.
> 
> And while context-sensitive lexing can be done, it makes the job harder.
> Things get particularly nasty with error recovery after a syntax error.
> If the lexer gets into the wrong state, it may become hopeless.
> 
> Steven Sharp
> sharp@cadence.com

I'm not sure I agree that context-sensitive parsing is much harder, or that
error recovery is any worse. As I said before I generally write context
sensitive recursive descent parsers, and I find that they generally give
better error messages than grammar/rule driven parsers.

Anyway, the point is to support backward compatibility rather than bad
programming style, and I'm sure once folks familiarize themselves with new
keywords they'll stop using them for variable names.

Kev.
Received on Wed Apr 27 01:08:13 2005

This archive was generated by hypermail 2.1.8 : Wed Apr 27 2005 - 01:10:08 PDT