pub struct Node(pub u16);
Expand description
A node of the grammar.
Also called a non-terminal in some literature.
A node is a lexical element of the text, made of tokens (a node may contain 0, 1 or more tokens). For example, in the following Rust code:
let x: i32 = 1 + 2;
The grammar would look like this:
Statement → 'let' Pattern ':' Type '=' Expression ';'
As such, the nodes would be "x"
, "i32"
, "1 + 2"
and the whole statement (and
maybe other sub-nodes).
Tuple Fields§
§0: u16
Trait Implementations§
source§impl Ord for Node
impl Ord for Node
source§impl PartialEq<Node> for Node
impl PartialEq<Node> for Node
source§impl PartialOrd<Node> for Node
impl PartialOrd<Node> for Node
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Node
impl Eq for Node
impl StructuralEq for Node
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
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