Skip to main content

Module codegen

Module codegen 

Source
Expand description

Shared code generation utilities for all language backends. Provides struct/enum/function generators, type mapping, and conversion helpers.

Modules§

builder
c_consumer
Shared C-FFI consumer scaffolding for language backends.
cfg
Shared cfg-expression utilities for language binding backends.
config_gen
conversions
coordinates
Grammar validation for cross-language publish/namespace coordinates.
crate_attributes
Crate-level Rust attribute formatting for generated binding crates.
defaults
Language-specific default value emission for trait bridge method returns.
doc_emission
Language-native documentation comment emission. Provides standardized functions for emitting doc comments in different languages.
enum_variant_size
Approximate per-variant byte-size estimates for backends that emit real Rust enum { .. } data enums, used to decide whether a generated enum should carry a narrow #[expect(clippy::large_enum_variant, reason = "...")].
error_gen
field_init
Rust struct-literal field initializers.
fn_dedup
Same-named function entry deduplication for single-surface binding backends.
foreign_cfg_variants
One WARN per foreign cfg-gated enum variant, for the whole generation run.
generators
identifier_grammar
Exact Java, C#, Kotlin, and Swift identifier character classes, resolved from a pinned Unicode table (Java, C#, Kotlin) or the Swift language grammar’s own scalar-range list (Swift, which defines its identifier grammar directly in terms of code-point ranges rather than general categories).
java_literal
The single Java source-literal escaper.
keywords
Re-exports of reserved keyword lists and field-name escaping from alef-core.
mut_writeback
Policy for &mut T parameters that a generated binding must hand back to its caller.
naming
Canonical naming policy for everything alef generates.
serde_enum_repr
The single place that answers “how does serde put this enum on the JSON wire?”.
shared
type_mapper