【发布时间】:2013-01-31 00:44:20
【问题描述】:
您好,我有 3 个文件 nano.ml,它是类型,以及一个 paser 和 lexer 文件。我不知道如何为解析器编写规则,我尝试编写规则,但它给了我错误,说不接受参数。
当我尝试编译时,它给了我这个
:File "nanoParse.mly", line 31: $1 refers to terminal `LET', which has no argument
Compiling (to byte code) OCAML module nanoLex.ml
ocamlc -dtypes -c nanoLex.ml -o nanoLex.cmo
File "nanoLex.mll", line 10, characters 32-37:
Error: The constructor LET expects 1 argument(s),
but is here applied to 0 argument(s)
并且程序假设做这样的事情:
【问题讨论】:
标签: parsing ocaml lexer parser-generator