Struct tblgen::TableGenParser

source ·
pub struct TableGenParser<'s> { /* private fields */ }
Expand description

Builder struct that parses TableGen source files and builds a RecordKeeper.

Implementations§

source§

impl<'s> TableGenParser<'s>

source

pub fn new() -> Self

Initalizes a new TableGen parser.

source

pub fn add_include_path(self, include: &str) -> Self

Adds the given path to the list of included directories.

source

pub fn add_source_file(self, source: &str) -> Result<Self, Error>

Reads TableGen source code from the file at the given path.

source

pub fn add_source_raw(self, source: &'s CStr) -> Result<Self, Error>

Adds the given TableGen source string.

The string must be null-terminated and is not copied, hence it is required to live until the source code is parsed.

source

pub fn add_source(self, source: &str) -> Result<Self, Error>

Adds the given TableGen source string.

The string is copied into a null-terminated CString.

source

pub fn source_info(&self) -> SourceInfo<'_>

source

pub fn parse(self) -> Result<RecordKeeper<'s>, Error>

Parses the TableGen source files and returns a RecordKeeper.

Due to limitations of TableGen, parsing TableGen is not thread-safe. In order to provide thread-safety, this method ensures that any concurrent parse operations are executed sequentially.

Trait Implementations§

source§

impl<'s> Debug for TableGenParser<'s>

source§

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

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

impl<'s> Default for TableGenParser<'s>

source§

fn default() -> Self

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

impl<'s> Drop for TableGenParser<'s>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'s> PartialEq<TableGenParser<'s>> for TableGenParser<'s>

source§

fn eq(&self, other: &TableGenParser<'s>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'s> Eq for TableGenParser<'s>

source§

impl<'s> StructuralEq for TableGenParser<'s>

source§

impl<'s> StructuralPartialEq for TableGenParser<'s>

Auto Trait Implementations§

§

impl<'s> RefUnwindSafe for TableGenParser<'s>

§

impl<'s> !Send for TableGenParser<'s>

§

impl<'s> !Sync for TableGenParser<'s>

§

impl<'s> Unpin for TableGenParser<'s>

§

impl<'s> UnwindSafe for TableGenParser<'s>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.