Documentation
¶
Overview ¶
Package generator is the module root. It exists only to embed the shipped JSON Schema artifacts so the single static binary carries them with no runtime file dependency. Code that needs a schema reads it from SchemaFS.
Index ¶
Constants ¶
View Source
const ( MessageSchemaPath = "schema/sofabuffers-schema-v1.json" ConfigSchemaPath = "schema/sofabgen-config-schema.json" )
ConfigSchemaPath / MessageSchemaPath are the in-FS names.
Variables ¶
View Source
var SchemaFS embed.FS
SchemaFS holds the authoritative message-definition schema and the config schema. They remain the source of truth in schema/; this just bundles them.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
sofabgen
command
Command sofabgen is the SofaBuffers code generator CLI (PLAN §8.8).
|
Command sofabgen is the SofaBuffers code generator CLI (PLAN §8.8). |
|
generators
|
|
|
c
Package c is the embedded-C backend (PLAN §6.2): it emits descriptor-driven code against corelib-c-cpp's object.h API — a struct + a static sofab_object_descr_field_t[] table + a sofab_object_descr_t per object, plus thin encode/decode/init wrappers.
|
Package c is the embedded-C backend (PLAN §6.2): it emits descriptor-driven code against corelib-c-cpp's object.h API — a struct + a static sofab_object_descr_field_t[] table + a sofab_object_descr_t per object, plus thin encode/decode/init wrappers. |
|
cpp
Package cpp is the max-speed C++ backend (PLAN §6.3): header-only output against corelib-cpp.
|
Package cpp is the max-speed C++ backend (PLAN §6.3): header-only output against corelib-cpp. |
|
csharp
Package csharp is the C#/.NET throughput backend (PLAN §6.4): classes with Serialize over OStream and a flat-visitor decode (IVisitor) against corelib-cs.
|
Package csharp is the C#/.NET throughput backend (PLAN §6.4): classes with Serialize over OStream and a flat-visitor decode (IVisitor) against corelib-cs. |
|
dart
Package dart is the Dart throughput backend (PLAN §6.4): plain classes with a streaming `serialize` over the corelib Encoder and a push child-visitor decode against corelib-dart.
|
Package dart is the Dart throughput backend (PLAN §6.4): plain classes with a streaming `serialize` over the corelib Encoder and a push child-visitor decode against corelib-dart. |
|
docs
Package docs is the documentation backend: it renders the message definitions as human-readable reference documentation instead of source code.
|
Package docs is the documentation backend: it renders the message definitions as human-readable reference documentation instead of source code. |
|
golang
Package golang is the Go throughput backend (PLAN §6.4): it emits one struct per object with Marshal (streaming Encoder) and a pull-parser Unmarshal (Decoder.Next/Skip + typed readers) against corelib-go.
|
Package golang is the Go throughput backend (PLAN §6.4): it emits one struct per object with Marshal (streaming Encoder) and a pull-parser Unmarshal (Decoder.Next/Skip + typed readers) against corelib-go. |
|
java
Package java is the Java throughput backend (PLAN §6.4): classes with serialize over OStream and a flat-visitor decode (Visitor) against corelib-java.
|
Package java is the Java throughput backend (PLAN §6.4): classes with serialize over OStream and a flat-visitor decode (Visitor) against corelib-java. |
|
kotlin
Package kotlin is the Kotlin Multiplatform throughput backend: classes with serialize over OStream and a flat-visitor decode (Visitor) against corelib-kotlin-mp.
|
Package kotlin is the Kotlin Multiplatform throughput backend: classes with serialize over OStream and a flat-visitor decode (Visitor) against corelib-kotlin-mp. |
|
python
Package python is the Python throughput backend (PLAN §6.4): it emits dataclasses with _marshal (Encoder) and a pull-parser _unmarshal (Decoder.next/skip + typed readers) against corelib-py, plus JSON helpers for the conformance harness.
|
Package python is the Python throughput backend (PLAN §6.4): it emits dataclasses with _marshal (Encoder) and a pull-parser _unmarshal (Decoder.next/skip + typed readers) against corelib-py, plus JSON helpers for the conformance harness. |
|
rust
Package rust is the Rust backend (PLAN §6.2, embedded/no_std-capable): structs with serialize() over OStream and a flat-visitor decode.
|
Package rust is the Rust backend (PLAN §6.2, embedded/no_std-capable): structs with serialize() over OStream and a flat-visitor decode. |
|
typescript
Package typescript is the TypeScript throughput backend (PLAN §6.4): it emits one class per object with serialize(OStream) and a visitor-based decode against corelib-ts (@sofa-buffers/corelib).
|
Package typescript is the TypeScript throughput backend (PLAN §6.4): it emits one class per object with serialize(OStream) and a visitor-based decode against corelib-ts (@sofa-buffers/corelib). |
|
zig
Package zig is the Zig backend (corelib-zig, the max-speed port): structs with schema defaults in the type declaration, marshal() over OStream, and a flat-visitor decode.
|
Package zig is the Zig backend (corelib-zig, the max-speed port): structs with schema defaults in the type declaration, marshal() over OStream, and a flat-visitor decode. |
|
internal
|
|
|
analysis
Package analysis implements stage [3] of the pipeline: it resolves the IR's $ref/shared-type graph in place and runs the language-independent semantic checks, then freezes the IR (PLAN §8.2).
|
Package analysis implements stage [3] of the pipeline: it resolves the IR's $ref/shared-type graph in place and runs the language-independent semantic checks, then freezes the IR (PLAN §8.2). |
|
config
Package config loads and validates sofabgen configuration (PLAN §7).
|
Package config loads and validates sofabgen configuration (PLAN §7). |
|
generator
Package generator holds the backend CONTRACT only — interfaces, no language code (PLAN §8.6/§8.7).
|
Package generator holds the backend CONTRACT only — interfaces, no language code (PLAN §8.6/§8.7). |
|
ir
Package ir is the language-neutral Intermediate Representation that every backend consumes (PLAN §8.2).
|
Package ir is the language-neutral Intermediate Representation that every backend consumes (PLAN §8.2). |
|
model
Package model implements stage [2] of the pipeline: it lowers a validated, unresolved definition document into the language-neutral ir.Schema (Composite).
|
Package model implements stage [2] of the pipeline: it lowers a validated, unresolved definition document into the language-neutral ir.Schema (Composite). |
|
parser
Package parser implements stage [1] of the generation pipeline: it loads a SofaBuffers message-definition document (YAML or JSON) and validates it against the v1 schema as a HARD GATE (PLAN §1, §8.1).
|
Package parser implements stage [1] of the generation pipeline: it loads a SofaBuffers message-definition document (YAML or JSON) and validates it against the v1 schema as a HARD GATE (PLAN §1, §8.1). |
|
pipeline
Package pipeline orchestrates the generation stages (PLAN §8 diagram):
|
Package pipeline orchestrates the generation stages (PLAN §8 diagram): |
Click to show internal directories.
Click to hide internal directories.
