diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-07-10 23:12:04 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-07-10 23:12:04 +0530 |
| commit | 2e8b78ab0ef01eaacd8094ff839ac93b4451e9c3 (patch) | |
| tree | 35efbeb73f774513f711e0be6bfa5647033cee27 /symbol_analyzer/main.py | |
| parent | a14da2fe3864712dab4e7c4cfb5c323026d668de (diff) | |
symbol analyzer init
Diffstat (limited to 'symbol_analyzer/main.py')
| -rw-r--r-- | symbol_analyzer/main.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/symbol_analyzer/main.py b/symbol_analyzer/main.py new file mode 100644 index 0000000..1fa5457 --- /dev/null +++ b/symbol_analyzer/main.py @@ -0,0 +1,26 @@ +import os + +from extractor import parse_file +from parser import parse_definition_tokens +from symbols import symbols_from_struct_tokens, symbols_from_enum_tokens + +symbols = set() + +for root, subdirs, files in os.walk("include"): + for file in files: + file_symbols = ["int", "bool", "char"] + definitions, usage = parse_file(root + "/" + file) + structs, enums, functions, typedefs = parse_definition_tokens( + definitions, + file_symbols + ) + file_symbols.extend(symbols_from_struct_tokens(structs)) + file_symbols.extend(symbols_from_enum_tokens(enums)) + file_symbols.extend(functions) + file_symbols.extend(typedefs) + for item in file_symbols: + if item.isnumeric(): + continue + symbols.add(item) + +print(symbols) |
