擅长:python、mysql、java
<p>有许多Python解析器包可以用来描述语法,然后它将生成Python代码来解析该语法。在</p>
<p>Ned Batchelder写了一个<strong><a href="http://nedbatchelder.com/text/python-parsers.html" rel="nofollow noreferrer">very nice summary</a></strong></p>
<p>其中,Ply用于一个名为<strong><a href="http://code.google.com/p/pycparser/" rel="nofollow noreferrer">pycparser</a></strong>的项目中,该项目解析C源代码。我建议从这个开始。在</p>
<p>其他一些解析器项目也可能有示例C解析器。在</p>
<p><strong>Edit</strong>:刚刚注意到pycparser甚至有一个示例Python脚本,就像旧的cdecl程序一样<a href="http://code.google.com/p/pycparser/source/browse/examples/cdecl.py" rel="nofollow noreferrer">parse C type declarations</a>。在</p>