Macro processors (Glen Ditchfield)
Wed, 21 Oct 1992 14:39:29 GMT

          From comp.compilers

Related articles
m5: macro processor Dain.Samples@UC.Edu (1992-10-20)
Macro processors (1992-10-21)
Macro processors (Peter Jefferies) (1993-08-04)
Re: Macro processors (1993-08-04)
Re: Macro processors (1993-08-04)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Glen Ditchfield)
Organization: University of Waterloo
Date: Wed, 21 Oct 1992 14:39:29 GMT
References: 92-10-076
Keywords: macros

Some people at Texas Instruments produced an extended C preprocessor with
a powerful macro facility that can gather text up to an arbitrary
delimiter, skipping over matched parentheses and quotes along the way,
pass the text through an arbitrary filter, and paste the result back in.
They used it to provide a fair imitation of C++'s template facility. For
instance, in

        template<class T> class Vector<T> {
T* v;
int sz;
T& operator[](int);
inline T& elem(int i) { return v[i]; }

the "template" macro gathers up the class body and salts it away for
future instantiation.
      The last time I looked, the preprocessor (and a bunch of other stuff)
was available for anonymous ftp from in /pub/COOLsomething.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.