|
@@ -6,7 +6,7 @@ from pycparser import c_ast
|
|
|
|
|
|
INT_TYPES = ['int', 'short', 'float']
|
|
|
FLOAT_TYPES = ['float', 'double']
|
|
|
-STRING_TYPES = ['char']
|
|
|
+STRING_TYPES = ['char', 'string']
|
|
|
|
|
|
VALID_TPYES = list()
|
|
|
VALID_TPYES.extend(INT_TYPES)
|
|
@@ -116,7 +116,12 @@ class ASTAnalyser:
|
|
|
|
|
|
for v in vectors:
|
|
|
type = normalizeType(v.type)
|
|
|
- if type in self.declarationsVectors:
|
|
|
+ if type == 'string':
|
|
|
+ if type in self.declarations:
|
|
|
+ self.declarations[type] += 1
|
|
|
+ else:
|
|
|
+ self.declarations[type] = 1
|
|
|
+ elif type in self.declarationsVectors:
|
|
|
self.declarationsVectors[type] += 1
|
|
|
else:
|
|
|
self.declarationsVectors[type] = 1
|
|
@@ -155,6 +160,8 @@ class ASTAnalyser:
|
|
|
self.constantInitCount[init.value] = 1
|
|
|
|
|
|
def proccessFuncDef (self, node):
|
|
|
+ name = node.__class__.__name__
|
|
|
+ self.incCmdCount(name)
|
|
|
commandList = node.body.block_items
|
|
|
for cmd in commandList:
|
|
|
self.proccessCommand(cmd)
|