Skip to main content

synapse_codegen_cfs/
lib.rs

1mod c;
2mod constants;
3mod error;
4mod rust;
5mod types;
6mod util;
7mod validate;
8
9use synapse_parser::ast::SynFile;
10
11pub use c::{generate_c, try_generate_c, try_generate_c_with_constants};
12use constants::const_context;
13pub use error::CodegenError;
14pub use rust::{generate_rust, try_generate_rust, try_generate_rust_with_constants};
15pub use types::{
16    CfsPacket, CfsPacketKind, GENERATED_BANNER, PREAMBLE, ResolvedConstants, RustOptions,
17};
18pub use validate::{collect_cfs_packets_with_constants, validate_cfs, validate_cfs_with_constants};
19
20/// Resolve this file's integer constants, including aliases to visible imported constants.
21pub fn resolve_integer_constants(
22    file: &SynFile,
23    imported_constants: &ResolvedConstants,
24) -> ResolvedConstants {
25    let constants = const_context(file, imported_constants);
26    constants.resolved_local_constants()
27}
28
29#[cfg(test)]
30mod tests;