Enum grammartec::rule::Rule
source · pub enum Rule {
Plain(PlainRule),
Script(ScriptRule),
RegExp(RegExpRule),
}
Variants§
Implementations§
source§impl Rule
impl Rule
pub fn from_script( ctx: &mut Context, nonterm: &str, nterms: &[String], script: PyObject ) -> Self
pub fn from_regex(ctx: &mut Context, nonterm: &str, regex: &str) -> Self
pub fn debug_show(&self, ctx: &Context) -> String
pub fn from_format(ctx: &mut Context, nonterm: &str, format: &[u8]) -> Self
pub fn from_term(ntermid: NTermID, term: &[u8]) -> Self
pub fn nonterms(&self) -> &[NTermID]
pub fn number_of_nonterms(&self) -> usize
pub fn nonterm(&self) -> NTermID
pub fn generate(&self, tree: &mut Tree, ctx: &Context, len: usize) -> usize
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnwindSafe for Rule
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