Re: Looking for C parser

From: Francois Pessaux (
Date: Fri Dec 11 1998 - 16:13:15 MET

Message-Id: <>
Subject: Re: Looking for C parser
In-Reply-To: Your message of "Thu, 10 Dec 1998 15:25:57 +0100."
Date: Fri, 11 Dec 1998 16:13:15 +0100
From: Francois Pessaux <>

> 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:
More accurately look for the line " The ANSI C grammar (Yacc and Lex) "

This will lead you at:

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 ;-)


(* Francois PESSAUX ( *)
(* INRIA Rocquencourt - Projet CRISTAL *)
(* ( *)

This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:17 MET