| Crates.io | swamp-program-analyzer |
| lib.rs | swamp-program-analyzer |
| version | 0.2.26 |
| created_at | 2025-03-29 16:36:29.296577+00 |
| updated_at | 2025-08-18 11:25:08.169002+00 |
| description | Orchestrates the semantic analysis phase for a Swamp program, analyzing parsed modules in the correct dependency order using `swamp-analyzer`. |
| homepage | |
| repository | https://github.com/swamp/swamp |
| max_upload_size | |
| id | 1611447 |
| size | 25,546 |
Coordinates the semantic analysis phase for a complete Swamp programming language program by analyzing its modules in the correct order.
This crate acts as the driver for semantic analysis across an entire Swamp program, defined by a main module and its dependencies. It takes the parsed Abstract Syntax Trees (ASTs) for modules (provided by swamp-dep-loader) and the calculated dependency order, then invokes the core swamp-analyzer for each module sequentially.
Its primary responsibility is to ensure that modules are analyzed in an order that respects their dependencies, making the symbols and types exported by one module available when analyzing subsequent modules that depend on it. It builds up the complete analyzed representation of the program.
DependencyParser), the analysis order (Vec<Vec<String>>), a SourceMap, the core library symbols, and the overall ProgramState.swamp_analyzer::Analyzer for each module, providing the necessary context (including symbols from already-analyzed dependencies).swamp_modules::Modules collection within the Program state.This crate sits between dependency loading/parsing and later compilation stages like code generation:
swamp-dep-loader): Source Code -> Parsed Modules + Dependency Orderswamp-program-analyzer): Parsed Modules + Order -> Analyzed Program (swamp_modules::Modules + ASG in swamp-semantic)swamp-code-gen): Analyzed Program / ASG -> Bytecode (swamp-vm-types)This crate is a core part of the Swamp compiler and is not typically used standalone.
[dependencies]
swamp-program-analyzer = "0.2.26"
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) Peter Bjorklund. All rights reserved. https://github.com/swamp/swamp