pub struct Parser { /* private fields */ }Expand description
Parser.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn new_with_config(s: String, config: Config) -> Parser
pub fn new_with_config(s: String, config: Config) -> Parser
Constructor with config.
Sourcepub fn column_add(&self, num: usize)
pub fn column_add(&self, num: usize)
Add chars to column.
Sourcepub fn column_set_from(&self, l: &str)
pub fn column_set_from(&self, l: &str)
Set chars to column from last linefeed.
Sourcepub fn save_token(&mut self, token: Token)
pub fn save_token(&mut self, token: Token)
Save token to saved.
Sourcepub fn load_token(&mut self) -> Option<Token>
pub fn load_token(&mut self) -> Option<Token>
Load token from saved.
Sourcepub fn peek_token(&mut self) -> Result<Token, YangError>
pub fn peek_token(&mut self) -> Result<Token, YangError>
Get a token and save it.
Sourcepub fn get_token(&mut self) -> Result<Token, YangError>
pub fn get_token(&mut self) -> Result<Token, YangError>
Get a token except whitespace and comment.
Sourcepub fn get_single_token(&mut self) -> Result<(Token, usize), YangError>
pub fn get_single_token(&mut self) -> Result<(Token, usize), YangError>
Get a single token and position.
Sourcepub fn parse_yang(&mut self) -> Result<YangStmt, YangError>
pub fn parse_yang(&mut self) -> Result<YangStmt, YangError>
Entry point of YANG parser. An input and a config has to be set. It will return a module or submodule statement.
Auto Trait Implementations§
impl !Freeze for Parser
impl !RefUnwindSafe for Parser
impl Send for Parser
impl !Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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