You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was playing around using this tool on a C++ codebase and I encountered a parsing issue of the line:
classdevice_iio_utils {
private:
...
public:
...
staticintget_selftest_available(constchar *device_dir, char list[][20]); // <-- this line causes the issue
...
};
Here is the traceback:
Traceback (most recent call last):
File "C:\msys64\home\gualniel\miniconda3\envs\mlc\Lib\site-packages\CppHeaderParser\CppHeaderParser.py", line 3107, in __init__
self._evaluate_stack(tok.type)
File "C:\msys64\home\gualniel\miniconda3\envs\mlc\Lib\site-packages\CppHeaderParser\CppHeaderParser.py", line 3456, in _evaluate_stack
self._evaluate_method_stack()
File "C:\msys64\home\gualniel\miniconda3\envs\mlc\Lib\site-packages\CppHeaderParser\CppHeaderParser.py", line 2350, in _evaluate_method_stack
newMethod = CppMethod(
^^^^^^^^^^
File "C:\msys64\home\gualniel\miniconda3\envs\mlc\Lib\site-packages\CppHeaderParser\CppHeaderParser.py", line 1136, in __init__
param = CppVariable(
^^^^^^^^^^^^
File "C:\msys64\home\gualniel\miniconda3\envs\mlc\Lib\site-packages\CppHeaderParser\CppHeaderParser.py", line 1257, in __init__
self["multi_dimensional_array_size"] += "x" + n
^
UnboundLocalError: cannot access local variable 'n' where it is not associated with a value
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\msys64\home\gualniel\miniconda3\envs\mlc\Scripts\hpp2plantuml.exe\__main__.py", line 7, in <module>
File "C:\msys64\home\gualniel\miniconda3\envs\mlc\Lib\site-packages\hpp2plantuml\hpp2plantuml.py", line 1554, in main
CreatePlantUMLFile(args.input_files, args.output_file,
File "C:\msys64\home\gualniel\miniconda3\envs\mlc\Lib\site-packages\hpp2plantuml\hpp2plantuml.py", line 1515, in CreatePlantUMLFile
diag.create_from_file_list(list(set(expand_file_list(file_list_c))))
File "C:\msys64\home\gualniel\miniconda3\envs\mlc\Lib\site-packages\hpp2plantuml\hpp2plantuml.py", line 952, in create_from_file_list
self._build_helper(file_list, build_from='file_list',
File "C:\msys64\home\gualniel\miniconda3\envs\mlc\Lib\site-packages\hpp2plantuml\hpp2plantuml.py", line 932, in _build_helper
self.parse_objects(single_input, build_from_single)
File "C:\msys64\home\gualniel\miniconda3\envs\mlc\Lib\site-packages\hpp2plantuml\hpp2plantuml.py", line 1042, in parse_objects
parsed_header = CppHeaderParser.CppHeader(header_file,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\msys64\home\gualniel\miniconda3\envs\mlc\Lib\site-packages\CppHeaderParser\CppHeaderParser.py", line 3148, in __init__
raise_exc(
File "<string>", line 1, in raise_exc
CppHeaderParser.CppHeaderParser.CppParseError: Not able to parse core/utils.h on line 128 evaluating ';'
Error around: static int get_selftest_available ( const char * device_dir , char list [ ] [ 20 ] )
I am using the tool on MSYS2 environment on Windows11 using Miniconda (Anaconda) with Python 3.12.7.
The text was updated successfully, but these errors were encountered:
hpp2plantuml relies on the robotpy-cppheaderparser package to parse the header files. Your example seemed to work for me with robotpy-cppheaderparser v5.1.1 but fails with v5.1.2.
Since robotpy-cppheaderparser is deprecated, hpp2plantuml should eventually move to cxxheaderparser, it is on my list.
I was playing around using this tool on a C++ codebase and I encountered a parsing issue of the line:
Here is the traceback:
I am using the tool on MSYS2 environment on Windows11 using Miniconda (Anaconda) with Python 3.12.7.
The text was updated successfully, but these errors were encountered: