input-output-hk / marlowe-cardano

Marlowe smart contract language Cardano implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Investigate grammar replacement for Extended Marlowe

hrajchert opened this issue · comments

Currently the parsing of the textual representation of Marlowe is done solely on the Playground in JavaScript/PureScript using the nearley/grammar libraries. We need to switch for a BNF grammar parser generator so we can use the same grammar in the marlowe-cli (written in Haskell). This issue blocks issue 157.

Good candidates to investigate are:

  • BNFC - A Haskell EBNF converted, seems good but doesn't have a JS/PS implementation, would need to see how hard it is to make one. There is an unfinished PR from 2015 that targets Jison
  • Jison - A tool that creates JS parser from BNF. It doesn't seem to be actively maintained.
  • ANTLR - A Java based BNF parser generator. It has a nice GUI and it can output JavaScript parsers but not Haskell. According to their documentation, it requires quite a large runtime in order to run in the browser, so performance might be an issue.