Expand description
The simploxide-bindgen
library crate contains everythinig that’s needed to parse SimpleX bot
API docs and generate Rust code from them.
The functions that generate full Rust modules or a full crate are not included here though. There are some decisions to be made about the resulting file hierarchy and the type shapes of certain types, so full code generation is left to the client.
The simploxide-bindgen
binary crate generates only one specific crate layout for the
simploxide
project needs.
The library is generic enough to allow implementing bindings for other languages. The
implementor just needs to override std::fmt::Display
for crate::types
using a new type
pattern and implement a syntax::binding::SyntaxInterpreter
to generate a command syntax
interpreter in the target language.
Modules§
- commands
- A COMMANDS.MD parser and utilities.
Turns COMMANDS.md file into na Iterator of
crate::commands::CommandResponse
. - events
- An EVENTS.MD parser and utilities.
Turns EVENTS.md file into na Iterator that yields
types::DisjointedDisriminatedUnionVariant
. - syntax
- A syntax parser and a generator of syntax interpreters. A module with a simple greedy lexer for the SimpleX api command syntax and a binding submodule that generates actual interpreters.
- types
- A TYPES.MD parser and utilities.
Defines both data types that represent different typekinds in the SimpleX API docs as well as
the parser that turns TYPES.md into an iterator which yields
crate::types::ApiType
.