pub enum ParserBackend {
TreeSitter,
PureRust,
GLR,
}Expand description
Parser backend supported by the runtime feature matrix.
§Examples
use adze_parser_backend_core::ParserBackend;
let backend = ParserBackend::GLR;
assert!(backend.is_glr());
assert!(backend.is_pure_rust());
assert_eq!(backend.name(), "pure-Rust GLR parser");Variants§
TreeSitter
Tree-sitter C runtime (default when pure-Rust is disabled).
PureRust
Pure Rust LR parser (simple grammars without conflicts).
GLR
Pure Rust GLR parser (conflict-capable).
Implementations§
Source§impl ParserBackend
impl ParserBackend
Sourcepub const fn select_contract(has_conflicts: bool) -> ParserBackendSelection
pub const fn select_contract(has_conflicts: bool) -> ParserBackendSelection
Resolve the backend-selection contract for a conflict condition.
This mirrors select but returns an explicit outcome rather than panicking.
Source§impl ParserBackend
impl ParserBackend
Sourcepub const fn select(_has_conflicts: bool) -> ParserBackend
pub const fn select(_has_conflicts: bool) -> ParserBackend
Sourcepub const fn is_pure_rust(self) -> bool
pub const fn is_pure_rust(self) -> bool
Whether this backend is a pure-Rust parser (LR or GLR).
Trait Implementations§
Source§impl Clone for ParserBackend
impl Clone for ParserBackend
Source§fn clone(&self) -> ParserBackend
fn clone(&self) -> ParserBackend
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParserBackend
impl Debug for ParserBackend
Source§impl Display for ParserBackend
impl Display for ParserBackend
Source§impl PartialEq for ParserBackend
impl PartialEq for ParserBackend
impl Copy for ParserBackend
impl Eq for ParserBackend
impl StructuralPartialEq for ParserBackend
Auto Trait Implementations§
impl Freeze for ParserBackend
impl RefUnwindSafe for ParserBackend
impl Send for ParserBackend
impl Sync for ParserBackend
impl Unpin for ParserBackend
impl UnsafeUnpin for ParserBackend
impl UnwindSafe for ParserBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more