| Crates.io | syster-base |
| lib.rs | syster-base |
| version | 0.2.1-alpha |
| created_at | 2026-01-16 18:30:37.965961+00 |
| updated_at | 2026-01-24 20:13:48.771584+00 |
| description | Core library for SysML v2 and KerML parsing, AST, and semantic analysis |
| homepage | |
| repository | https://github.com/jade-codes/syster-base |
| max_upload_size | |
| id | 2049083 |
| size | 6,908,464 |
Core library for SysML v2 and KerML parsing, AST, and semantic analysis.
Syster Base uses a query-based incremental computation model powered by Salsa. This means:
file_text(file) ← INPUT: raw source text
│
▼
parse_file(file) ← Parse into AST (memoized per-file)
│
▼
file_symbols(file) ← Extract HIR symbols (memoized per-file)
│
▼
SymbolIndex ← Workspace-wide symbol index
│
▼
Resolver::resolve(name) ← Name resolution with imports
│
▼
file_diagnostics(file) ← Semantic errors
| Type | Size | Purpose |
|---|---|---|
FileId |
4 bytes | Interned file identifier (O(1) comparison) |
Name |
4 bytes | Interned string identifier |
DefId |
8 bytes | Globally unique definition ID |
HirSymbol |
— | Symbol extracted from AST |
RootDatabase |
— | Salsa database holding all queries |
use syster::hir::{RootDatabase, FileText, parse_file, file_symbols};
use syster::base::FileId;
// Create the Salsa database
let db = RootDatabase::new();
// Set file content (input query)
let file_id = FileId::new(0);
let file_text = FileText::new(&db, file_id, r#"
package Vehicle {
part def Car {
attribute mass : Real;
}
}
"#.to_string());
// Parse (memoized - subsequent calls are instant)
let parse_result = parse_file(&db, file_text);
assert!(parse_result.is_ok());
// Extract symbols (also memoized)
if let Some(ast) = parse_result.get_ast() {
let symbols = file_symbols(file_id, ast);
// symbols contains: Vehicle (package), Car (part def), mass (attribute)
}
base — Foundation types: FileId, Name, Interner, TextRangesyntax — Pest grammars and AST types for KerML/SysMLhir — High-level IR with Salsa queries and symbol extractionide — IDE features: completion, goto, hover, referencesproject — File loading utilitiesThe Salsa-based architecture provides significant performance benefits:
FileId and Name enable constant-time equalityMIT
This project includes a DevContainer configuration for a consistent development environment.
Using VS Code:
What's included:
If not using DevContainer:
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Build the project
cargo build --release
# Run tests
cargo test --release
# Run clippy (required before commit)
cargo clippy --all-targets -- -D warnings