pub struct DebugObserver<N: Node> { /* private fields */ }Expand description
An observer that prints parsing steps to stdin.
You can provide this function to the ImmutableSyntaxTree::parse_with_observer to test particular syntax parser steps against an arbitrary token input.
Alternatively, consider using Node::debug where you can use arbitrary text instead of a predefined token stream.
Trait Implementations§
Source§impl<N: Node> Default for DebugObserver<N>
impl<N: Node> Default for DebugObserver<N>
Source§impl<N: Node> Observer for DebugObserver<N>
impl<N: Node> Observer for DebugObserver<N>
Source§fn read_token(
&mut self,
token: <Self::Node as Node>::Token,
_token_ref: TokenRef,
)
fn read_token( &mut self, token: <Self::Node as Node>::Token, _token_ref: TokenRef, )
The parser reported consuming of a token from the token input stream. Read more
Source§fn enter_rule(&mut self, rule: NodeRule, _node_ref: NodeRef)
fn enter_rule(&mut self, rule: NodeRule, _node_ref: NodeRef)
The parser reported the beginning of a syntax parsing rule. Read more
Source§fn leave_rule(&mut self, rule: NodeRule, _node_ref: NodeRef)
fn leave_rule(&mut self, rule: NodeRule, _node_ref: NodeRef)
The parser reported the finishing of a syntax parsing rule. Read more
Source§fn lift_node(&mut self, _node_ref: NodeRef)
fn lift_node(&mut self, _node_ref: NodeRef)
The parser reported sibling node lifting to the current node. Read more
Source§fn syntax_error(&mut self, _error_ref: ErrorRef)
fn syntax_error(&mut self, _error_ref: ErrorRef)
The parser reported a syntax error occurred during the rule parsing. Read more
Auto Trait Implementations§
impl<N> Freeze for DebugObserver<N>
impl<N> RefUnwindSafe for DebugObserver<N>where
N: RefUnwindSafe,
impl<N> Send for DebugObserver<N>
impl<N> Sync for DebugObserver<N>
impl<N> Unpin for DebugObserver<N>where
N: Unpin,
impl<N> UnwindSafe for DebugObserver<N>where
N: 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