BNFC / bnfc

BNF Converter
http://bnfc.digitalgrammars.com/
586 stars 165 forks source link

Update lbnf.rst #229

Closed dmjio closed 6 years ago

dmjio commented 6 years ago

Adjust Exp definition.

Without this change, the ADTs produced will be:

data Exp = EPlus Exp Num | ENum Num
data Num = NOne

instead of

data Exp = EPlus Exp Exp | ENum Num
data Num = NOne
andreasabel commented 6 years ago

Thanks for spotting this and your PR!

I decided to fix it the other way round, since your proposed grammar is ambiguous. There was another problem in the original example: Num will possibly conflict with Haskell's Num, thus I changed it to Number.

See ce7fe1fd08d9d808c14ff626c321218c5b73e38b.