cmu-rss-lab / roswire

A library for static and dynamic analysis of ROS applications via Docker 🔌
http://christimperley.co.uk/roswire
Apache License 2.0
8 stars 0 forks source link

Extract a list of node executables from a given CMakeLists.txt #461

Open ChrisTimperley opened 3 years ago

ChrisTimperley commented 3 years ago

This component should take a CMakeLists.txt file and return a list of NodeExecutable instances. Each NodeExecutable should describe:

The easiest and most robust way to implement the above is by using a visitor over the CMake AST [https://github.com/polysquare/cmake-ast]. The visitor need only visit two sorts of AST nodes:

The visitor can use a dictionary to maintain the state of all CMake variables. Upon visiting a set command, we write to the dictionary. Upon encountering a variable access (e.g., {SOURCES}), we use the dictionary to obtain the value for that variable.

To allow maximum code reuse (e.g., for ros-anatomy), it would be great if this code wasn't coupled to a running container (e.g., by running over the text contents of a CMakeLists.txt file).