pub struct PrattCodecParser<S> { /* private fields */ }Expand description
Language-neutral Pratt driver: an operator table plus any token source.
Implementations§
Source§impl<S> PrattCodecParser<S>where
S: PrattTokenSource,
impl<S> PrattCodecParser<S>where
S: PrattTokenSource,
Sourcepub fn new(operators: PrattTable, token_source: S) -> PrattCodecParser<S>
pub fn new(operators: PrattTable, token_source: S) -> PrattCodecParser<S>
Creates a parser driven by operators and token_source.
Sourcepub fn with_surface_name(
self,
surface_name: &'static str,
) -> PrattCodecParser<S>
pub fn with_surface_name( self, surface_name: &'static str, ) -> PrattCodecParser<S>
Sets the surface name used in parse error messages.
Sourcepub fn operators(&self) -> &PrattTable
pub fn operators(&self) -> &PrattTable
Returns the parser’s operator table.
Sourcepub fn token_source(&self) -> &S
pub fn token_source(&self) -> &S
Returns the parser’s token source.
Sourcepub fn parse_tree(
&self,
codec: CodecId,
source: &str,
) -> Result<LocatedExprTree, Error>
pub fn parse_tree( &self, codec: CodecId, source: &str, ) -> Result<LocatedExprTree, Error>
Parses source into a located expression tree under a default budget.
Sourcepub fn parse_tree_with_budget(
&self,
codec: CodecId,
source: &str,
budget: &mut DecodeBudget,
) -> Result<LocatedExprTree, Error>
pub fn parse_tree_with_budget( &self, codec: CodecId, source: &str, budget: &mut DecodeBudget, ) -> Result<LocatedExprTree, Error>
Parses source into a located expression tree under an explicit budget.
Sourcepub fn parse_tree_with_source(
&self,
codec: CodecId,
source_id: impl Into<String>,
source: &str,
) -> Result<LocatedExprTree, Error>
pub fn parse_tree_with_source( &self, codec: CodecId, source_id: impl Into<String>, source: &str, ) -> Result<LocatedExprTree, Error>
Parses source into a located tree with the caller’s source id.
Sourcepub fn parse_tree_with_source_and_budget(
&self,
codec: CodecId,
source_id: SourceId,
source: &str,
budget: &mut DecodeBudget,
) -> Result<LocatedExprTree, Error>
pub fn parse_tree_with_source_and_budget( &self, codec: CodecId, source_id: SourceId, source: &str, budget: &mut DecodeBudget, ) -> Result<LocatedExprTree, Error>
Parses source into a located tree with the caller’s source id and budget.
Auto Trait Implementations§
impl<S> Freeze for PrattCodecParser<S>where
S: Freeze,
impl<S> RefUnwindSafe for PrattCodecParser<S>where
S: RefUnwindSafe,
impl<S> Send for PrattCodecParser<S>where
S: Send,
impl<S> Sync for PrattCodecParser<S>where
S: Sync,
impl<S> Unpin for PrattCodecParser<S>where
S: Unpin,
impl<S> UnsafeUnpin for PrattCodecParser<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for PrattCodecParser<S>where
S: UnwindSafe,
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