/define_parser

Extract macro values (#define) from the header file and store in a readable format.

Primary LanguageC

Define Parser

Extract macro values (#define) from the header file and store in a readable format.

Command Line Arguments

  • -h | --header - Path to the header file that should be parsed.
  • -j | --json - Path to JSON file, which contain all parsed macro names.
  • -h | --flags - Compilation flags.
  • -i | --include - Path to include path file.
  • -d | --define - Path to defines file.
  • -s | --substitute - Path to file, in which need substitute defines values.

Startup Define Parser script

Example of command startup define parser script. In this repository example of command startup is located in Makefile file.

~/repository_directory/python define_parser.py -h header.h -j defines.json -s main.c

Example of output JSON file

In this repository example of JSON file is defines.json file.

{
 "macro_name1": "value",
 "macro_name2": "value",
 "macro_name3": "value"
}