top | item 19336097

(no title)

xitrium | 7 years ago

Curious if the author could comment on what Menhir is lacking, my estimation is possibly just the concrete syntax trees, though you could definitely emit an AST that has as much of that as you need to do the tasks the author mentions.

discuss

order

WalkerCodeRangr|7 years ago

Author here.

I don't have any direct experience with Menhir because I haven't tried to write a compiler in OCaml yet. It does seem to be one of the better parser generators and is frequently recommended. Skimming the docs, its seems to be lacking in these areas:

  * Concrete syntax trees (as you pointed out)
  * LR(1) will probably still be more restrictive than I want
  * Unicode support (defaults to ocamllex, requires custom code to use ulex)
  * Intransitive Operator Precedence isn't supported (though it does have regular precedence levels and associativity)
  * While it looks to have better error handling than most LR parser generators, I suspect it still isn't where I'd want it to be.
I suspect there are other issues, but I don't want to go any further beyond my knowledge base than I already have. I've been thinking about writing on this topic more, if I do, then I might address this more.

xitrium|7 years ago

Thanks! The new .messages error message mechanism is great, though we'll see if it supports the full brunt of user needs soon enough.