Which tool to use to parse programming languages in Python?

前端 未结 9 1976
情书的邮戳
情书的邮戳 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:35

    Ned Batchelder did a survey of python parsing tools, which apparently he keeps updated (last updated July 2010):

    http://nedbatchelder.com/text/python-parsers.html

    If I was going to need a parser today, I would either roll my own recursive descent parser, or possibly use PLY or LEPL -- depending on my needs and whether or not I was willing to introduce an external dependency. I wouldn't personally use PyParsing for anything very complicated.

提交回复
热议问题