Struct satysfi_parser::Cst
source · [−]Expand description
Concrete syntax tree. 1つの CST は構文規則、テキストの範囲、子要素からなり、全体として木構造をなす。
Fields
rule: Rule
構文規則。
span: Span
inner: Vec<Cst>
Implementations
sourceimpl Cst
impl Cst
pub fn as_str<'a>(&'a self, text: &'a str) -> &'a str
sourcepub fn get_parent(&self, child: &Cst) -> Option<&Cst>
pub fn get_parent(&self, child: &Cst) -> Option<&Cst>
自分の Cst の内部で、 child の親となる Cst (child の scope を内包する最小の Cst)を探し、あればそれを返す。
pub fn mode(&self, pos: usize) -> Mode
sourcepub fn get_terminal_spans(&self) -> Vec<Span>
pub fn get_terminal_spans(&self) -> Vec<Span>
終端要素の Span を返す。ここでいう終端要素とは、 自身の Cst の span には含まれているが、子の span には含まれていない範囲。
Trait Implementations
impl Eq for Cst
impl StructuralEq for Cst
impl StructuralPartialEq for Cst
Auto Trait Implementations
impl RefUnwindSafe for Cst
impl Send for Cst
impl Sync for Cst
impl Unpin for Cst
impl UnwindSafe for Cst
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more