use std::borrow::{Borrow, BorrowMut};
use std::fmt::Debug;
use std::hash::Hash;
use std::ops::{BitAnd, BitOr, Not};
use num::{Integer, Unsigned};
use crate::GrammarError;
use super::Lexer;
#[doc(alias = "TokenType")]
pub trait Lexicon: Debug + Clone + Copy + PartialEq + Eq + Hash + 'static {
type Bit: Unsigned
+ Integer
+ BitAnd<Output = Self::Bit>
+ BitOr<Output = Self::Bit>
+ Not<Output = Self::Bit>
+ Copy;
type Lexer<'s>: Lexer<'s, L = Self>;
type Map<T: Default + Clone>: Default + Clone + Borrow<[T]> + BorrowMut<[T]>;
fn id(&self) -> usize;
fn from_id_unchecked(id: usize) -> Self;
fn to_bit(&self) -> Self::Bit;
fn first() -> Self;
fn next(&self) -> Option<Self>;
fn should_extract(&self) -> bool;
fn lexer(source: &str) -> Result<Self::Lexer<'_>, GrammarError>;
}