|
|
@ -35,12 +35,55 @@ def gen(): |
|
|
|
exit(-1) |
|
|
|
|
|
|
|
|
|
|
|
pymodule_name = data["module_name"] |
|
|
|
libclang_path = data["libclang_path"] |
|
|
|
pymodule_name = "" |
|
|
|
libclang_path = "" |
|
|
|
header_filename = "" |
|
|
|
vars = [] |
|
|
|
funcs = [] |
|
|
|
debug_ast = False |
|
|
|
debug_acid = False |
|
|
|
debug_yml = False |
|
|
|
|
|
|
|
try: |
|
|
|
pymodule_name = data['module_name'] |
|
|
|
except: |
|
|
|
print('config-warning: "module_name" not specified') |
|
|
|
|
|
|
|
try: |
|
|
|
libclang_path = data['libclang_path'] |
|
|
|
except: |
|
|
|
print('config-warning: "libclang_path" not specified') |
|
|
|
|
|
|
|
try: |
|
|
|
header_filename = data['header_filename'] |
|
|
|
except: |
|
|
|
print('config-warning: "header_filename" not speficied') |
|
|
|
|
|
|
|
try: |
|
|
|
vars = data['variables'] |
|
|
|
except: |
|
|
|
print('config-info no variables specified') |
|
|
|
|
|
|
|
try: |
|
|
|
funcs = data['functions'] |
|
|
|
except: |
|
|
|
print('config-info: no functions specified') |
|
|
|
|
|
|
|
try: |
|
|
|
debug_ast = bool(data['debug_ast']) |
|
|
|
except: |
|
|
|
print('config-info: to debug the ast, set "debug_ast" : "True"') |
|
|
|
|
|
|
|
try: |
|
|
|
debug_acid = bool(data['debug_acid']) |
|
|
|
except: |
|
|
|
print('config-info: to debug the ACID, set "debug_acid" : "True"') |
|
|
|
|
|
|
|
try: |
|
|
|
debug_yml = bool(data['debug_yml']) |
|
|
|
except: |
|
|
|
print('config-info: to debug the ast-yml, set "debug_yml" : "True"') |
|
|
|
|
|
|
|
header_filename = data["header_filename"] |
|
|
|
vars = data["variables"] |
|
|
|
funcs = data["functions"] |
|
|
|
|
|
|
|
|
|
|
|
print_indent("CONFIG:") |
|
|
@ -56,9 +99,13 @@ def gen(): |
|
|
|
for func in funcs: |
|
|
|
print_indent(func, indent=2) |
|
|
|
|
|
|
|
print_indent("debug_ast:", debug_ast, indent=1) |
|
|
|
print_indent("debug_acid:", debug_acid, indent=1) |
|
|
|
print_indent("debug_yml:", debug_yml, indent=1) |
|
|
|
|
|
|
|
|
|
|
|
acidgen = pEpACIDgen.pEpACIDGen(libclang_path, header_filename, pymodule_name) |
|
|
|
header = acidgen.extract(vars, funcs, debug_ast=False, debug_acid=False, debug_yml=False) |
|
|
|
acidgen = pEpACIDgen.pEpACIDGen(libclang_path, header_filename, pymodule_name, out_dir=os.getcwd()) |
|
|
|
header = acidgen.extract(vars, funcs, debug_ast=debug_ast, debug_acid=debug_acid, debug_yml=debug_yml) |
|
|
|
|
|
|
|
print_indent("OUTPUT:") |
|
|
|
print_indent(header["acid_yml"]) |
|
|
|