Which tool to use to parse programming languages in Python?

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

    Antlr generates LL(*) parsers. That can be good, but sometimes removing all left recursion can be cumbersome.

    If you are LALR(1)-savvy, you can use PyBison. It has similar syntax to Yacc, if you know what it is. Plus, there are a lot of people out there that know how yacc works.

提交回复
热议问题