#[derive(Debug, Clone, PartialEq)]
pub enum ManchesterExpr {
Class(String),
And(Vec<ManchesterExpr>),
Or(Vec<ManchesterExpr>),
Not(Box<ManchesterExpr>),
Some {
property: String,
filler: Box<ManchesterExpr>,
},
Only {
property: String,
filler: Box<ManchesterExpr>,
},
Min {
property: String,
cardinality: u32,
filler: Option<Box<ManchesterExpr>>,
},
Max {
property: String,
cardinality: u32,
filler: Option<Box<ManchesterExpr>>,
},
Exactly {
property: String,
cardinality: u32,
filler: Option<Box<ManchesterExpr>>,
},
HasValue {
property: String,
individual: String,
},
OneOf(Vec<String>),
}
#[derive(Debug, Clone, thiserror::Error)]
pub enum ManchesterError {
#[error("Lexer error at byte {pos}: {msg}")]
LexError { pos: usize, msg: String },
#[error("Parse error at token {pos}: {msg}")]
ParseError { pos: usize, msg: String },
#[error("Emit error: {0}")]
EmitError(String),
}
pub mod emitter;
pub mod lexer;
pub mod parser;
#[cfg(test)]
mod tests;
pub use emitter::emit;
pub use parser::parse;