pub enum ParolParserError {
UnknownScanner {
context: String,
name: String,
input: PathBuf,
token: Location,
},
EmptyGroup {
context: String,
input: PathBuf,
start: Location,
end: Location,
},
EmptyOptional {
context: String,
input: PathBuf,
start: Location,
end: Location,
},
EmptyRepetition {
context: String,
input: PathBuf,
start: Location,
end: Location,
},
ConflictingTokenAliases {
first_alias: String,
second_alias: String,
expanded: String,
input: PathBuf,
first: Location,
second: Location,
},
EmptyScanners {
empty_scanners: Vec<String>,
},
UnsupportedGrammarType {
grammar_type: String,
input: PathBuf,
token: Location,
},
UnsupportedFeature {
feature: String,
hint: String,
input: PathBuf,
token: Location,
},
InvalidTokenInTransition {
context: String,
token: String,
input: PathBuf,
location: Location,
},
TokenIsNotInScanner {
context: String,
scanner: String,
token: String,
input: PathBuf,
location: Location,
},
MixedScannerSwitching {
context: String,
input: PathBuf,
location: Location,
},
}Expand description
Error types used by the crate::parser::ParolGrammar’s semantic actions
Variants§
UnknownScanner
Undeclared scanner found. Please declare a scanner via %scanner name {{…}}
Fields
EmptyGroup
Empty Groups () are not allowed.
Fields
EmptyOptional
Empty Optionals [] are not allowed.
Fields
EmptyRepetition
Empty Repetitions {{}} are not allowed.
Fields
ConflictingTokenAliases
Multiple token aliases that expand to the same text will produce a terminal conflict.
Fields
EmptyScanners
Empty Scanner states are not allowed.
UnsupportedGrammarType
Unsupported grammar type
UnsupportedFeature
Unsupported feature
Fields
InvalidTokenInTransition
Invalid token in transition, e.g. a token that is not defined in the grammar is used in a transition. Use a primary non-terminal for the token.
Fields
TokenIsNotInScanner
The token that is used to initiate a transition is not defined in this scanner.
Fields
MixedScannerSwitching
Scanner switching directives have been removed from the grammar syntax.
Mixed scanner switching is not allowed - use either parser-based or scanner-based switching. Parser-based switching is done via the %sc, %push and %pop directives productions. Scanner-based switching is done via the %on directive in the header of the grammar file.
This error can no more occur as of Parol 4, because scanner switching directives have been removed from the grammar syntax.
Trait Implementations§
Source§impl Debug for ParolParserError
impl Debug for ParolParserError
Source§impl Display for ParolParserError
impl Display for ParolParserError
Source§impl Error for ParolParserError
impl Error for ParolParserError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()