Converting Clang AST generated from C/C++ to Hexa
- Produce AST
clang -fsyntax-only -Xclang -ast-dump=json -ferror-limit=9999999 -w example.c > ast.json
- You NEED to specify all flags and header path the same way you do with a normal compilation OR comment
#include
routines (but some code may not be generated) - Results in
ast.json
- You NEED to specify all flags and header path the same way you do with a normal compilation OR comment
node cToHexa.js miniast input.json output.json
much more compact and faster JSON representationnode cToHexa.js PATTERN DESTINATION
ornode cToHexa.js PATTERN DESTINATION CONFIG no-header
PATTERN
- original pattern of .c files path, for example/dev/Project/module/file.c
will have pattern/dev/Project/
and cToHexa will create subfoldermodule
for youCONFIG
- path to destination folder like/folder/to/save/Project/
CONFIG
- path tocToHexa.json
no-header
- no Hexa notice
Note: this is a very vague draft implementation