pub struct LemonMint { /* private fields */ }Expand description
The compiled parser that can be saved to a rust file. Use LemonMintBuilder to build it.
Implementations§
Source§impl LemonMint
impl LemonMint
Sourcepub fn gen_rust<W>(&self, out: &mut W) -> Result<()>where
W: Write,
pub fn gen_rust<W>(&self, out: &mut W) -> Result<()>where
W: Write,
Generate the Rust source code of the parser, writing it to out.
The output is self-contained (no dependency on this crate) and exposes a code module
containing the Parser struct and the Token enum. Typically you write it to a file under
OUT_DIR from a build script and include! it, or generate it once and commit it.
Sourcepub fn gen_log<W>(
&self,
out: &mut W,
basisflag: bool,
show_precedence_conflict: bool,
) -> Result<()>where
W: Write,
pub fn gen_log<W>(
&self,
out: &mut W,
basisflag: bool,
show_precedence_conflict: bool,
) -> Result<()>where
W: Write,
Write a human-readable report of the generated state machine (classic Lemon’s y.output).
Useful for understanding the parser and for debugging grammar conflicts.
basisflag- print only the basis configurations of each state, not the full closure.show_precedence_conflict- also report conflicts that were resolved by precedence rules.
Trait Implementations§
Source§impl TryFrom<LemonMintBuilder> for LemonMint
impl TryFrom<LemonMintBuilder> for LemonMint
Source§type Error = LemonMintError
type Error = LemonMintError
The type returned in the event of a conversion error.
Source§fn try_from(builder: LemonMintBuilder) -> Result<Self, LemonMintError>
fn try_from(builder: LemonMintBuilder) -> Result<Self, LemonMintError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for LemonMint
impl !RefUnwindSafe for LemonMint
impl !Send for LemonMint
impl !Sync for LemonMint
impl Unpin for LemonMint
impl UnsafeUnpin for LemonMint
impl !UnwindSafe for LemonMint
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