elliotchance / c2go

⚖️ A tool for transpiling C to Go.
MIT License
2.09k stars 155 forks source link

Evaluate facebook clang-to-json AST exporter #336

Open yulvil opened 6 years ago

yulvil commented 6 years ago

https://github.com/facebook/facebook-clang-plugins

https://github.com/facebook/facebook-clang-plugins/tree/master/libtooling/tests/JsonASTExporter

If we are able to dump the AST as JSON, it would simplify the AST import in c2go

elliotchance commented 6 years ago

One big thing we haven't dealt with is retaining code comments between C and Go. This is extremely important, but that information (as far as I can tell) is not maintained reliably in the clang AST (even as a pointer to the real location like we do with the floating point numbers).

I wonder if this could help?