caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* my own exceptions from ocamlyacc?
@ 2010-10-11 10:22 oliver
  2010-10-11 12:55 ` [Caml-list] " Basile Starynkevitch
  0 siblings, 1 reply; 6+ messages in thread
From: oliver @ 2010-10-11 10:22 UTC (permalink / raw)
  To: caml-list

Hello,

the header-section from ocamlyacc appears in the
*.ml file of the parser, but not in the mli-file.

Therefore, when I define an exception in the header section
it is not available from the outside.


At least I saw not how to achieve that.

Is there a way to make that happen?
I don't want to change the mli file every time I recompiled...


Ciao,
   Oliver


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

* Re: [Caml-list] my own exceptions from ocamlyacc?
  2010-10-11 10:22 my own exceptions from ocamlyacc? oliver
@ 2010-10-11 12:55 ` Basile Starynkevitch
  2010-10-11 13:25   ` Chris Yocum
  2010-10-11 13:50   ` oliver
  0 siblings, 2 replies; 6+ messages in thread
From: Basile Starynkevitch @ 2010-10-11 12:55 UTC (permalink / raw)
  To: oliver; +Cc: caml-list

On Mon, 11 Oct 2010 12:22:49 +0200
oliver@first.in-berlin.de wrote:
> 
> the header-section from ocamlyacc appears in the
> *.ml file of the parser, but not in the mli-file.


Maybe menhir is better in that respect (I don't know). Did you try it?
http://gallium.inria.fr/~fpottier/menhir/


Cheers.
-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***


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

* Re: [Caml-list] my own exceptions from ocamlyacc?
  2010-10-11 12:55 ` [Caml-list] " Basile Starynkevitch
@ 2010-10-11 13:25   ` Chris Yocum
  2010-10-11 13:45     ` oliver
  2010-10-11 13:50   ` oliver
  1 sibling, 1 reply; 6+ messages in thread
From: Chris Yocum @ 2010-10-11 13:25 UTC (permalink / raw)
  To: Basile Starynkevitch; +Cc: oliver, caml-list

[-- Attachment #1: Type: text/plain, Size: 602 bytes --]

I had a similar problem.  The solution was to create another module
which was opened inside the Parser module.  This way you can add your
own interface on top of the Parser/Lexer module.  I hope this helps.

Chris

On 11/10/10 13:55, Basile Starynkevitch wrote:
> On Mon, 11 Oct 2010 12:22:49 +0200
> oliver@first.in-berlin.de wrote:
>>
>> the header-section from ocamlyacc appears in the
>> *.ml file of the parser, but not in the mli-file.
> 
> 
> Maybe menhir is better in that respect (I don't know). Did you try it?
> http://gallium.inria.fr/~fpottier/menhir/
> 
> 
> Cheers.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

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

* Re: [Caml-list] my own exceptions from ocamlyacc?
  2010-10-11 13:25   ` Chris Yocum
@ 2010-10-11 13:45     ` oliver
  0 siblings, 0 replies; 6+ messages in thread
From: oliver @ 2010-10-11 13:45 UTC (permalink / raw)
  To: caml-list

On Mon, Oct 11, 2010 at 02:25:52PM +0100, Chris Yocum wrote:
> I had a similar problem.  The solution was to create another module
> which was opened inside the Parser module.  This way you can add your
> own interface on top of the Parser/Lexer module.  I hope this helps.
[...]

Hmhhh, something like that I also had in mind,
but I would like to circumvent this, if possible.

Ciao,
   Oliver


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

* Re: [Caml-list] my own exceptions from ocamlyacc?
  2010-10-11 12:55 ` [Caml-list] " Basile Starynkevitch
  2010-10-11 13:25   ` Chris Yocum
@ 2010-10-11 13:50   ` oliver
  2010-10-11 20:33     ` Dario Teixeira
  1 sibling, 1 reply; 6+ messages in thread
From: oliver @ 2010-10-11 13:50 UTC (permalink / raw)
  To: caml-list

On Mon, Oct 11, 2010 at 02:55:29PM +0200, Basile Starynkevitch wrote:
> On Mon, 11 Oct 2010 12:22:49 +0200
> oliver@first.in-berlin.de wrote:
> > 
> > the header-section from ocamlyacc appears in the
> > *.ml file of the parser, but not in the mli-file.
> 
> 
> Maybe menhir is better in that respect (I don't know). Did you try it?
> http://gallium.inria.fr/~fpottier/menhir/
[...]

Hmhh, a while ago I tried around with menhir, but did not really used it.
I have that in mind for cases, when ocamlyacc would become too annoying,
but at least at the moment I'm fine with ocamlyacc.

I thought menhir is necessary for more complex grammars; don't know if it
helps me here.

As this is used for a private project and I have many things that take my attention,
I would like to only change to other tools, if necessary.

Maybe the separate compilation unit approach would be easier in limited time.

But thanks for the hint.

Ciao,
   Oliver


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

* Re: [Caml-list] my own exceptions from ocamlyacc?
  2010-10-11 13:50   ` oliver
@ 2010-10-11 20:33     ` Dario Teixeira
  0 siblings, 0 replies; 6+ messages in thread
From: Dario Teixeira @ 2010-10-11 20:33 UTC (permalink / raw)
  To: caml-list, oliver

Hi,

> Hmhh, a while ago I tried around with menhir, but did not really used it.
> I have that in mind for cases, when ocamlyacc would become too annoying,
> but at least at the moment I'm fine with ocamlyacc.
> 
> I thought menhir is necessary for more complex grammars;
> don't know if it helps me here.

I find that Menhir's advantages over Ocamlyacc go beyond accepting a
superset of grammars.  For instance, Menhir allows the use EBNF notation,
which makes the grammar productions much simpler and easier to read.
Moreover, Menhir facilities for debugging and 'explaining' the grammar
make it a much friendlier tool for beginners and experts alike.

Cheers,
Dario Teixeira






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

end of thread, other threads:[~2010-10-11 20:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-11 10:22 my own exceptions from ocamlyacc? oliver
2010-10-11 12:55 ` [Caml-list] " Basile Starynkevitch
2010-10-11 13:25   ` Chris Yocum
2010-10-11 13:45     ` oliver
2010-10-11 13:50   ` oliver
2010-10-11 20:33     ` Dario Teixeira

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