0
为什么下面的语法不能识别nat -> nat
但确实识别(nat -> nat)
,我该如何解决这个问题?如何正确使用强制使得不需要括号?
TNat . Typ4 ::= "nat" ;
TVoid . Typ4 ::= "<>" ;
TProd . Typ3 ::= SumType;
TProd . Typ2 ::= Typ2 "*" Typ3;
TArrow . Typ1 ::= Typ1 "->" Typ2;
coercions Typ 4;
我很高兴地看到,你找到了解决办法。给一点解释:除非你[明确地设置](http://bnfc.readthedocs.io/en/latest/lbnf.html#entry-point-pragmas),你的语法的入口点将是第一条规则的类别。另一种方法是添加'入口点类型'来设置入口点。 –