Re: gcc parser

Michael Meissner <meissner@cygnus.com>
2 Nov 1999 00:40:00 -0500

          From comp.compilers

Related articles
gcc parser addam@purdue.edu (Addam Schroll) (1999-10-27)
Re: gcc parser tej@melbpc.org.au (Tim Josling) (1999-10-31)
Re: gcc parser meissner@cygnus.com (Michael Meissner) (1999-11-02)
| List of all articles for this month |
From: Michael Meissner <meissner@cygnus.com>
Newsgroups: comp.compilers
Date: 2 Nov 1999 00:40:00 -0500
Organization: Cygnus Solutions
References: 99-10-129
Keywords: C, parse, GCC

Addam Schroll <addam@purdue.edu> writes:


> I want to use the gcc parser for my own purposes to speed up
> development on a little project I've been working on. Basically, I
> want to add my own actions to the gcc parser so I get the behavior I
> want. This is my first endeavor into gcc and I was wondering if
> anyone could give me a few links that might help me understand the gcc
> parser code and point me in a good direction to get the source (other
> than downloading all of gcc itself if possible). I'd appreiciate any
> help.


The parser itself is written in Bison, which borrows its syntax from
YACC (yet another compiler compiler from the PWB/v7 unix releases).
The bison source release contains all of the documentation and you can
buy the hardcopy of the manual from the Free Software Foundation (or
many technical bookstores). Likewise, the GCC manual includes a
section on porting and internals, though like most complex software
projects, the internals documentation could be vastly improved upon.


However, the parser itself is a small fraction of the whole compiler.
You will need the full source in order to modify the parser. If you
have purchased a full Linux release (such as RedHat), it contains the
full source to the compiler (RedHat/Mandrake/SUSE put the sources in a
source cd stored within rpm files). You can also purchase a copy from
cdrom vendors fairly cheaply that contain the GCC sources (ideally if
you go the purchase route, you should purchase from a vendor that
contributes part of the fee back to the Free Software Foundation).


Do take a moment to look at the license if you plan to ever distribute
the modified compiler.


Out of curiousity, what exactly do you want to do? You might want to
hook up with the various GCC mailing lists
(http://www.gnu.org/software/gcc/lists.html) to better ask questions,
etc.


Oh, and by the way, have fun!
--
Michael Meissner, Cygnus Solutions
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886
email: meissner@cygnus.com phone: 978-486-9304 fax: 978-692-4482


Post a followup to this message

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