From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA08673 for caml-redistribution; Mon, 14 Dec 1998 09:44:36 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA26868 for ; Fri, 11 Dec 1998 16:13:27 +0100 (MET) Received: from mouton.inria.fr (mouton.inria.fr [128.93.11.37]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id QAA16926; Fri, 11 Dec 1998 16:13:23 +0100 (MET) Received: from mouton.inria.fr (pessaux@localhost.inria.fr [127.0.0.1]) by mouton.inria.fr (8.8.7/8.6.6) with ESMTP id QAA05498; Fri, 11 Dec 1998 16:13:15 +0100 Message-Id: <199812111513.QAA05498@mouton.inria.fr> To: casse@irit.fr, caml-list@inria.fr Subject: Re: Looking for C parser In-Reply-To: Your message of "Thu, 10 Dec 1998 15:25:57 +0100." <366FD9F5.6521@irit.fr> Date: Fri, 11 Dec 1998 16:13:15 +0100 From: Francois Pessaux Sender: weis Hello, > I need to do some translation on a C program based on program tree > (either abstract, or concrete). So I'm looking for a C language parser > and lexer. Try to have a look at: http://www.lysator.liu.se/c/ More accurately look for the line " The ANSI C grammar (Yacc and Lex) " This will lead you at: http://www.lysator.liu.se/c/ANSI-C-grammar-y.html and: http://www.lysator.liu.se/c/ANSI-C-grammar-l.html But you must know that this grammar still allows to write unconsistent C sentences. I used it to write a .h analyzer and I needed to performs of strong pass of consistence-verification of the tree I got this this parser to ensure that sentences are correct. For example, this parser parses some stuff like: struct { void long short long signed int char unsigned volatile foo ; } ... Unless it changed since I got it ;-) Regards, (* Francois PESSAUX (Francois.Pessaux@inria.fr) *) (* INRIA Rocquencourt - Projet CRISTAL *) (* (http://pauillac.inria.fr/~pessaux) *) ;;