[−][src]Struct macro_railroad::lowering::MacroRules
A more coarse representation of parser::MacroRules
.
Fields
name: String
This macro's name.
rules: Matcher
The set of rules in this macro. Starts out as a Choice
(one for every pattern)
Implementations
impl MacroRules
[src]
pub fn foldcommontails(&mut self)
[src]
Recursivly fold common prefixes and suffixes in all rules
pub fn remove_internal(&mut self)
[src]
Replace all rules starting with dunder-literals (e.g. "__impl") with a single comment.
pub fn collect_nonterminals(&mut self) -> HashMap<Fragment, HashSet<String>>
[src]
Collect the unique set of non-terminal symbols.
pub fn ungroup(&mut self)
[src]
Unpack all Matcher::Group
in the tree
pub fn normalize(&mut self)
[src]
Transmogrify the tree by removing superfluous elements.
For example, a Choice([Sequence([Terminal("Foo"), Empty])])
becomes just
Terminal("Foo")
.
pub fn any<F: FnMut(&Matcher) -> bool>(&self, predicate: F) -> bool
[src]
Tests if any Matcher
matches the given predicate.
pub fn contains(&self, needle: &Matcher) -> bool
[src]
Tests if the given Matcher
is found in the graph.
Trait Implementations
impl Clone for MacroRules
[src]
fn clone(&self) -> MacroRules
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for MacroRules
[src]
impl From<MacroRules> for MacroRules
[src]
fn from(m: MacroRules) -> MacroRules
[src]
impl PartialEq<MacroRules> for MacroRules
[src]
fn eq(&self, other: &MacroRules) -> bool
[src]
fn ne(&self, other: &MacroRules) -> bool
[src]
impl StructuralPartialEq for MacroRules
[src]
Auto Trait Implementations
impl RefUnwindSafe for MacroRules
impl Send for MacroRules
impl Sync for MacroRules
impl Unpin for MacroRules
impl UnwindSafe for MacroRules
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, 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>,