Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Looking for C parser
@ 1998-12-10 14:25 Hugues CASSE
  1998-12-11 15:13 ` Francois Pessaux
  0 siblings, 1 reply; 2+ messages in thread
From: Hugues CASSE @ 1998-12-10 14:25 UTC (permalink / raw)
  To: CAML

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.

					Thank you for your answer.

-- 
------------------------------------------------------------------------
CASSE Hugues             |Heureux qui,comme Ulysse,a fait un beau voyage
IRIT, 1R1, p14	         |Ou comme celui-la qui conquit la Toison,
                         |Et puis est retourne plein d'usage et raison,
PHONE: (+33)5-61-556-611 |Vivre entre ses parents le reste de son age !
       (poste 73-20)     |                        Les Regrets, Du Bellay
------------------------------------------------------------------------
mailto:casse@irit.fr                    http://www.irit.fr/~Hugues.Casse




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Looking for C parser
  1998-12-10 14:25 Looking for C parser Hugues CASSE
@ 1998-12-11 15:13 ` Francois Pessaux
  0 siblings, 0 replies; 2+ messages in thread
From: Francois Pessaux @ 1998-12-11 15:13 UTC (permalink / raw)
  To: casse, caml-list


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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-12-14  8:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-10 14:25 Looking for C parser Hugues CASSE
1998-12-11 15:13 ` Francois Pessaux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox