GerHobbelt / jison

bison / YACC / LEX in JavaScript (LALR(1), SLR(1), etc. lexer/parser generator)
https://gerhobbelt.github.io/jison/
MIT License
117 stars 20 forks source link

Generate lexer/parser in different programming language #46

Open GerHobbelt opened 5 years ago

GerHobbelt commented 5 years ago

Output, for example, code in TypeScript. Or maybe even C. :smile:

Way to do this as a general solution: output the lexer and parser tables, plus user action code chunks, as an object/JSON file, which can be picked up by a simple postprocessor/template engine, which can then generate said lexer/parser in the user's choice of language.

The alternative is going back to bison and learning M4... :unamused: