Haskell - How to best to represent a programming language's grammar?

后端 未结 5 1082
星月不相逢
星月不相逢 2021-01-30 09:52

I\'ve been looking at Haskell and I\'d quite like to write a compiler in it (as a learning exercise), since a lot of its innate features can be readily applied to a compiler (pa

5条回答
  •  旧巷少年郎
    2021-01-30 10:17

    Unfortunately there's no Haskell grammar for ANTLR, but perhaps you can use the link cited above to create one. ANTLR is a great Java-based parser generator.

    Steve Yegge has a nice blog about writing compilers, if you need more motivation. It's entertaining.

提交回复
热议问题