-
Notifications
You must be signed in to change notification settings - Fork 168
Backend ideas
Ideas for new backends
It doesn't seem that there is a canonical tool such as lex/yacc in python. A list of parsing tools for is available on the python wiki: https://wiki.python.org/moin/LanguageParsing
See https://github.com/BNFC/bnfc/issues/76
We could replace those backend by a pandoc backend. This has a few advantages:
- it can generate more formats
- pandoc-types provide a nice API to create documents programatically
- we don't have to maintain a latex backend and a plain text backend separately
Jison is a port of flex/yacc in javascript so it might not be so hard to derive a javascript backend from the C one
An other option might be pegjs
Or Canopy, which can also generate python, java and ruby frontends.
An standard BNF notation (could be used as backend and frontend)
As in http://bnfc.readthedocs.org/en/latest/lbnf.html#the-syntactic-structure-of-bnf
Go comes with a port of yacc which should make adding this fairly easy. There is no flex/lex equivalent though.
The Lemon program is an LALR(1) parser generator. It takes a context free grammar and converts it into a subroutine that will parse a file using that grammar.