Which tool to use to parse programming languages in Python?

前端 未结 9 1973
情书的邮戳
情书的邮戳 2021-01-30 07:09

Which Python tool can you recommend to parse programming languages? It should allow for a readable representation of the language grammar inside the source, and it should be abl

9条回答
  •  余生分开走
    2021-01-30 07:47

    I would recommend that you check out my library: https://github.com/erezsh/lark

    It can parse ALL context-free grammars, automatically builds an AST (with line & column numbers), and accepts the grammar in EBNF format, which is considered the standard.

    It can easily parse a language like Python, and it can do so faster than any other parsing library written in Python.

提交回复
热议问题