From: Pascal Brisset <Pascal.Brisset@wanadoo.fr>
To: caml-list@inria.fr
Subject: GNU C parser prototype in Caml
Date: Sat, 10 Feb 2001 20:10:59 +0100 [thread overview]
Message-ID: <14981.37443.521758.10069@whynot.localdomain> (raw)
There were discussions about parsing ANSI C with Caml a few weeks ago.
I recently tried to write a parser for a significant subset of GNU C.
Basically, it parses most of the Linux kernel source tree, including
the challenging GNU C "features" demonstrated in:
int a, b;
typedef int t, u;
void f1() { a * b; }
void f2() { t * u; }
void f3() { t * b; }
void f4() { int t; t * b; }
void f5(t u, unsigned t) {
switch ( t ) {
case 0: if ( u )
default: return;
}
}
(After realizing that this is legal gcc code, I gave up on fixing the
last few grammar conflicts. Also, I have no idea whether it is
actually safe to do side effects between ocaml's parser and lexer.)
The code is currently part of a larger project distributed at :
http://perso.wanadoo.fr/pascal.brisset/kernel3d/kernel3d.html
Fixes are welcome.
-- Pascal Brisset
reply other threads:[~2001-02-10 21:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14981.37443.521758.10069@whynot.localdomain \
--to=pascal.brisset@wanadoo.fr \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox