Skip to main content

RifGenSrc

Struct RifGenSrc 

Source
pub struct RifGenSrc {
    pub top: RifGenTop,
    pub rifs: HashMap<String, Rif>,
    pub rifmux: HashMap<String, Rifmux>,
    pub paths: HashMap<String, PathBuf>,
    /* private fields */
}
Expand description

Source RIF Generator (result of parsing)

Fields§

§top: RifGenTop

Top level

§rifs: HashMap<String, Rif>

Dictionary of all rif definitions parsed

§rifmux: HashMap<String, Rifmux>

Dictionary of all rifmux parsed

§paths: HashMap<String, PathBuf>

Path of each rif/rifmux

Implementations§

Source§

impl RifGenSrc

Source

pub fn new() -> RifGenSrc

Source

pub fn from_file<P>( filename: P, includes: &[String], cfg: &ParserCfg, ) -> Result<RifGenSrc, RifError>
where P: AsRef<Path>,

Generate a source object from a file the includes path are used to find and parse any included/referenced RIF The configuration contains list of reserved keywords and how they should be handled, as well as as setting such as auto-legacy

Source

pub fn parse_file<P>( &mut self, filename: P, cfg: &ParserCfg, ) -> Result<HashSet<String>, RifError>
where P: AsRef<Path>,

Source

pub fn get_rif<'a>(&'a self, name: &'a str) -> Option<&'a Rif>

Source

pub fn get_rifmux<'a>(&'a self, name: &'a str) -> Option<&'a Rifmux>

Source

pub fn check_reg_uniq(&self, name: &str) -> bool

Check that a register is uniquely defined

Trait Implementations§

Source§

impl Debug for RifGenSrc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RifGenSrc

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.