summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO.txt7
-rw-r--r--utils/fake_libc_include/_fake_typedefs.h10
-rw-r--r--z_test.py17
3 files changed, 28 insertions, 6 deletions
diff --git a/TODO.txt b/TODO.txt
index 340cb71..48eeb55 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,6 +1,13 @@
Todo
----
+- change license to BSD
+
+Changes since last
+------------------
+
+* Added new C99 integer types to the fake headers.
+
Version Update
--------------
diff --git a/utils/fake_libc_include/_fake_typedefs.h b/utils/fake_libc_include/_fake_typedefs.h
index 344cbc6..6c95c51 100644
--- a/utils/fake_libc_include/_fake_typedefs.h
+++ b/utils/fake_libc_include/_fake_typedefs.h
@@ -77,4 +77,14 @@ typedef int __tzrule_type;
typedef int __tzinfo_type;
typedef int mbstate_t;
+/* C99 integer types */
+typedef int int8_t;
+typedef int uint8_t;
+typedef int int16_t;
+typedef int uint16_t;
+typedef int int32_t;
+typedef int uint32_t;
+typedef int int64_t;
+typedef int uint64_t;
+
#endif
diff --git a/z_test.py b/z_test.py
index f578942..205b5cc 100644
--- a/z_test.py
+++ b/z_test.py
@@ -48,7 +48,7 @@ def expand_decl(decl):
#-----------------------------------------------------------------
class NodeVisitor(object):
def __init__(self):
- self.node_stack = []
+ self.current_parent = None
def visit(self, node):
""" Visit a node.
@@ -56,17 +56,22 @@ class NodeVisitor(object):
method = 'visit_' + node.__class__.__name__
visitor = getattr(self, method, self.generic_visit)
return visitor(node)
-
+
+ def visit_FuncCall(self, node):
+ print("Visiting FuncCall")
+ print(node.show())
+ print('---- parent ----')
+ print(self.current_parent.show())
+
def generic_visit(self, node):
""" Called if no explicit visitor function exists for a
node. Implements preorder visiting of the node.
"""
- print(node)
- print(self.node_stack)
- self.node_stack.append(node)
+ oldparent = self.current_parent
+ self.current_parent = node
for c in node.children():
self.visit(c)
- self.node_stack.pop()
+ self.current_parent = oldparent
if __name__ == "__main__":