use csw_derive::TypeSystem;
use std::path::Path;
pub trait Generator {
type Error: std::error::Error;
fn generate(ts: &TypeSystem, output_dir: &Path) -> Result<(), Self::Error>;
}
#[derive(Clone, Debug, Default)]
pub struct GeneratorOptions {
pub checker: bool,
pub interpreter: bool,
pub parser: bool,
pub docs: bool,
pub tests: bool,
}
impl GeneratorOptions {
pub fn all() -> Self {
Self {
checker: true,
interpreter: true,
parser: true,
docs: true,
tests: true,
}
}
pub fn checker_only() -> Self {
Self {
checker: true,
..Default::default()
}
}
}