Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!gem.mps.ohio-state.edu!apple!Apple.COM!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: C++ ... setting new standards for patience Message-ID: <4801@internal.Apple.COM> Date: 17 Oct 89 22:35:58 GMT References: <4208@ncsuvx.ncsu.edu> Sender: usenet@Apple.COM Organization: Objects-R-Us, Apple Computer, Inc. Lines: 46 In article <4208@ncsuvx.ncsu.edu> jnh@ecemwl.ncsu.edu (Joseph N. Hall) writes: > up into 4 parts to illustrate a kind of one-class-one-file approach to > OOP. This means, of course, that all of these header files are processed > 4 times by cfront ... One trick that people use is to make a "master" .c file that includes the normal .c files (each containing 1 class). In the cases where you know that you are going to compile a 4 classes, you are better off compiling the master .c file and parsing the headers only once. > Naturally, there is no #pragma load for cfront. Not only do you have to > include _more_ headers with cfront, you can't pre-compile them, and they > are processed more slowly by cfront than by c, THEN they have to be > processed by C, and they STILL can't be pre-compiled. The headers are only processed by CFront. The output of CFront is C code with all the headers & macros expanded. #pragma dump/load is high on the list of enhancements for CFront. As you said, it isn't a trivial addition. I don't know if this will be in C+ 3.1 final. (As a C++ user, I hope so.) > Cfront and C include special "gibberish" switches (-z3) that produce > and read (respectively) special non-TEXT output; these aren't documented This is a performance improvement. CFront outputs a token stream which is directly read by the C compiler. This avoid having to re-parse the output from CFront. You can ask to see the generated C code with the -c option to CPlus. > are used in the CPlus script. The result, when there's an error that isn't > caught by cfront but which is caught by C, is something like: Any error that is reported by the C compiler is a bug in CFront, no question about it. CFront is supposed to catch all the program syntax errors, so you should never see errors reported by the C compiler. Larry Rosenstein, Apple Computer, Inc. Object Specialist Internet: lsr@Apple.com UUCP: {nsc, sun}!apple!lsr AppleLink: Rosenstein1