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>
impl<'s> TableGenParser<'s>
sourcepub fn add_include_path(self, include: &str) -> Self
pub fn add_include_path(self, include: &str) -> Self
Adds the given path to the list of included directories.
sourcepub fn add_source_file(self, source: &str) -> Result<Self, Error>
pub fn add_source_file(self, source: &str) -> Result<Self, Error>
Reads TableGen source code from the file at the given path.
sourcepub fn add_source_raw(self, source: &'s CStr) -> Result<Self, Error>
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.
sourcepub fn add_source(self, source: &str) -> Result<Self, Error>
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
.
pub fn source_info(&self) -> SourceInfo<'_>
sourcepub fn parse(self) -> Result<RecordKeeper<'s>, Error>
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>
impl<'s> Debug for TableGenParser<'s>
source§impl<'s> Default for TableGenParser<'s>
impl<'s> Default for TableGenParser<'s>
source§impl<'s> Drop for TableGenParser<'s>
impl<'s> Drop for TableGenParser<'s>
source§impl<'s> PartialEq<TableGenParser<'s>> for TableGenParser<'s>
impl<'s> PartialEq<TableGenParser<'s>> for TableGenParser<'s>
source§fn eq(&self, other: &TableGenParser<'s>) -> bool
fn eq(&self, other: &TableGenParser<'s>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'s> Eq for TableGenParser<'s>
impl<'s> StructuralEq for TableGenParser<'s>
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> 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