From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24654 invoked by alias); 30 Mar 2010 19:05:20 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 24641 invoked by uid 22791); 30 Mar 2010 19:05:19 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <4BB24B69.3000300@redhat.com> Date: Tue, 30 Mar 2010 19:05:00 -0000 From: Chris Moller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: Sergio Durigan Junior CC: Project Archer Subject: Re: Parser rewritting References: <201003301546.34866.sergiodj@redhat.com> In-Reply-To: <201003301546.34866.sergiodj@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2010-q1/txt/msg00096.txt.bz2 There are a couple of antlr C++ parsers available: http://hg.netbeans.org/main/file/tip/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/cppparser.g http://www.antlr.org/grammar/1198064893071/CPP_parser_v_3.2.zip as well as a C++ preprocessor: http://hg.netbeans.org/main/file/tip/cnd.apt/src/org/netbeans/modules/cnd/apt/impl/support/aptlexer.g I don't know how easy/hard they'd be to adapt to use in GDB, but they might be worth looking at. And I'm just about certain it would be easier to use them than to write a whole new parser--antlr is a lot less weird than bison. There's antlr package in brewroot. On 03/30/10 14:46, Sergio Durigan Junior wrote: > Hello! > > As you may have noticed, in the last Archer meeting I brought a topic into > discussion: the rewritting of the GDB's parser. The current parser is written > using Bison, and unfortunately it is insufficient to satisfy our current > needs, especially for C++ productions. > > With that in mind, Tom asked me to start this discussion in the mailing-list > to see what you think about it. We decided to send an e-mail to the archer > list at first; this topic will eventually be discussed at the gdb list as > well. > > I am sorry I took so long to send this e-mail, but I was trying to come up > with an initial plan to re-implement the parser. I've been studying GCC/G++ > parsers in order to understand how they work, but I noticed that it would take > some time for me to think in a good plan. I also noticed that other people > here have (much!!) more experience about parsers than I do, so why not > exposing this idea and see what you think? > > The initial idea (by Tom) would be to mimic the current structure of the G++ > parser. There is also another proposal (from Keith), but I don't know if he > wants it to be listed here :-). Feel free to post it, Keith! > > Any more ideas? Comments about the exinsting ideas are also welcome, of > course. Meanwhile, I'll continue studying this parser stuff and will try to > propose something useful in some time. > > Regards, > >