caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Christoph Bauer" <Christoph.Bauer@lmsintl.com>
To: "Erik de Castro Lopo" <mle+ocaml@mega-nerd.com>,
	<caml-list@yquem.inria.fr>
Subject: RE: [SPAM?][Caml-list] Handling include files using ocamllex
Date: Thu, 2 Aug 2007 12:29:14 +0200	[thread overview]
Message-ID: <BB046CA812535C45BD0029AA9D04BA79012BFA38@KL-SRV57.lmsintl.com> (raw)
In-Reply-To: <20070802200933.3621fb1a.mle+ocaml@mega-nerd.com>

> Hi all,
> 
> I doing some simple parsing with ocamllex and ocamlyacc and I 
> need to be able to handle C style include files.
> 
> I know how to do this in C with flex and bison, but I can't 
> figure out how to do it with ocamllex and ocamlyacc.
> 
> Anyone know how to do this?

A solution could be to create an lexbuf from a function with
Lexing.from_function.
This function has to manage a stack of open channels and positions. It
has to 
scan for "#include"-statements and copies instead of these statements
the contents
of the corresponding files into the buffer.

Just an idea, I haven't done it yet.

Christoph Bauer


  reply	other threads:[~2007-08-02 10:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-02 10:09 Erik de Castro Lopo
2007-08-02 10:29 ` Christoph Bauer [this message]
2007-08-02 10:42   ` [Caml-list] " Erik de Castro Lopo
2007-08-02 13:19   ` [SPAM?][Caml-list] " skaller
2007-08-05  4:52     ` [Caml-list] " Erik de Castro Lopo
2007-08-05  5:35       ` Erik de Castro Lopo
2007-08-05 10:16       ` skaller
2007-08-05 10:33         ` Erik de Castro Lopo
2007-08-05 11:55           ` Jacques GARRIGUE
2007-08-05 12:17             ` Erik de Castro Lopo

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=BB046CA812535C45BD0029AA9D04BA79012BFA38@KL-SRV57.lmsintl.com \
    --to=christoph.bauer@lmsintl.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=mle+ocaml@mega-nerd.com \
    /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;
as well as URLs for NNTP newsgroup(s).