Re: ANSI C PreProcessor [news:comp.lang.c++ trimmed from header]

"Dann Corbit" <>
4 Jan 2002 00:11:02 -0500

          From comp.compilers

Related articles
ANSI C PreProcessor (2002-01-03)
Re: ANSI C PreProcessor [news:comp.lang.c++ trimmed from header] (Dann Corbit) (2002-01-04)
Re: ANSI C PreProcessor [news:comp.lang.c++ trimmed from header] (Christian Bau) (2002-01-05)
Re: ANSI C PreProcessor [news:comp.lang.c++ trimmed from header] (Volker Barthelmann) (2002-01-14)
| List of all articles for this month |

From: "Dann Corbit" <>
Newsgroups: comp.lang.c,comp.compilers
Date: 4 Jan 2002 00:11:02 -0500
References: 02-01-013
Keywords: C, comment
Posted-Date: 04 Jan 2002 00:11:02 EST

"yuval" <> wrote in message
> I need to make an Ansi C PreProcessor. I would be happy to get help
> from someone who did it in the past.
> Now I am in the grammar part. I want to get a BNF grammar for the C
> PreProcessor.
> Thanks a lot
> Yuval
> [I would look at the freely available C preprocessors that have been
> discussed here. And then I would use one of them, rather than wasting
> time writing yet another one. -John]

>From the C FAQ:

18.3: What's a free or cheap C compiler I can use?

A: A popular and high-quality free C compiler is the FSF's GNU C
                compiler, or gcc. It is available by anonymous ftp from
       in directory pub/gnu, or at several other FSF
                archive sites. An MS-DOS port, djgpp, is also available;
                see the djgpp home page at .

                There is a shareware compiler called PCC, available as
                PCC12C.ZIP .

                A very inexpensive MS-DOS compiler is Power C from Mix Software,
                1132 Commerce Drive, Richardson, TX 75801, USA, 214-783-6001.

                Another recently-developed compiler is lcc, available for
                anonymous ftp from in pub/lcc/.

                A shareware MS-DOS C compiler is available from
       Registration is optional for
                non-commercial use.

                There are currently no viable shareware compilers for the

                Archives associated with comp.compilers contain a great deal of
                information about available compilers, interpreters, grammars,
                etc. (for many languages). The comp.compilers archives
                (including an FAQ list), maintained by the moderator, John R.
                Levine, are at . A list of available compilers and
                related resources, maintained by Mark Hopkins, Steven Robenalt,
                and David Muir Sharnoff, is at in pub/compilers-
                list/. (See also the comp.compilers directory in the
                news.answers archives at and; see
                question 20.40.)

                See also question 18.16.

18.15: Where can I get a BNF or YACC grammar for C?

A: The definitive grammar is of course the one in the ANSI
                standard; see question 11.2. Another grammar (along with
                one for C++) by Jim Roskind is in pub/c++grammar1.1.tar.Z
                at (or perhaps, or perhaps
                OLD/pub/c++grammar1.1.tar.Z), or at in
                u/s/scs/roskind_grammar.Z . A fleshed-out, working instance
                of the ANSI grammar (due to Jeff Lee) is on
                (see question 18.16) in usenet/net.sources/ansi.c.grammar.Z
                (including a companion lexer). The FSF's GNU C compiler
                contains a grammar, as does the appendix to K&R2.

                The comp.compilers archives contain more information about
                grammars; see question 18.3.

                References: K&R1 Sec. A18 pp. 214-219; K&R2 Sec. A13 pp. 234-
                239; ISO Sec. B.2; H&S pp. 423-435 Appendix B.

  "The C-FAQ Book" ISBN 0-201-84519-9
[The only free or freeish C compilers I know of with source available
are GCC and lcc. -John]

Post a followup to this message

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