we have tested on
#
# - rustc 1.89.0-nightly (e703dff8f 2025-06-11)
# - cargo-llvm-cov v0.6.10
# or
# - rustc 1.91.0 (f8297e351 2025-10-28)
# - cargo-llvm-cov v0.6.21
# run `rustup component add llvm-tools-preview --toolchain nightly-x86_64-unknown-linux-gnu` to install the `llvm-tools-preview`Some additional packages are required:
sudo apt install -y jq
cargo install tokeiThe project can be built and executed on both Linux and Windows platforms.
Linux
-
Uses all cases under the
AADLSource/directory as input, performs code generation for each case, and outputs the generated Rust projects to thegenerate/project/directory.cargo test --test all_aadl_models -- --nocapture #run all test cases.
A successful execution should report that the integration test
all_aadl_models_should_generate_rust_codepasses without errors. -
If you need to test a single case:
cargo run -- --input <folder_name> # run a single case
For example:
-
If you need to view the coverage report:
make cov # generate an HTML coverage report. # output file: "\target\llvm-cov\html\index.html"
-
To count effective lines of AADL code (excluding blank lines and comments) for each case under
AADLSource/:chmod +x scripts/aadl_loc_by_folder_csv.sh ./scripts/aadl_loc_by_folder_csv.sh # output file:AADLSource/aadl_code_loc_by_folder.csv -
To count effective lines of Rust code for each generated project under
generate/project/:chmod +x scripts/rust_loc_by_project_csv.sh ./scripts/rust_loc_by_project_csv.sh #output file :generate/project_rust_code_loc_by_folder.csv
Windows
The commands are similar to those on Linux and produce equivalent results.
cargo test #run all test cases.cargo run -- --input <folder_name> # run a single casecargo install just # install just
just cov-html # generate an HTML coverage report.
# output file: "\target\llvm-cov\html\index.html"src/
-
aadl.pest parses AADL source files (e.g.,
/AADLSource/*.aadlcases). -
transform.rs converts the parsed
Pairsstructure into the custom AADL AST defined in ast.rs. -
converter.rs supports the transformation from
aadl_astto a lightweightrust_ast(defined in intermediate_ast.rs). -
The
/implementationsand/typesdirectories containconv_*.rsfiles, which translate corresponding AADL component categories. -
collector.rs performs scans on the
aadl_astbefore and after conversion to collect necessary information. -
intermediate_print.rs prints the generated Rust code (stored in
/generate/). -
model_statistics.rs uses the Pest parsing results to count different types of components in the AADL model. It is invoked during each code generation run, and the results are written to the
/generate/statistics/directory.
AADLSource/
- Benchmark AADL models used as input to the compiler.
generate/
- Generated Rust projects produced by the compiler.

