Implementing custom rules on Rusty #1263
-
Hi all, I am looking to make a static analyzer for Structured Text and I was wondering where in the source code, I could start with implementing custom rules for static analysis passes, I wanted to modify the rule engine/AST and the Parser to implement my own rules on the ST code and then generate warnings based on the said rules |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello @jeremyjosephabraham, As you said you intend to change the AST/parser, could you give us examples on how these modifications would look like? |
Beta Was this translation helpful? Give feedback.
Hello @jeremyjosephabraham,
validations are in the
validation
module (src/validation.rs
). They depend not on a generated model but on a parsed/indexed/resolved module. The driver will guide you through the procedures. Code generation happens at the end, so it can be ignored. You can usually skip generation using the check sub-command or the --check flag instead of the build sub-command.As you said you intend to change the AST/parser, could you give us examples on how these modifications would look like?
Are you intending to contribute to the main source or do you want to use rusty as part of another project?
In case you want to use it in another project, RuSTy is built as a library. In g…