pub struct Parser<'a> { /* private fields */ }Expand description
A parser structure.
The parser parses tokens to a syntax tree that can be interpreted by an interpreter. The tokens are passed as an iterator that can be a lexer. Also, the parser can take the documentation comments from the lexer and then stores this comments as the documentation of modules and variables.
Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
Sourcepub fn new_with_doc_root_mod_and_doc_current_mod(
path: Arc<String>,
tokens: &'a mut dyn DocIterator<Item = Result<(Token, Pos)>>,
doc_root_mod: Option<Arc<RwLock<ModNode<String, Option<String>>>>>,
doc_current_mod: Option<Arc<RwLock<ModNode<String, Option<String>>>>>,
) -> Self
pub fn new_with_doc_root_mod_and_doc_current_mod( path: Arc<String>, tokens: &'a mut dyn DocIterator<Item = Result<(Token, Pos)>>, doc_root_mod: Option<Arc<RwLock<ModNode<String, Option<String>>>>>, doc_current_mod: Option<Arc<RwLock<ModNode<String, Option<String>>>>>, ) -> Self
Creates a parser with the root module of documentation and the current module of documentation.
Also, this method takes the path that refers to the script and the tokens as the iterator. The parser stores the documentation if the root module of documentation is passed. If the current module of documentation is passed, the parser stores the documentation in this module instead of the root module of documentation.
Sourcepub fn new_with_doc_root_mod(
path: Arc<String>,
tokens: &'a mut dyn DocIterator<Item = Result<(Token, Pos)>>,
doc_root_mod: Option<Arc<RwLock<ModNode<String, Option<String>>>>>,
) -> Self
pub fn new_with_doc_root_mod( path: Arc<String>, tokens: &'a mut dyn DocIterator<Item = Result<(Token, Pos)>>, doc_root_mod: Option<Arc<RwLock<ModNode<String, Option<String>>>>>, ) -> Self
Creates a parser with the root module of documentation without the current module of documentation.
Sourcepub fn new(
path: Arc<String>,
tokens: &'a mut dyn DocIterator<Item = Result<(Token, Pos)>>,
) -> Self
pub fn new( path: Arc<String>, tokens: &'a mut dyn DocIterator<Item = Result<(Token, Pos)>>, ) -> Self
Creates a parser.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Parser<'a>
impl<'a> !Send for Parser<'a>
impl<'a> !Sync for Parser<'a>
impl<'a> !UnwindSafe for Parser<'a>
impl<'a> Freeze for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> UnsafeUnpin for Parser<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.