有什么方法可以避免 python 的 pycparser 库中的解析错误
Is there any way to avoid parse-errors in pycparser library of python
下面的代码在 pycparser
尝试解析 .c 文件时触发错误。这可能是因为 rf_wcdma_bup_flags_t
不是定义的 typedef,是否可以跳过它?
rf_wcdma_bup_flags_t rf_wcdma_debug_flags = { 0 };
没有办法跳过它。但是,通过将 "fake headers" 添加到带有 pycparser
的分析流程,可以轻松支持新类型。 README page has some details about this - and this blog post 还有更多。
下面的代码在 pycparser
尝试解析 .c 文件时触发错误。这可能是因为 rf_wcdma_bup_flags_t
不是定义的 typedef,是否可以跳过它?
rf_wcdma_bup_flags_t rf_wcdma_debug_flags = { 0 };
没有办法跳过它。但是,通过将 "fake headers" 添加到带有 pycparser
的分析流程,可以轻松支持新类型。 README page has some details about this - and this blog post 还有更多。