我正在使用JLex和cup .i编写用java编写的haskell编译器.i完成了我的lexer文件,现在我正在处理我的parser.cup文件,我应该定义我的终端,非终端和语法 . 我已经完成了终端和非终端部分,但现在我卡在语法部分,所以任何人都可以帮助或重定向到我可以找到这种形式的haskell语法的任何链接:

Variable ::= Nonterminal:name Terminal:name 
{:RESULT = /* code to execute when the rule is 
matched and the result to be printed out */ ;:} 
| blablabla ;

任何帮助,将不胜感激 .