kbnf_syntax/
semantic_error.rs

1use kbnf_regex_automata::dfa::dense::BuildError;
2use thiserror::Error;
3#[derive(Error, Debug)]
4pub enum SemanticError {
5    #[error("the nonterminal `{0}` is not defined.")]
6    UndefinedNonterminal(String),
7    #[error(
8        "the excepted nonterminal `{0}` is invalid. It should only directly contain terminals."
9    )]
10    InvalidExceptedNonterminal(String),
11    #[error("the excepted terminal `{0}` is invalid. It should be nonempty.")]
12    InvalidExceptedTerminal(String),
13    #[error(transparent)]
14    DfaRegexBuildError(#[from] BuildError),
15    #[error(transparent)]
16    LazyDfaRegexBuildError(#[from] kbnf_regex_automata::hybrid::BuildError),
17}