From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18132 invoked by alias); 9 Oct 2006 20:09:14 -0000 Received: (qmail 18123 invoked by uid 22791); 9 Oct 2006 20:09:14 -0000 X-Spam-Check-By: sourceware.org Received: from wx-out-0506.google.com (HELO wx-out-0506.google.com) (66.249.82.231) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 09 Oct 2006 20:09:12 +0000 Received: by wx-out-0506.google.com with SMTP id s19so1660553wxc for ; Mon, 09 Oct 2006 13:09:10 -0700 (PDT) Received: by 10.70.42.15 with SMTP id p15mr11897452wxp; Mon, 09 Oct 2006 13:09:09 -0700 (PDT) Received: by 10.70.37.16 with HTTP; Mon, 9 Oct 2006 13:09:08 -0700 (PDT) Message-ID: Date: Mon, 09 Oct 2006 20:09:00 -0000 From: "Rob Quill" To: "Michael Snyder" , gdb@sourceware.org Subject: Re: YACC/Lex In-Reply-To: <1160417660.14535.33.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1160417660.14535.33.camel@localhost.localdomain> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00045.txt.bz2 Thanks for your help with this and my previous email. I'm not going to be using to parse anything so difficult as a whole language. I just need it to parse some LTL formulae. The basic aim for what I am trying to do is allow GDB to do some relatively simple model checking, which assuming I can get it working efficiently should make debugging quite a bit easier as the programmer can just check the properties of small sections of code to see that they hold, and it means that, as it is integrated into GDB, there is no need for a seperate tool for formal verification. Would I be right in saying that it wouldn't be OK to mix O'Caml and C for GDB? (I'm almost certain I am, bt correct me if I'm not) Thanks, Rob On 09/10/06, Michael Snyder wrote: > On Mon, 2006-10-09 at 12:44 +0100, Rob Quill wrote: > > Hi, > > > > Is it ok to use code generated by YACC and/or Lex in GDB? If not, what > > alternatives are there? > > First of all, the open source / gnu / fsf equivalents are byacc (bison), > and flex. Bison and byacc are two independent implementations of a > yacc equivalent. If I remember correctly, gdb will work with bison but > prefers byacc. I'm not sure if it will work with yacc itself any more. > > If you cd to the gdb source directory and do "ls *.y", you will see > that there are existing (b)yacc parsers for ada, c, java, fortran, > pascal and modula-2, plus a few more. There's also a separate lexer > for ada, ada-lex.l. > > Look at the makefile to see how these get built, and then if you want to > pursue it further, look at language.c and language.h. > > Michael > >