The tl;dr is that actions specified in the grammar are specific to the target language. So if you want to use the pegen tool to generate both Python and C code for the same grammar, you would need two grammar files with the same grammar but different actions. Since our goal here is just to generate a parser for use in CPython that's not a problem. Other PEG parser generators make different choices, e.g. TatSu puts semantics actions in a separate file (https://tatsu.readthedocs.io/en/stable/semantics.html).
On Sun, Apr 5, 2020 at 11:06 AM Pablo Galindo Salgado email@example.com wrote:
The only thing I'm missing from the PEP is more detail about how the
cross-language nature of the parser actions are handled.
Expanded the "actions" section in the PEP here: https://github.com/python/peps/pull/1357 _______________________________________________ Python-Dev mailing list -- firstname.lastname@example.org To unsubscribe send an email to email@example.com https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://firstname.lastname@example.org/message/EJMHASPU... Code of Conduct: http://python.org/psf/codeofconduct/