we-like-parsers / pegen

PEG parser generator for Python
https://we-like-parsers.github.io/pegen/
MIT License
155 stars 33 forks source link

Advice request - general purpose parser generator? #28

Closed alakeev closed 3 years ago

alakeev commented 3 years ago

Hi, in your series you've mentions that:

The result may not be a great general-purpose PEG parser generator — there are already many of those (e.g. TatSu is written in Python and generates Python code)

After nine episodes and several years of developing pegen, if you were to define a grammar and generate a parser for a completely different language, would you do it using Pegen or stick to a third-party solution like TatSu?

pablogsal commented 3 years ago

pegen is specially tailored to the Python language and although is quite general, it has some level of coupling with the Python tokenizer, so in general unless your language is very similar to Python I would recommend something more generic like TatSu.

Being said that, we are working on a release so soon you can use pegen if you want.

alakeev commented 3 years ago

Thank you for the answer, tokenizer was exactly what bothered me