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),你的語法的入口點將是第一條規則的類別。另一種方法是添加'入口點類型'來設置入口點。 –