Re: problems with identifiers and keywords...

Gracjan Polak <gracjan@acchsh.nospam.com>
19 Nov 2004 00:54:32 -0500

          From comp.compilers

Related articles
[11 earlier articles]
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-11-17)
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-11-17)
Re: problems with identifiers and keywords... lkrupp@pssw.NOSPAM.com.INVALID (Louis Krupp) (2004-11-17)
Re: problems with identifiers and keywords... cfc@shell01.TheWorld.com (Chris F Clark) (2004-11-17)
Re: problems with identifiers and keywords... nmm1@cus.cam.ac.uk (2004-11-19)
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-11-19)
Re: problems with identifiers and keywords... gracjan@acchsh.nospam.com (Gracjan Polak) (2004-11-19)
Re: problems with identifiers and keywords... Martin.Ward@durham.ac.uk (Martin Ward) (2004-11-19)
Re: problems with identifiers and keywords... Peter_Flass@Yahoo.com (Peter Flass) (2004-11-20)
Re: problems with identifiers and keywords... genew@mail.ocis.net (Gene Wirchenko) (2004-11-20)
Re: problems with identifiers and keywords... david.thompson1@worldnet.att.net (Dave Thompson) (2004-11-28)
Re: problems with identifiers and keywords... cgweav@aol.com (2004-11-29)
Re: problems with identifiers and keywords... nmm1@cus.cam.ac.uk (2004-12-01)
[3 later articles]
| List of all articles for this month |

From: Gracjan Polak <gracjan@acchsh.nospam.com>
Newsgroups: comp.compilers
Date: 19 Nov 2004 00:54:32 -0500
Organization: tp.internet - http://www.tpi.pl/
References: 04-10-148 04-10-170 04-10-174 04-11-008 04-11-011 04-11-054
Keywords: syntax, design
Posted-Date: 19 Nov 2004 00:54:32 EST

Louis Krupp wrote:


> The author of the program might even come to find the program
> awkward after learning more of the language and recognizing more of
> the keywords as keywords.


The same applies to compilers, those learn new keywords from time to
time, too. :) It happened to X11 headers written for C originally,
used in C++, which has 'class' as keyword. New compilers couldn't
parse old files.


In the X11 headers, that field is called 'class' when using C, and
called 'c_class' when using C++.


X11/Xutil.h:
      typedef struct {
          Visual *visual;
          VisualID visualid;
          int screen;
          int depth;
      #if defined(__cplusplus) || defined(c_plusplus)
          int c_class; /* C++ */
      #else
          int class;
      #endif
          unsigned long red_mask;
          unsigned long green_mask;


Might be that allowing 'class' as identifier in non keyword context
would provide full backward compatibility. I do not know if it would be
worth it, thought.


--
Gracjan


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.