Browse Source

c_2_ast.py - clang arguments -std=c99 (TODO:move to cfg file)

master
heck 4 years ago
parent
commit
c213425cf9
  1. 12
      pEpACIDgen/c_2_ast.py

12
pEpACIDgen/c_2_ast.py

@ -18,7 +18,7 @@ class C2AST:
def parse(self, filename, content=None, follow_includes=False):
index = clang.cindex.Index.create()
arguments = ["-x", "c", "-I/Users/heck/local-default/include/"]
arguments = [ "-std=c99","-I/Users/heck/local-default/include/"]
options = clang.cindex.TranslationUnit.PARSE_SKIP_FUNCTION_BODIES
if content:
content = [(filename, content)]
@ -57,11 +57,11 @@ class C2AST:
}
# generic info for all CursorKinds
if str(cursor.get_tokens()):
str_tok = ""
for tok in cursor.get_tokens():
str_tok += tok.spelling + " "
item["tokens"] = str_tok.rstrip()
# if str(cursor.get_tokens()):
# str_tok = ""
# for tok in cursor.get_tokens():
# str_tok += tok.spelling + " "
# item["tokens"] = str_tok.rstrip()
if str(cursor.kind):
item["kind"] = str(cursor.kind)

Loading…
Cancel
Save