pub enum DynAstNode {
Exterior(DynToken),
Interior(String, Vec<DynAstNode>),
InteriorVec(String, Vec<DynAstNode>),
}Expand description
Dynamic AST node
Variants§
Exterior(DynToken)
Exterior (leaf) AST node
This is a token node
Interior(String, Vec<DynAstNode>)
Interior AST node
This corresponds to a rule. The children nodes are the members of the rule
InteriorVec(String, Vec<DynAstNode>)
Vector AST node
This corresponds to a vector parameter. The children nodes are the rule type and are in the vector.
Implementations§
Source§impl DynAstNode
impl DynAstNode
Sourcepub fn parse_rule(
ts: &mut TokenStream<'_, DynTok>,
lang: &Language,
rule_name: &str,
) -> Option<Self>
pub fn parse_rule( ts: &mut TokenStream<'_, DynTok>, lang: &Language, rule_name: &str, ) -> Option<Self>
Parse a rule from the token stream.
rule_name is the name of the rule to parse
Sourcepub fn apply_semantic(
&self,
lang: &Language,
tbs: &mut TokenBlocks<DynTok>,
ovr: &Option<DynTok>,
)
pub fn apply_semantic( &self, lang: &Language, tbs: &mut TokenBlocks<DynTok>, ovr: &Option<DynTok>, )
Apply semantic to the AST node based on the language
Auto Trait Implementations§
impl Freeze for DynAstNode
impl RefUnwindSafe for DynAstNode
impl Send for DynAstNode
impl Sync for DynAstNode
impl Unpin for DynAstNode
impl UnwindSafe for DynAstNode
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