[−][src]Enum liblet::production::ProductionPredicate
A predicate for checking if production match some expected characteristics.
You can test a predicate on a Production by using the [test]: #method.test method.
Variants
It checks if the left hand side of the production equals the given ordered collection of symbols.
It checks if the right hand side of the production equals the given ordered collection of symbols.
RhsLengthEquals(usize)
It checks if the right hand side length (symbols count) of the production equals the given number.
It checks if the right hand side of the production ends with the given ordered collection of symbols.
Methods
impl ProductionPredicate
[src]
pub fn test(&self, p: &Production) -> bool
[src]
Test if a production match the predicate
# Examples
use liblet::production::{ProductionPredicate, production}; use liblet::symbol::symbol; // create a new production "A -> B C" let p = production("A", "B C"); let rhs = vec![symbol("B"), symbol("C")]; assert!(ProductionPredicate::RhsEquals(rhs).test(&p));
Trait Implementations
impl Clone for ProductionPredicate
[src]
fn clone(&self) -> ProductionPredicate
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ProductionPredicate
[src]
impl Display for ProductionPredicate
[src]
impl Eq for ProductionPredicate
[src]
impl Hash for ProductionPredicate
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<ProductionPredicate> for ProductionPredicate
[src]
fn eq(&self, other: &ProductionPredicate) -> bool
[src]
fn ne(&self, other: &ProductionPredicate) -> bool
[src]
impl StructuralEq for ProductionPredicate
[src]
impl StructuralPartialEq for ProductionPredicate
[src]
Auto Trait Implementations
impl RefUnwindSafe for ProductionPredicate
impl Send for ProductionPredicate
impl Sync for ProductionPredicate
impl Unpin for ProductionPredicate
impl UnwindSafe for ProductionPredicate
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,