congo-cc / congo-parser-generator

The CongoCC Parser Generator, the Next Generation of JavaCC 21, which in turn was the next generation of JavaCC
https://discuss.congocc.org/
Other
36 stars 11 forks source link

Another try at a revised python Parser_productions template #48

Closed adMartem closed 1 year ago

adMartem commented 1 year ago

I believe this solves the problem with the earlier attempt at aligning the python template with Java and CSharp. My fix here to the PythonTranslator is direct, but ugly. But then the translators seem to be a big ball of ugly, by design.

adMartem commented 1 year ago

I think this begs the question if a cleaner implementation overall would be to use an alias like PRODUCTION_NODE (consistent with the use of CURRENT_NODE) to refer to the non-terminal node of the enclosing production instead of thisProduction. My opinion is that it would.