Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converter tool for Rust #144

Open
BlueAndi opened this issue Dec 6, 2024 · 2 comments
Open

Converter tool for Rust #144

BlueAndi opened this issue Dec 6, 2024 · 2 comments
Assignees

Comments

@BlueAndi
Copy link

BlueAndi commented Dec 6, 2024

Is there any converter tool for Rust in progress, which creates the common interchange format for LOBSTER?
I would like avoid start thinking about how to implement it and someone else already started.

@phiwuu
Copy link
Member

phiwuu commented Dec 18, 2024

Dear @BlueAndi, currently there is no converter planned for Rust.
We have thinking/started working on a tool that can extract tags based on user-defined regex. Maybe you will be able to use that one.
The idea is that, the user specifies some regular expressions, and the tool applies them to the input files, and extracts the groups from the regex as LOBSTER tags.

It depends in your exact use case whether such a tool is good enough for you. Using regex has got the obvious disadvantage that the tool does not really parse the underlying language (Rust in your case). Hence edge cases might be overseen. Performance might also be an issue, if the regex becomes complicated and you have a lot of input files to read. It may also be tricky to qualify that tool in the context of ISO 26262.

However, we have received requests to support a bunch of languages. That's why we have started to think about a regex-based solution.

Feel free to share your thoughts on this topic.

@phiwuu phiwuu self-assigned this Dec 18, 2024
@BlueAndi
Copy link
Author

I think for a quick start, using user defined regex might be good enough. Usually you would like to see the trace to the unit. But the unit can address in the simple case the component or can be a function, even parameter for configuration. That makes it more complex. The tool qualification in the functional safety context will be a challenge for sure.

Another idea could be using ANTLR as a base to generate language parsers. Its used to generate the abstract syntax tree (ast) for the language. The ast is then parsed to find the LOBSTER tags. A lot of language descriptions are already available or can be extended. The approach provides a perfect base for the tool qualification too.

Currently we are only discussing tracing to source code, but tracing to architecture and design is not that far away on the wish list. :-) But this can be solved on trlc level by not only define requirement types, but define e.g. architecture specification element type and use the reference possibility. By using PlantUML you it perfect fits to treat architecture like code. ;-) A generic tool in python can address the common interchange format.

Back to Rust, another quick approach is to extend the rust-analyzer tool, which is always up-to-date driven by the rust community. Its similar like using clang tools for C/C++.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants