在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ghulette/haskell-parser-examples开源软件地址(OpenSource Url):https://github.com/ghulette/haskell-parser-examples开源编程语言(OpenSource Language):Haskell 63.7%开源软件介绍(OpenSource Introduction):Demonstrate how to write a basic parser for the untyped lambda calculus in Haskell, using the two seemingly most-popular options available: Parsec and Happy/Alex. To build:
To run
This will run each of the parsers and print the AST and evaluation. These parsers were created because I could not find an example of how to parse expressions with an implicit "juxtaposition" operator -- i.e., an expression formed by two expressions side-by-side, e.g., function application in ML-like languages. It turns out to be pretty easy. Note that these parsers should accept exactly the same grammar and generate identical ASTs... but that is a difficult thing to check, so no guarantees! In fact, if you can spot a way in which they are different, I would be very curious to know about it. I do not claim or expect that these parsers are efficient. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论