Skip to content

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

Notifications You must be signed in to change notification settings

two-dimensional-array/define_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"
}