🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5529

ANSI C token set (including $ and @)

#5529
From: Leendert van Doorn
Date: Thu, 22 Dec 1988 10:35
29 lines
1864 bytes
In article <11262@haddock.ima.isc.com> karl@haddock.ima.isc.com writes:

>>anything using @ or $ (since they're not part of the C character set)
>
>That's what I thought, too, until I noticed that 3.1.7 in the May88 dpANS
>contains an example wherein @ and $ are scanned as separate preprocessing
>tokens.  The accompanying text does not mention whether or not this behavior
>is required of a conforming implementation.

This example is valid. Hence the behaviour is required of a conforming
implementation. This has to do with section 2.1.1.2 (phases of translation).
In phase 3 the source file is decomposed into preprocessing tokens, and
in phase 7 the preprocessor tokens are converted into (normal) tokens.
This allows @ and $ character to be part of the preprocessor token set,
but not to be part of the (normal) token set.

However, nowhere in the standard is the conversion of preprocessor tokens
to (normal) tokens described. This is an issue that should be clarified.

In the compiler I wrote the lexical analyser simply breaks up the input into
preprocessor tokens and these go (without any conversion) into the compilation
process. The later one will filter out illegal things like $ and @. (the
parser chokes and starts up an error recovery routine).

-- 
Leendert P. van Doorn 			   		 <leendert@cs.vu.nl>
Vrije Universiteit / Dept. of Maths. & Comp. Sc.
De Boelelaan 1081
1081 HV Amsterdam / The Netherlands			tel. +31 20 548 5302
Technical Details
Message-ID: <1844@zell.cs.vu.nl>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!leendert@cs.vu.nl

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!leendert@cs.vu.nl
From: leendert@cs.vu.nl (Leendert van Doorn)
Newsgroups: comp.std.c
Subject: ANSI C token set (including $ and @)
Message-ID: <1844@zell.cs.vu.nl>
Date: 22 Dec 88 10:35:08 GMT
Sender: leendert@cs.vu.nl
Reply-To: leendert@cs.vu.nl (Leendert van Doorn)
Organization: VU Informatica, Amsterdam
Lines: 29