Skip to content

Latest commit

 

History

History

Clang

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Clang AST to Hexa

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
  • node cToHexa.js miniast input.json output.json much more compact and faster JSON representation
  • node cToHexa.js PATTERN DESTINATION or node 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 subfolder module for you
    • CONFIG - path to destination folder like /folder/to/save/Project/
    • CONFIG - path to cToHexa.json
    • no-header - no Hexa notice

Note: this is a very vague draft implementation