Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!greg From: greg@utcsri.UUCP (Gregory Smith) Newsgroups: net.lang.c Subject: Re: Datalight faster than 4.2, why? Message-ID: <2912@utcsri.UUCP> Date: Wed, 4-Jun-86 12:20:01 EDT Article-I.D.: utcsri.2912 Posted: Wed Jun 4 12:20:01 1986 Date-Received: Wed, 4-Jun-86 12:25:11 EDT References: <1723@umcp-cs.UUCP> <3844@sun.uucp> Reply-To: greg@utcsri.UUCP (Gregory Smith) Organization: CSRI, University of Toronto Lines: 26 Summary: In article <3844@sun.uucp> guy@sun.uucp (Guy Harris) writes: >> And again, we would still need a separate cpp to make the kernel, > >Well, note that if a "cc" is to be considered a real UNIX "cc", it will have >to support "-P" and "-E". This means that if you don't have a separate >preprocessor, there will have to be *some* way of running just the >preprocessor part of the lexical analyzer and getting compilable C output >from it. (Sorry, any of you people who want to bundle "cpp" and the lexical >analyzer, but that's the way it is.) Given that, you can either hack "cc" Bee's Knees. Any c compiler with an integral cpp will have a function 'inchar()' ( or possibly a macro for speed ) which is called from the lexer to get the next input char from the cpp. In effect, 'inchar()' runs the cpp. So the -E option is done by the following magnum opus (which of course is also used to debug the cpp code ): while( (c=inchar()) !=EOF ) putc( c, outfile ); Modularity in software design does not imply a separate program for each module. -- "We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel ---------------------------------------------------------------------- Greg Smith University of Toronto UUCP: ..utzoo!utcsri!greg