Article View: comp.std.c++
Article #743Help Preprocessor
From: John MAX Skaller
Date: Sun, 04 Oct 1992 08:57
Date: Sun, 04 Oct 1992 08:57
44 lines
1845 bytes
1845 bytes
I've got a few minor problems with the specifications for the
preprocessor.
The issue of incomplete /* comments in preprocessor commands is one.
#define fred a + /* incomplete
comment spans lines here */ b
Is the above legal?
The ARM claims
"The source text is decomposed into preprocessing tokens and sequences
of white space. A single white space replaces each comment. A source
file may not end in a partial comment.
[Then, on the next pass]
"Preprocessing directives are executed and macros expanded".
This is a bit tricky. For a start this seems to imply
preprocessor commands can be continued by comments, since
the comments are just replaced by white.
But then it is absurd because if all the newlines were replaced
by white (they are white anyhow) then there would be no way
to delimit the end of the preprocessor command.
Secondly, there might be problems with
#include <filename>
since the < and > are toke. But the filename is implementation dependent.
To fix this, one would have to parse the '#include' tokenising
the rest of the line. (contrary to the ARM requirement).
Any help?
--
;----------------------------------------------------------------------
JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Technical Details
Message-ID:
<1992Oct4.085733.7703@ucc.su.OZ.AU>Path:
arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!sgiblab!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtalShow Full Headers
Complete Article Headers
Newsgroups: comp.std.c++ Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!sgiblab!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) Subject: Help Preprocessor Message-ID: <1992Oct4.085733.7703@ucc.su.OZ.AU> Sender: news@ucc.su.OZ.AU Nntp-Posting-Host: extro.ucc.su.oz.au Organization: MAXTAL P/L C/- University Computing Centre, Sydney Date: Sun, 4 Oct 1992 08:57:33 GMT Lines: 44