Skip to main content

Crate ferriorm_parser

Crate ferriorm_parser 

Source
Expand description

Schema parser for .ferriorm files.

This crate turns a .ferriorm schema string into a fully validated ferriorm_core::schema::Schema IR. It operates in two phases:

  1. Parsing (parser) – a PEG grammar (defined in grammar.pest) tokenizes the input and builds a raw ferriorm_core::ast::SchemaFile.
  2. Validation (validator) – resolves types, checks constraints, and produces the canonical ferriorm_core::schema::Schema consumed by codegen and the migration engine.

For convenience, parse_and_validate combines both steps.

  • ferriorm_core – domain types produced by this crate.
  • ferriorm_codegen – consumes the Schema IR to generate Rust code.
  • ferriorm_migrate – consumes the Schema IR to produce migrations.

Re-exports§

pub use parser::parse;
pub use validator::validate;

Modules§

error
Error types for the schema parser and validator.
parser
PEG-based parser that turns a .ferriorm schema string into a raw AST.
validator
Semantic validation of the raw AST into the resolved Schema IR.

Functions§

parse_and_validate
Parse and validate a schema file in one step.