How to parse Python grammar?

I have a really simple question. You know the formal grammar for Python at this link:

https://docs.python.org/3.4/reference/grammar.html

This suggests that it is a grammar that is given to the parser generator.

Which generator uses Python? Also, does it output Python code?

+4
source share
1 answer

If you want to parse Python code using Python, you can use https://docs.python.org/3/library/ast.html - an abstract tree syntax module.

+1
source

Source: https://habr.com/ru/post/1615787/


All Articles