Builder

Struct Builder 

Source
pub struct Builder {
    pub is_executable: bool,
    /* private fields */
}
Expand description

Main entry for the build script

Fields§

§is_executable: bool

if true, an executable called this function

Implementations§

Source§

impl Builder

Source

pub fn new() -> Self

Source

pub fn glr(&mut self, glr: bool) -> &mut Self

override the settings

Source

pub fn dense(&mut self, dense: bool) -> &mut Self

override the settings

Source

pub fn file(&mut self, filename: &str) -> &mut Self

set input file

Source

pub fn note_conflicts(&mut self, val: bool) -> &mut Self

Print note information about any shift/reduce, reduce/reduce conflicts. If the target is deterministic parser, conflict will be treated as an error, so this option will be ignored. This option is only for non-deterministic GLR parser.

Source

pub fn note_conflicts_resolving(&mut self, val: bool) -> &mut Self

Print debug information about conflicts resolving process by any %left, %right, or %precedence directive.

Source

pub fn note_optimization(&mut self, val: bool) -> &mut Self

Print debug information about optimization process.

Source

pub fn note_on_stderr(&mut self, val: bool) -> &mut Self

Print every note_* information to stderr.

Source

pub fn note_backtrace(&mut self, val: bool) -> &mut Self

Print backtrace of production rules when conflicts occurred. ruleset could be messed up

Source

pub fn build(&self, output_file: &str)

build and emit code to output file

Source

pub fn build_impl(&self) -> Result<Output, String>

for internal use

Trait Implementations§

Source§

impl Default for Builder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.