mod graph;
mod kind;
mod transition;
pub(crate) use graph::*;
pub use kind::*;
pub(super) mod analyze {
use super::*;
use crate::{error::Error, grammar::Rule, Scdlang};
use pest::{iterators::Pair, Span};
pub type TokenPair<'i> = Pair<'i, Rule>;
pub trait SemanticCheck: Expression {
fn check_error(&self) -> Result<Option<String>, Error>;
}
pub trait SemanticAnalyze<'c>: From<TokenPair<'c>> {
fn analyze_error(&self, span: Span<'c>, options: &'c Scdlang) -> Result<(), Error>;
fn analyze_from(pair: TokenPair<'c>, options: &'c Scdlang) -> Result<Self, Error> {
let span = pair.as_span();
let sc = pair.into();
Self::analyze_error(&sc, span, options)?;
Ok(sc)
}
fn into_kinds(self) -> Vec<super::Kind<'c>>;
}
}