Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Yacc limitations
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: brogoff <brogoff@s...>
Subject: Re: [Caml-list] Yacc limitations
On Thu, 22 Sep 2005, yoann padioleau wrote:
> > I am getting very much annoyed with the obtusity of the LALR-yacc parser
> > generators. I have unsurmountable difficulties at teaching ocamlyacc how
> > to parse SQL decently.
> >
> > What is the "way to go" in terms of parser generators for Ocaml? I'd
> > like to see if there is some level of agreement in the community on this
> > issue.

It would be great to see an all OCaml parser generator, something really fancy,
like an Earley parser. I say "all OCaml", as opposed to, say an OCaml backend
for some existing tool like ANTLR, because code cannibalization is good.
Anyways, if you're looking to do something like this, an ocamllex compatible,
mostly yacc like earley style parser generator would be interesting. Or one
that generates the scanner too. To get people to move beyond yacc you need
to offer something that's both better and (mostly) compatible. All IMO of
course.

> I personnaly use ocamlyacc and even if there is some difficulties, I like it.

I use it because I know yacc, and lots of people I work with know yacc, it
comes with OCaml, and there's a lot of available documentation. I wouldn't say
I like it, but I don't hate it and it's good enough and I'm too lazy to learn
anything else right now.

> All the ocaml project that I know that need some complex parsing use ocamlyacc.
> Some people also use streams but are limited to write LL(1) grammars.

No, they make it easy to write recursive descent parsers "inline", and it's
pretty easy (too easy) to hack recursive descent parsers to handle greater
lookaheads. Neat stuff, but not widely used as far as I can see.

-- Brian