pub struct Parser<'a> { /* private fields */ }
Expand description
This implements the low-level parser of CFG source text.
Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
Sourcepub fn new(r: Box<dyn Read + 'a>) -> StdResult<Self, RecognizerError>
pub fn new(r: Box<dyn Read + 'a>) -> StdResult<Self, RecognizerError>
Return a new instance of the parser using the provided reader for the source text. The first token is read.
Sourcepub fn at_end(&self) -> bool
pub fn at_end(&self) -> bool
Return true
if the parser has reached the end of the source, else false
.
Sourcepub fn container(&mut self) -> StdResult<ASTValue, RecognizerError>
pub fn container(&mut self) -> StdResult<ASTValue, RecognizerError>
Parse the contents of a configuration, which should be a mapping or a list, and return the parsed value or a syntax error.
Sourcepub fn expr(&mut self) -> StdResult<ASTValue, RecognizerError>
pub fn expr(&mut self) -> StdResult<ASTValue, RecognizerError>
Parse an expression and return an AST node representing it, or a syntax error.
Auto Trait Implementations§
impl<'a> Freeze for Parser<'a>
impl<'a> !RefUnwindSafe for Parser<'a>
impl<'a> !Send for Parser<'a>
impl<'a> !Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> !UnwindSafe 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
Mutably borrows from an owned value. Read more