ADA_Standards
A lightweight, regex-based Ada parser in Rust. Extracts packages, procedures, types, and more into an Abstract Syntax Tree (AST) for analysis, linting, and standards-checking.
Features
- Code Cleaning: Includes a
clean_codeutility to strip comments while correctly preserving strings and file structure. - Comprehensive Extraction: Parses dozens of Ada constructs, including:
package(spec and body)procedureandfunction(spec, body, andis newinstantiations)task(spec and body) andentry(spec and body)typeandsubtype(records, arrays, derived types, etc.)- Representation clauses (
for ... use at ...andfor ... use record) if/elsif/elsestatementscasestatementsloop,while, andforloopsdeclareblocks- Variable declarations (e.g.,
A, B : Integer := 10;)
- Intelligent Parsing:
- Builds an
indextree-based AST with correct parent-child hierarchy. - Parses procedure/function parameters into a structured
Vec<ArgumentData>. - Parses
if,while, andexit whenconditions into a structuredConditionExpr. - Populates
casenodes with theirwhenclauses.
- Builds an
Getting Started
ADA_Standards is available on crates.io. You can add it to your project with:
Or, add the following to your Cargo.toml, replacing 1.1.1 with the latest version:
[]
= "1.1.1"
...and see the docs for how to use it.
Example
use ;
use fs;
use Path;
License
Licensed under
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
Contribution
You are free to contribute by forking and creating a pull request !
Author
My name is Francesco Abate, I'm a computer engineer with experience in the fields of software and embedded programming, cybersecurity and AI, I am currently working on my mastery of the Rust language and seeking a job in that field!
Feel free to visit my website: Francesco Abate
You can also contact me @ francesco1.abate@yahoo.com or on linkedin