Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] parsing included files recursively using ocamllex and ocamlyacc
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Eckart Goehler <goehler@a...>
Subject: Re: [Caml-list] parsing included files recursively using ocamllex and ocamlyacc

On Sat, 20 Sep 2003, Benjamin Geer wrote:

> Michal Moskal wrote:
> > On Sat, Sep 20, 2003 at 03:38:22PM +0100, Benjamin Geer wrote:
> >>I'm writing an interpreter for a small language (to be released as an
> >>open source library), using ocamllex and ocamlyacc.  I'd like this
> >>language to support an instruction that, at compile time, recursively
> >>includes source code from another file.
> >>
> >>I searched the list archives and found a message
> >>( [snip]
> >
> > Wouldn't it work to simply call parsing function from parser rule?
> Well, the message mentioned above gave me the impression that it
> wouldn't be quite so easy, apparently becuase the generated parsing
> function isn't defined with "let rec".   [snip]

The other point is the lex table generated with ocamlyacc comes inside the
start function.

> So I just wondered: has anyone
> done this?

As already mentioned in
I did that by modifying ocamlyacc. Works pretty well.

I'll put the modified ocamlyacc at
Maybe its possible to modify the official ocamlyacc supporting these
features in future.




	Eckart Goehler
	IAAT, Astronomy
	72076 Tuebingen
	e-mail :


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: