autosar-calltree 0.3.2__py3-none-any.whl → 0.3.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- autosar_calltree/parsers/c_parser.py +33 -0
- autosar_calltree/version.py +1 -1
- {autosar_calltree-0.3.2.dist-info → autosar_calltree-0.3.3.dist-info}/METADATA +2 -2
- {autosar_calltree-0.3.2.dist-info → autosar_calltree-0.3.3.dist-info}/RECORD +8 -8
- {autosar_calltree-0.3.2.dist-info → autosar_calltree-0.3.3.dist-info}/WHEEL +0 -0
- {autosar_calltree-0.3.2.dist-info → autosar_calltree-0.3.3.dist-info}/entry_points.txt +0 -0
- {autosar_calltree-0.3.2.dist-info → autosar_calltree-0.3.3.dist-info}/licenses/LICENSE +0 -0
- {autosar_calltree-0.3.2.dist-info → autosar_calltree-0.3.3.dist-info}/top_level.txt +0 -0
|
@@ -58,6 +58,29 @@ class CParser:
|
|
|
58
58
|
"_Generic",
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
# AUTOSAR and standard C macros to exclude from function detection
|
|
62
|
+
# These macros look like function calls but should not be parsed as functions
|
|
63
|
+
AUTOSAR_MACROS = {
|
|
64
|
+
# Standard C integer literal macros (stdint.h)
|
|
65
|
+
"INT8_C",
|
|
66
|
+
"INT16_C",
|
|
67
|
+
"INT32_C",
|
|
68
|
+
"INT64_C",
|
|
69
|
+
"UINT8_C",
|
|
70
|
+
"UINT16_C",
|
|
71
|
+
"UINT32_C",
|
|
72
|
+
"UINT64_C",
|
|
73
|
+
"INTMAX_C",
|
|
74
|
+
"UINTMAX_C",
|
|
75
|
+
# AUTOSAR tool-specific macros
|
|
76
|
+
"TS_MAKEREF2CFG",
|
|
77
|
+
"TS_MAKENULLREF2CFG",
|
|
78
|
+
"TS_MAKEREFLIST2CFG",
|
|
79
|
+
# Common AUTOSAR configuration macros
|
|
80
|
+
"STD_ON",
|
|
81
|
+
"STD_OFF",
|
|
82
|
+
}
|
|
83
|
+
|
|
61
84
|
# Common AUTOSAR types
|
|
62
85
|
AUTOSAR_TYPES = {
|
|
63
86
|
"uint8",
|
|
@@ -244,6 +267,16 @@ class CParser:
|
|
|
244
267
|
if return_type in self.C_KEYWORDS or function_name in self.C_KEYWORDS:
|
|
245
268
|
return None
|
|
246
269
|
|
|
270
|
+
# Skip AUTOSAR and standard C macros that look like function calls
|
|
271
|
+
# This prevents false positives on macros like UINT32_C(value), TS_MAKEREF2CFG(...)
|
|
272
|
+
if function_name in self.AUTOSAR_MACROS:
|
|
273
|
+
return None
|
|
274
|
+
|
|
275
|
+
# Skip standard C integer literal macros (those ending with _C)
|
|
276
|
+
# These are defined in stdint.h and look like: INT32_C(42), UINT64_C(100)
|
|
277
|
+
if function_name.endswith("_C"):
|
|
278
|
+
return None
|
|
279
|
+
|
|
247
280
|
# Skip common control structures
|
|
248
281
|
if function_name in ["if", "for", "while", "switch", "case", "else"]:
|
|
249
282
|
return None
|
autosar_calltree/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autosar-calltree
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: A Python tool to analyze C/AUTOSAR codebases and generate function call trees with Mermaid and XMI output
|
|
5
5
|
Author-email: melodypapa <melodypapa@outlook.com>
|
|
6
6
|
Maintainer-email: melodypapa <melodypapa@outlook.com>
|
|
@@ -255,7 +255,7 @@ default_module: "Other"
|
|
|
255
255
|
|
|
256
256
|
**Usage**:
|
|
257
257
|
```bash
|
|
258
|
-
calltree --start-function Demo_Init --module-config module_mapping.yaml --use-module-names --max-depth 3
|
|
258
|
+
calltree --start-function Demo_Init --module-config demo/module_mapping.yaml --use-module-names --max-depth 3 --output demo/demo_sequence.md
|
|
259
259
|
```
|
|
260
260
|
|
|
261
261
|
This generates diagrams with:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
autosar_calltree/__init__.py,sha256=WiP2aFfs0H3ze4X8tQg6ZiStdzgrp6uC8DPRUyGm_zg,660
|
|
2
|
-
autosar_calltree/version.py,sha256=
|
|
2
|
+
autosar_calltree/version.py,sha256=bCTAEX52GYLbYmX6hK94dwlrD8wYqJXSFfSo1Qo_J8A,142
|
|
3
3
|
autosar_calltree/analyzers/__init__.py,sha256=qUvB7CAa5xNcUYkhD7Rha-9quPG8yQJqg-GikHD41U0,119
|
|
4
4
|
autosar_calltree/analyzers/call_tree_builder.py,sha256=tSsIj_BHzT4XQ-XsXXfyU-KyGK61p6O7nLBx1AiwxCA,11627
|
|
5
5
|
autosar_calltree/cli/__init__.py,sha256=qwsSUuDyV6i1PYS7Mf6JBkBJKtcldxiIh5S0wOucWVY,76
|
|
@@ -13,10 +13,10 @@ autosar_calltree/generators/__init__.py,sha256=wlSAuykXkxIjwP9H1C2iY99nbyt14Kp1Y
|
|
|
13
13
|
autosar_calltree/generators/mermaid_generator.py,sha256=LcmWOACLAw3r7UQlnSlTM-_kpKQ6RGdgc6aNqXeMF7A,16191
|
|
14
14
|
autosar_calltree/parsers/__init__.py,sha256=O0NTHrZqe6GXvU9_bLuAoAV_hxv7gHOgkH8KWSBmX1Y,151
|
|
15
15
|
autosar_calltree/parsers/autosar_parser.py,sha256=iwF1VR4NceEfmc3gPP31CcVNPfRRVTj_aA6N94saXDA,10750
|
|
16
|
-
autosar_calltree/parsers/c_parser.py,sha256=
|
|
17
|
-
autosar_calltree-0.3.
|
|
18
|
-
autosar_calltree-0.3.
|
|
19
|
-
autosar_calltree-0.3.
|
|
20
|
-
autosar_calltree-0.3.
|
|
21
|
-
autosar_calltree-0.3.
|
|
22
|
-
autosar_calltree-0.3.
|
|
16
|
+
autosar_calltree/parsers/c_parser.py,sha256=2LCDVZ8bcrBiQe9DK7kNMmvzhGegEDfd57KbI5JB43A,15846
|
|
17
|
+
autosar_calltree-0.3.3.dist-info/licenses/LICENSE,sha256=Xy30Wm38nOLXLZZFgn9oD_3UcayYkm81xtn8IByrBlk,1067
|
|
18
|
+
autosar_calltree-0.3.3.dist-info/METADATA,sha256=U3NTrfrUAqedyo5RzCQS9RLHBL1ToEYgUsMu5VC1tt8,15566
|
|
19
|
+
autosar_calltree-0.3.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
20
|
+
autosar_calltree-0.3.3.dist-info/entry_points.txt,sha256=HfntIC1V_COOhGJ-OhtLKH_2vJ1jQy5Hlz8NmcJg4TQ,54
|
|
21
|
+
autosar_calltree-0.3.3.dist-info/top_level.txt,sha256=eusKGYzQfbhwIFDsUYTby40SdMpe95Y9GtR0l1GVIDQ,17
|
|
22
|
+
autosar_calltree-0.3.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|