OCaml中的LL(1)解析器生成器 [英] LL(1) parser generator in OCaml

查看:154
本文介绍了OCaml中的LL(1)解析器生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在OCaml中寻找LL(1)解析器生成器...有人可以帮我吗?

I'm looking for a LL(1) parser generator in OCaml... Can anybody help me with this?

推荐答案

LALR解析器可以解析LL解析器可以解析的语言的严格超集.因此,我建议使用Ocaml随附的ocamlyacc,它是一个LALR(1)解析器生成器.这可能需要对语法进行一些较小的重写,但是应该不会太难.

Well, LALR parsers can parse a strict superset of the languages which can be parsed by LL parsers. So I would advise simply using ocamlyacc which ships with Ocaml and is an LALR(1) parser generator. This may require some minor rewriting of the grammar, but it shouldn't be too hard.

这篇关于OCaml中的LL(1)解析器生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆