Using BNFC to determine a basic language for propositional logic (syntax error)
问题 I would like to parse sentences in propositional logic using BNFC. I wrote the following BNF grammar to facilitate this: Negation. N ::= "(" "-" L")"; Conjuction. C ::= "(" L "&" L ")"; Disjuction. D ::= "(" L "|" L ")"; Implication. I ::= "(" L "=>" L ")"; Equivalence. E ::= "(" L "<=>" L ")"; Atom. L ::= Ident | N | C | D | I | E ; However, with this construction I get the following error: syntax error at line 6, column 27 before `|' What is syntactically incorrect about the specification I