-- Andreas, 2021-04-24 -- Strict category checking in list rules. -- Bad: (:[]). [Exp] ::= Exp1 "end"; -- Exp1 only allowed in [Exp1] (:). [Exp] ::= Exp1 "then" [Exp]; -- Exp1 only allowed in [Exp1] -- Also bad: (:[]). [Exp1] ::= Exp "end"; -- Exp only allowed in [Exp] (:). [Exp1] ::= Exp "then" [Exp1]; -- Exp only allowed in [Exp] -- -- Good: -- (:[]). [Exp1] ::= Exp1 "end"; -- Exp1 only allowed in [Exp1] -- (:). [Exp1] ::= Exp1 "then" [Exp1]; -- Exp1 only allowed in [Exp1] EInt. Exp1 ::= Integer; EPlus. Exp ::= Exp "+" Exp1; coercions Exp 1;