English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Stream parser/make_lexer
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-06-26 (14:24)
From: Oliver Bandel <oliver@f...>
Subject: Re: [Caml-list] Stream parser/make_lexer
On Sun, Jun 26, 2005 at 03:25:36PM +0200, Sen Horak wrote:
> Ok, but that still doesn't answer my question (on how to connect the
> stdin channel to a <> compatible char stream).

Yes, sorry, I was a littlebid off-topic.
But you asked, if the stream-parsers are
And you also asked, if most people are using ocamllex/ocamlyacc.
So I thought it was for your interest too,
to hear such opinions about selecting ocamllex/ocamlyacc.

For later I will try the other parer-stuff too, but for now,
where I look to get some projects running, it's best to do it
such a "compatible" way.
So rapid development can be done in OCaml very fast. And when all
goes well, the software will be ported back to C, if not possible
to show the people that it's better to let it as it is (and in OCaml).

If this did not interest you, sorry.

> > I sometimes used the Stream-Module.
> > But in the last time I switched more to ocamllex/ocamlyacc.
> > The reason is, that I find them a good tool for many things.
> > But I didn't tried the camlp4-stuff. It may be more easy to
> > write complicated parsers with thema and maybe more elegant.
> The documentation says that the parser interface is no longer
> supported by proper ocaml, so we need to preprocess with ocampp4.

Well ocampp4? The first time I hear from ocampp4.

> > But one reason to use ocamllex/ocamlyacc is that they are
> > similar to lex/yacc, and therfore, if programming in a
> > commercial field, porting the Ocaml-software back to C
> > (even if not really happy about this), is easier.
> The parser interface seems to be a nice thing if you want to "script"
> in ocaml - that is, if you want to write quick and dirty solutions to
> problems that you would ordinarily do in Perl/PYthon etc.

Ah, ok. Fine. ;-)

> Of course, if you want to write a more complex parser, it's better to
> do it in lex/yacc.

Ah, ok. So then I decided the right way. :)

Sometimes it seems to mee, that people who are writing about
the stream-parsers on this list, would ´choose this because it's
good for doing hard parser stuff.
So I maybe misunderstood this.

As I planned (for a long time, but now started to lift up my ass and
start with it) to implement own languages (Domain Specific Languages),
so I need a tool for doing the lex-/parse-stuff.

I will start with simple things, but I'm shure it will be complex
short time later... :)

And as maybe said before, I'm happy to have OCaml on my side. :)

BTW: is there something like a converter from OCaml to C, so
that I can write OCaml-code but for people who wants it in C
it can be converted automatically?
(Well, they should install ocaml instead... but....)