From -5751075857318148299
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,7c8761567d23844,start
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-07-24 12:22:02 PST
Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!colt.net!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: "Gennaro Prota" <gennaro_prota@my-deja.com>
Newsgroups: comp.std.c++
Subject: header-name tokenization
Date: Tue, 24 Jul 2001 19:20:39 GMT
Organization: [Infostrada]
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <s2S57.4165$8M2.162143@news.infostrada.it>
X-Trace: mail2news.demon.co.uk 996002462 mail2news:2147 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Date: Fri, 20 Jul 2001 10:34:32 MET DST
Lines: 54
Xref: archiver1.google.com comp.std.c++:6697



[
TO THE MODERATOR: this is a question I posted some days ago without any
answer; maybe it was not so interesting to inspire someone to reply or,
maybe, my wording was a bit obscure. Can I ask it again? :-)
]

Hi everybody,
 after reading the clause 2.8 of the standard I have some doubts about
header-name prep-tokens,  for instance:
 if I write

    #define HEADER_NAME "myfiles/file.h"

how is "myfiles/file.h" parsed? As a single header-name prep-token, as a
single string-literal prep-token, or as a sequence of tokens?

I ask this after a look to STLport's source code, which in order to locate
some headers coming with specific compilers uses macros like the following:

    #  define _STLP_NATIVE_HEADER(x) <../crt/##x>

which are then used in #include directives, e.g:

    # include _STLP_NATIVE_HEADER(string)

I'm very confused about this tecnique! For the x to be identified as a
macro-parameter, isn't it needed that it is parsed as a separate token
(identifier)? So, I see two possibilities: or <../crt/##x> gives a single
header-name/string-literal (which one?) token, so we end up having
_STLP_NATIVE_HEADER's replacement list as if it didn't contain the parameter
name, or <../crt/##x> is parsed as:

 token(<) token(.) token(.) token(/) token (crt) token (/) token(##)
token(x) token (>)

but in that case ## is illegal because, due to the slash, it can't give a
SINGLE valid token.

Am I right? Thanks everybody for the help! :-)



Genny.



---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]



