diff --git a/build.rs b/build.rs index 6cb26d0..950ac8e 100644 --- a/build.rs +++ b/build.rs @@ -12,7 +12,7 @@ fn main() { let _ = write!(out, "#[derive(Debug, Clone, AnyNode)]\n"); let _ = write!(out, "pub enum AnyNode<'a> {{\n"); - let _ = write!(out, " Span(&'a Span<'a>),\n"); + let _ = write!(out, " Locate(&'a Locate),\n"); let re_node = Regex::new(r"#\[derive.*Node.*\]").unwrap(); @@ -26,7 +26,7 @@ fn main() { let line = line.unwrap(); if hit_node { let name = line.split_whitespace().nth(2).unwrap().replace("<'a>", ""); - let _ = write!(out, " {}(&'a {}<'a>),\n", name, name); + let _ = write!(out, " {}(&'a {}),\n", name, name); hit_node = false; } if re_node.is_match(&line) { diff --git a/src/ast/any_node.rs b/src/ast/any_node.rs index 379b83a..bd54489 100644 --- a/src/ast/any_node.rs +++ b/src/ast/any_node.rs @@ -35,9 +35,9 @@ impl<'a> From>> for AnyNodes<'a> { } } -impl<'a> From<&'a Span<'a>> for AnyNodes<'a> { - fn from(x: &'a Span<'a>) -> Self { - vec![AnyNode::Span(x)].into() +impl<'a> From<&'a Locate> for AnyNodes<'a> { + fn from(x: &'a Locate) -> Self { + vec![AnyNode::Locate(x)].into() } } @@ -327,11 +327,11 @@ where } } -impl<'a, T> From<&'a Paren<'a, T>> for AnyNodes<'a> +impl<'a, T> From<&'a Paren> for AnyNodes<'a> where &'a T: Into>, { - fn from(x: &'a Paren<'a, T>) -> Self { + fn from(x: &'a Paren) -> Self { let mut ret = Vec::new(); let (a, b, c) = &x.nodes; let mut a: AnyNodes<'a> = a.into(); @@ -343,11 +343,11 @@ where } } -impl<'a, T> From<&'a Brace<'a, T>> for AnyNodes<'a> +impl<'a, T> From<&'a Brace> for AnyNodes<'a> where &'a T: Into>, { - fn from(x: &'a Brace<'a, T>) -> Self { + fn from(x: &'a Brace) -> Self { let mut ret = Vec::new(); let (a, b, c) = &x.nodes; let mut a: AnyNodes<'a> = a.into(); @@ -359,11 +359,11 @@ where } } -impl<'a, T> From<&'a Bracket<'a, T>> for AnyNodes<'a> +impl<'a, T> From<&'a Bracket> for AnyNodes<'a> where &'a T: Into>, { - fn from(x: &'a Bracket<'a, T>) -> Self { + fn from(x: &'a Bracket) -> Self { let mut ret = Vec::new(); let (a, b, c) = &x.nodes; let mut a: AnyNodes<'a> = a.into(); @@ -375,11 +375,11 @@ where } } -impl<'a, T> From<&'a ApostropheBrace<'a, T>> for AnyNodes<'a> +impl<'a, T> From<&'a ApostropheBrace> for AnyNodes<'a> where &'a T: Into>, { - fn from(x: &'a ApostropheBrace<'a, T>) -> Self { + fn from(x: &'a ApostropheBrace) -> Self { let mut ret = Vec::new(); let (a, b, c) = &x.nodes; let mut a: AnyNodes<'a> = a.into(); diff --git a/src/ast/node.rs b/src/ast/node.rs index 6793989..e49545d 100644 --- a/src/ast/node.rs +++ b/src/ast/node.rs @@ -5,7 +5,7 @@ pub trait Node<'a> { fn next(&'a self) -> AnyNodes<'a>; } -impl<'a> Node<'a> for Span<'a> { +impl<'a> Node<'a> for Locate { fn next(&'a self) -> AnyNodes<'a> { vec![].into() } diff --git a/src/parser.rs b/src/parser.rs index 753d4d3..539839a 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -32,6 +32,23 @@ pub struct Extra { pub type Span<'a> = nom_locate::LocatedSpanEx<&'a str, Extra>; +#[derive(Copy, Clone, Default, Debug, PartialEq)] +pub struct Locate { + offset: usize, + line: u32, + len: usize, +} + +impl<'a> From> for Locate { + fn from(x: Span<'a>) -> Self { + Locate { + offset: x.offset, + line: x.line, + len: x.fragment.len(), + } + } +} + mod thread_context { use crate::parser::RECURSIVE_FLAG_WORDS; @@ -75,4 +92,10 @@ mod thread_context { RefCell::new(HashMap::new()) } ); + + //thread_local!( + // pub static MEMO: RefCell> = { + // RefCell::new(HashMap::new()) + // } + //); } diff --git a/src/parser/behavioral_statements/assertion_statements.rs b/src/parser/behavioral_statements/assertion_statements.rs index 1882c94..daf83b2 100644 --- a/src/parser/behavioral_statements/assertion_statements.rs +++ b/src/parser/behavioral_statements/assertion_statements.rs @@ -8,95 +8,80 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum AssertionItem<'a> { - Concurrent(ConcurrentAssertionItem<'a>), - Immediate(DeferredImmediateAssetionItem<'a>), +pub enum AssertionItem { + Concurrent(ConcurrentAssertionItem), + Immediate(DeferredImmediateAssetionItem), } #[derive(Debug, Node)] -pub struct DeferredImmediateAssetionItem<'a> { +pub struct DeferredImmediateAssetionItem { pub nodes: ( - Option<(BlockIdentifier<'a>, Symbol<'a>)>, - DeferredImmediateAssertionStatement<'a>, + Option<(BlockIdentifier, Symbol)>, + DeferredImmediateAssertionStatement, ), } #[derive(Debug, Node)] -pub enum ProceduralAssertionStatement<'a> { - Concurrent(ConcurrentAssertionStatement<'a>), - Immediate(ImmediateAssetionStatement<'a>), - Checker(CheckerInstantiation<'a>), +pub enum ProceduralAssertionStatement { + Concurrent(ConcurrentAssertionStatement), + Immediate(ImmediateAssetionStatement), + Checker(CheckerInstantiation), } #[derive(Debug, Node)] -pub enum ImmediateAssetionStatement<'a> { - Simple(SimpleImmediateAssertionStatement<'a>), - Deferred(DeferredImmediateAssertionStatement<'a>), +pub enum ImmediateAssetionStatement { + Simple(SimpleImmediateAssertionStatement), + Deferred(DeferredImmediateAssertionStatement), } #[derive(Debug, Node)] -pub enum SimpleImmediateAssertionStatement<'a> { - Assert(SimpleImmediateAssertStatement<'a>), - Assume(SimpleImmediateAssumeStatement<'a>), - Cover(SimpleImmediateCoverStatement<'a>), +pub enum SimpleImmediateAssertionStatement { + Assert(SimpleImmediateAssertStatement), + Assume(SimpleImmediateAssumeStatement), + Cover(SimpleImmediateCoverStatement), } #[derive(Debug, Node)] -pub struct SimpleImmediateAssertStatement<'a> { - pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, ActionBlock<'a>), +pub struct SimpleImmediateAssertStatement { + pub nodes: (Keyword, Paren, ActionBlock), } #[derive(Debug, Node)] -pub struct SimpleImmediateAssumeStatement<'a> { - pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, ActionBlock<'a>), +pub struct SimpleImmediateAssumeStatement { + pub nodes: (Keyword, Paren, ActionBlock), } #[derive(Debug, Node)] -pub struct SimpleImmediateCoverStatement<'a> { - pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>), +pub struct SimpleImmediateCoverStatement { + pub nodes: (Keyword, Paren, StatementOrNull), } #[derive(Debug, Node)] -pub enum DeferredImmediateAssertionStatement<'a> { - Assert(DeferredImmediateAssertStatement<'a>), - Assume(DeferredImmediateAssumeStatement<'a>), - Cover(DeferredImmediateCoverStatement<'a>), +pub enum DeferredImmediateAssertionStatement { + Assert(DeferredImmediateAssertStatement), + Assume(DeferredImmediateAssumeStatement), + Cover(DeferredImmediateCoverStatement), } #[derive(Debug, Node)] -pub struct DeferredImmediateAssertStatement<'a> { - pub nodes: ( - Keyword<'a>, - AssertTiming<'a>, - Paren<'a, Expression<'a>>, - ActionBlock<'a>, - ), +pub struct DeferredImmediateAssertStatement { + pub nodes: (Keyword, AssertTiming, Paren, ActionBlock), } #[derive(Debug, Node)] -pub struct DeferredImmediateAssumeStatement<'a> { - pub nodes: ( - Keyword<'a>, - AssertTiming<'a>, - Paren<'a, Expression<'a>>, - ActionBlock<'a>, - ), +pub struct DeferredImmediateAssumeStatement { + pub nodes: (Keyword, AssertTiming, Paren, ActionBlock), } #[derive(Debug, Node)] -pub struct DeferredImmediateCoverStatement<'a> { - pub nodes: ( - Keyword<'a>, - AssertTiming<'a>, - Paren<'a, Expression<'a>>, - StatementOrNull<'a>, - ), +pub struct DeferredImmediateCoverStatement { + pub nodes: (Keyword, AssertTiming, Paren, StatementOrNull), } #[derive(Debug, Node)] -pub enum AssertTiming<'a> { - Zero(Symbol<'a>), - Final(Keyword<'a>), +pub enum AssertTiming { + Zero(Symbol), + Final(Keyword), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/case_statements.rs b/src/parser/behavioral_statements/case_statements.rs index b189e5e..190041d 100644 --- a/src/parser/behavioral_statements/case_statements.rs +++ b/src/parser/behavioral_statements/case_statements.rs @@ -9,137 +9,128 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum CaseStatement<'a> { - Normal(CaseStatementNormal<'a>), - Matches(CaseStatementMatches<'a>), - Inside(CaseStatementInside<'a>), +pub enum CaseStatement { + Normal(CaseStatementNormal), + Matches(CaseStatementMatches), + Inside(CaseStatementInside), } #[derive(Debug, Node)] -pub struct CaseStatementNormal<'a> { +pub struct CaseStatementNormal { pub nodes: ( - Option>, - CaseKeyword<'a>, - Paren<'a, CaseExpression<'a>>, - CaseItem<'a>, - Vec>, - Keyword<'a>, + Option, + CaseKeyword, + Paren, + CaseItem, + Vec, + Keyword, ), } #[derive(Debug, Node)] -pub struct CaseStatementMatches<'a> { +pub struct CaseStatementMatches { pub nodes: ( - Option>, - CaseKeyword<'a>, - Paren<'a, CaseExpression<'a>>, - Keyword<'a>, - CasePatternItem<'a>, - Vec>, - Keyword<'a>, + Option, + CaseKeyword, + Paren, + Keyword, + CasePatternItem, + Vec, + Keyword, ), } #[derive(Debug, Node)] -pub struct CaseStatementInside<'a> { +pub struct CaseStatementInside { pub nodes: ( - Option>, - Keyword<'a>, - Paren<'a, CaseExpression<'a>>, - Keyword<'a>, - CaseInsideItem<'a>, - Vec>, - Keyword<'a>, + Option, + Keyword, + Paren, + Keyword, + CaseInsideItem, + Vec, + Keyword, ), } #[derive(Debug, Node)] -pub enum CaseKeyword<'a> { - Case(Keyword<'a>), - Casez(Keyword<'a>), - Casex(Keyword<'a>), +pub enum CaseKeyword { + Case(Keyword), + Casez(Keyword), + Casex(Keyword), } #[derive(Debug, Node)] -pub struct CaseExpression<'a> { - pub nodes: (Expression<'a>,), +pub struct CaseExpression { + pub nodes: (Expression,), } #[derive(Debug, Node)] -pub enum CaseItem<'a> { - NonDefault(CaseItemNondefault<'a>), - Default(CaseItemDefault<'a>), +pub enum CaseItem { + NonDefault(CaseItemNondefault), + Default(CaseItemDefault), } #[derive(Debug, Node)] -pub struct CaseItemNondefault<'a> { +pub struct CaseItemNondefault { + pub nodes: (List, Symbol, StatementOrNull), +} + +#[derive(Debug, Node)] +pub struct CaseItemDefault { + pub nodes: (Keyword, Option, StatementOrNull), +} + +#[derive(Debug, Node)] +pub enum CasePatternItem { + NonDefault(CasePatternItemNondefault), + Default(CaseItemDefault), +} + +#[derive(Debug, Node)] +pub struct CasePatternItemNondefault { pub nodes: ( - List, CaseItemExpression<'a>>, - Symbol<'a>, - StatementOrNull<'a>, + Pattern, + Option<(Symbol, Expression)>, + Symbol, + StatementOrNull, ), } #[derive(Debug, Node)] -pub struct CaseItemDefault<'a> { - pub nodes: (Keyword<'a>, Option>, StatementOrNull<'a>), +pub enum CaseInsideItem { + NonDefault(CaseInsideItemNondefault), + Default(CaseItemDefault), } #[derive(Debug, Node)] -pub enum CasePatternItem<'a> { - NonDefault(CasePatternItemNondefault<'a>), - Default(CaseItemDefault<'a>), +pub struct CaseInsideItemNondefault { + pub nodes: (OpenRangeList, Symbol, StatementOrNull), } #[derive(Debug, Node)] -pub struct CasePatternItemNondefault<'a> { - pub nodes: ( - Pattern<'a>, - Option<(Symbol<'a>, Expression<'a>)>, - Symbol<'a>, - StatementOrNull<'a>, - ), +pub struct CaseItemExpression { + pub nodes: (Expression,), } #[derive(Debug, Node)] -pub enum CaseInsideItem<'a> { - NonDefault(CaseInsideItemNondefault<'a>), - Default(CaseItemDefault<'a>), +pub struct RandcaseStatement { + pub nodes: (Keyword, RandcaseItem, Vec, Keyword), } #[derive(Debug, Node)] -pub struct CaseInsideItemNondefault<'a> { - pub nodes: (OpenRangeList<'a>, Symbol<'a>, StatementOrNull<'a>), +pub struct RandcaseItem { + pub nodes: (Expression, Symbol, StatementOrNull), } #[derive(Debug, Node)] -pub struct CaseItemExpression<'a> { - pub nodes: (Expression<'a>,), +pub struct OpenRangeList { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct RandcaseStatement<'a> { - pub nodes: ( - Keyword<'a>, - RandcaseItem<'a>, - Vec>, - Keyword<'a>, - ), -} - -#[derive(Debug, Node)] -pub struct RandcaseItem<'a> { - pub nodes: (Expression<'a>, Symbol<'a>, StatementOrNull<'a>), -} - -#[derive(Debug, Node)] -pub struct OpenRangeList<'a> { - pub nodes: (List, OpenValueRange<'a>>,), -} - -#[derive(Debug, Node)] -pub struct OpenValueRange<'a> { - pub nodes: (ValueRange<'a>,), +pub struct OpenValueRange { + pub nodes: (ValueRange,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/clocking_block.rs b/src/parser/behavioral_statements/clocking_block.rs index d7d2e9c..7276bc4 100644 --- a/src/parser/behavioral_statements/clocking_block.rs +++ b/src/parser/behavioral_statements/clocking_block.rs @@ -9,196 +9,182 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum ClockingDeclaration<'a> { - Local(ClockingDeclarationLocal<'a>), - Global(ClockingDeclarationGlobal<'a>), +pub enum ClockingDeclaration { + Local(ClockingDeclarationLocal), + Global(ClockingDeclarationGlobal), } #[derive(Debug, Node)] -pub struct ClockingDeclarationLocal<'a> { +pub struct ClockingDeclarationLocal { pub nodes: ( - Option>, - Keyword<'a>, - Option>, - ClockingEvent<'a>, - Symbol<'a>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, ClockingIdentifier<'a>)>, + Option, + Keyword, + Option, + ClockingEvent, + Symbol, + Vec, + Keyword, + Option<(Symbol, ClockingIdentifier)>, ), } #[derive(Debug, Node)] -pub struct Default<'a> { - pub nodes: (Keyword<'a>,), +pub struct Default { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct ClockingDeclarationGlobal<'a> { +pub struct ClockingDeclarationGlobal { pub nodes: ( - Keyword<'a>, - Keyword<'a>, - Option>, - ClockingEvent<'a>, - Symbol<'a>, - Keyword<'a>, - Option<(Symbol<'a>, ClockingIdentifier<'a>)>, + Keyword, + Keyword, + Option, + ClockingEvent, + Symbol, + Keyword, + Option<(Symbol, ClockingIdentifier)>, ), } #[derive(Debug, Node)] -pub enum ClockingEvent<'a> { - Identifier(ClockingEventIdentifier<'a>), - Expression(ClockingEventExpression<'a>), +pub enum ClockingEvent { + Identifier(ClockingEventIdentifier), + Expression(ClockingEventExpression), } #[derive(Debug, Node)] -pub struct ClockingEventIdentifier<'a> { - pub nodes: (Symbol<'a>, Identifier<'a>), +pub struct ClockingEventIdentifier { + pub nodes: (Symbol, Identifier), } #[derive(Debug, Node)] -pub struct ClockingEventExpression<'a> { - pub nodes: (Symbol<'a>, Paren<'a, EventExpression<'a>>), +pub struct ClockingEventExpression { + pub nodes: (Symbol, Paren), } #[derive(Debug, Node)] -pub enum ClockingItem<'a> { - Default(ClockingItemDefault<'a>), - Direction(ClockingItemDirection<'a>), - Assertion(ClockingItemAssertion<'a>), +pub enum ClockingItem { + Default(ClockingItemDefault), + Direction(ClockingItemDirection), + Assertion(ClockingItemAssertion), } #[derive(Debug, Node)] -pub struct ClockingItemDefault<'a> { - pub nodes: (Keyword<'a>, DefaultSkew<'a>, Symbol<'a>), +pub struct ClockingItemDefault { + pub nodes: (Keyword, DefaultSkew, Symbol), } #[derive(Debug, Node)] -pub struct ClockingItemDirection<'a> { - pub nodes: ( - ClockingDirection<'a>, - ListOfClockingDeclAssign<'a>, - Symbol<'a>, - ), +pub struct ClockingItemDirection { + pub nodes: (ClockingDirection, ListOfClockingDeclAssign, Symbol), } #[derive(Debug, Node)] -pub struct ClockingItemAssertion<'a> { - pub nodes: (Vec>, AssertionItemDeclaration<'a>), +pub struct ClockingItemAssertion { + pub nodes: (Vec, AssertionItemDeclaration), } #[derive(Debug, Node)] -pub enum DefaultSkew<'a> { - Input(DefaultSkewInput<'a>), - Output(DefaultSkewOutput<'a>), - InputOutput(DefaultSkewInputOutput<'a>), +pub enum DefaultSkew { + Input(DefaultSkewInput), + Output(DefaultSkewOutput), + InputOutput(DefaultSkewInputOutput), } #[derive(Debug, Node)] -pub struct DefaultSkewInput<'a> { - pub nodes: (Keyword<'a>, ClockingSkew<'a>), +pub struct DefaultSkewInput { + pub nodes: (Keyword, ClockingSkew), } #[derive(Debug, Node)] -pub struct DefaultSkewOutput<'a> { - pub nodes: (Keyword<'a>, ClockingSkew<'a>), +pub struct DefaultSkewOutput { + pub nodes: (Keyword, ClockingSkew), } #[derive(Debug, Node)] -pub struct DefaultSkewInputOutput<'a> { - pub nodes: (Keyword<'a>, ClockingSkew<'a>, Keyword<'a>, ClockingSkew<'a>), +pub struct DefaultSkewInputOutput { + pub nodes: (Keyword, ClockingSkew, Keyword, ClockingSkew), } #[derive(Debug, Node)] -pub enum ClockingDirection<'a> { - Input(ClockingDirectionInput<'a>), - Output(ClockingDirectionOutput<'a>), - InputOutput(ClockingDirectionInputOutput<'a>), - Inout(Keyword<'a>), +pub enum ClockingDirection { + Input(ClockingDirectionInput), + Output(ClockingDirectionOutput), + InputOutput(ClockingDirectionInputOutput), + Inout(Keyword), } #[derive(Debug, Node)] -pub struct ClockingDirectionInput<'a> { - pub nodes: (Keyword<'a>, Option>), +pub struct ClockingDirectionInput { + pub nodes: (Keyword, Option), } #[derive(Debug, Node)] -pub struct ClockingDirectionOutput<'a> { - pub nodes: (Keyword<'a>, Option>), +pub struct ClockingDirectionOutput { + pub nodes: (Keyword, Option), } #[derive(Debug, Node)] -pub struct ClockingDirectionInputOutput<'a> { - pub nodes: ( - Keyword<'a>, - Option>, - Keyword<'a>, - Option>, - ), +pub struct ClockingDirectionInputOutput { + pub nodes: (Keyword, Option, Keyword, Option), } #[derive(Debug, Node)] -pub struct ListOfClockingDeclAssign<'a> { - pub nodes: (List, ClockingDeclAssign<'a>>,), +pub struct ListOfClockingDeclAssign { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ClockingDeclAssign<'a> { - pub nodes: (SignalIdentifier<'a>, Option<(Symbol<'a>, Expression<'a>)>), +pub struct ClockingDeclAssign { + pub nodes: (SignalIdentifier, Option<(Symbol, Expression)>), } #[derive(Debug, Node)] -pub enum ClockingSkew<'a> { - Edge(ClockingSkewEdge<'a>), - DelayControl(DelayControl<'a>), +pub enum ClockingSkew { + Edge(ClockingSkewEdge), + DelayControl(DelayControl), } #[derive(Debug, Node)] -pub struct ClockingSkewEdge<'a> { - pub nodes: (EdgeIdentifier<'a>, Option>), +pub struct ClockingSkewEdge { + pub nodes: (EdgeIdentifier, Option), } #[derive(Debug, Node)] -pub struct ClockingDrive<'a> { - pub nodes: ( - ClockvarExpression<'a>, - Symbol<'a>, - Option>, - Expression<'a>, - ), +pub struct ClockingDrive { + pub nodes: (ClockvarExpression, Symbol, Option, Expression), } #[derive(Debug, Node)] -pub enum CycleDelay<'a> { - Integral(CycleDelayIntegral<'a>), - Identifier(CycleDelayIdentifier<'a>), - Expression(CycleDelayExpression<'a>), +pub enum CycleDelay { + Integral(CycleDelayIntegral), + Identifier(CycleDelayIdentifier), + Expression(CycleDelayExpression), } #[derive(Debug, Node)] -pub struct CycleDelayIntegral<'a> { - pub nodes: (Symbol<'a>, IntegralNumber<'a>), +pub struct CycleDelayIntegral { + pub nodes: (Symbol, IntegralNumber), } #[derive(Debug, Node)] -pub struct CycleDelayIdentifier<'a> { - pub nodes: (Symbol<'a>, Identifier<'a>), +pub struct CycleDelayIdentifier { + pub nodes: (Symbol, Identifier), } #[derive(Debug, Node)] -pub struct CycleDelayExpression<'a> { - pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>), +pub struct CycleDelayExpression { + pub nodes: (Symbol, Paren), } #[derive(Debug, Node)] -pub struct Clockvar<'a> { - pub nodes: (HierarchicalIdentifier<'a>,), +pub struct Clockvar { + pub nodes: (HierarchicalIdentifier,), } #[derive(Debug, Node)] -pub struct ClockvarExpression<'a> { - pub nodes: (Clockvar<'a>, Select<'a>), +pub struct ClockvarExpression { + pub nodes: (Clockvar, Select), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/conditional_statements.rs b/src/parser/behavioral_statements/conditional_statements.rs index 6264072..b527e63 100644 --- a/src/parser/behavioral_statements/conditional_statements.rs +++ b/src/parser/behavioral_statements/conditional_statements.rs @@ -9,43 +9,38 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct ConditionalStatement<'a> { +pub struct ConditionalStatement { pub nodes: ( - Option>, - Keyword<'a>, - Paren<'a, CondPredicate<'a>>, - StatementOrNull<'a>, - Vec<( - Keyword<'a>, - Keyword<'a>, - Paren<'a, CondPredicate<'a>>, - StatementOrNull<'a>, - )>, - Option<(Keyword<'a>, StatementOrNull<'a>)>, + Option, + Keyword, + Paren, + StatementOrNull, + Vec<(Keyword, Keyword, Paren, StatementOrNull)>, + Option<(Keyword, StatementOrNull)>, ), } #[derive(Debug, Node)] -pub enum UniquePriority<'a> { - Unique(Keyword<'a>), - Unique0(Keyword<'a>), - Priority(Keyword<'a>), +pub enum UniquePriority { + Unique(Keyword), + Unique0(Keyword), + Priority(Keyword), } #[derive(Debug, Node)] -pub struct CondPredicate<'a> { - pub nodes: (List, ExpressionOrCondPattern<'a>>,), +pub struct CondPredicate { + pub nodes: (List,), } #[derive(Debug, Node)] -pub enum ExpressionOrCondPattern<'a> { - Expression(Expression<'a>), - CondPattern(CondPattern<'a>), +pub enum ExpressionOrCondPattern { + Expression(Expression), + CondPattern(CondPattern), } #[derive(Debug, Node)] -pub struct CondPattern<'a> { - pub nodes: (Expression<'a>, Keyword<'a>, Pattern<'a>), +pub struct CondPattern { + pub nodes: (Expression, Keyword, Pattern), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/continuous_assignment_and_net_alias_statements.rs b/src/parser/behavioral_statements/continuous_assignment_and_net_alias_statements.rs index ad4105c..8068d5d 100644 --- a/src/parser/behavioral_statements/continuous_assignment_and_net_alias_statements.rs +++ b/src/parser/behavioral_statements/continuous_assignment_and_net_alias_statements.rs @@ -7,56 +7,56 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum ContinuousAssign<'a> { - Net(ContinuousAssignNet<'a>), - Variable(ContinuousAssignVariable<'a>), +pub enum ContinuousAssign { + Net(ContinuousAssignNet), + Variable(ContinuousAssignVariable), } #[derive(Debug, Node)] -pub struct ContinuousAssignNet<'a> { +pub struct ContinuousAssignNet { pub nodes: ( - Keyword<'a>, - Option>, - Option>, - ListOfNetAssignments<'a>, - Symbol<'a>, + Keyword, + Option, + Option, + ListOfNetAssignments, + Symbol, ), } #[derive(Debug, Node)] -pub struct ContinuousAssignVariable<'a> { +pub struct ContinuousAssignVariable { pub nodes: ( - Keyword<'a>, - Option>, - ListOfVariableAssignments<'a>, - Symbol<'a>, + Keyword, + Option, + ListOfVariableAssignments, + Symbol, ), } #[derive(Debug, Node)] -pub struct ListOfNetAssignments<'a> { - pub nodes: (List, NetAssignment<'a>>,), +pub struct ListOfNetAssignments { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ListOfVariableAssignments<'a> { - pub nodes: (List, VariableAssignment<'a>>,), +pub struct ListOfVariableAssignments { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct NetAlias<'a> { +pub struct NetAlias { pub nodes: ( - Keyword<'a>, - NetLvalue<'a>, - Symbol<'a>, - List, NetLvalue<'a>>, - Symbol<'a>, + Keyword, + NetLvalue, + Symbol, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct NetAssignment<'a> { - pub nodes: (NetLvalue<'a>, Symbol<'a>, Expression<'a>), +pub struct NetAssignment { + pub nodes: (NetLvalue, Symbol, Expression), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/looping_statements.rs b/src/parser/behavioral_statements/looping_statements.rs index 3ce7493..70262f3 100644 --- a/src/parser/behavioral_statements/looping_statements.rs +++ b/src/parser/behavioral_statements/looping_statements.rs @@ -8,114 +8,99 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum LoopStatement<'a> { - Forever(LoopStatementForever<'a>), - Repeat(LoopStatementRepeat<'a>), - While(LoopStatementWhile<'a>), - For(LoopStatementFor<'a>), - DoWhile(LoopStatementDoWhile<'a>), - Foreach(LoopStatementForeach<'a>), +pub enum LoopStatement { + Forever(LoopStatementForever), + Repeat(LoopStatementRepeat), + While(LoopStatementWhile), + For(LoopStatementFor), + DoWhile(LoopStatementDoWhile), + Foreach(LoopStatementForeach), } #[derive(Debug, Node)] -pub struct LoopStatementForever<'a> { - pub nodes: (Keyword<'a>, StatementOrNull<'a>), +pub struct LoopStatementForever { + pub nodes: (Keyword, StatementOrNull), } #[derive(Debug, Node)] -pub struct LoopStatementRepeat<'a> { - pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>), +pub struct LoopStatementRepeat { + pub nodes: (Keyword, Paren, StatementOrNull), } #[derive(Debug, Node)] -pub struct LoopStatementWhile<'a> { - pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>), +pub struct LoopStatementWhile { + pub nodes: (Keyword, Paren, StatementOrNull), } #[derive(Debug, Node)] -pub struct LoopStatementFor<'a> { +pub struct LoopStatementFor { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - Option>, - Symbol<'a>, - Option>, - Symbol<'a>, - Option>, - ), - >, - StatementOrNull<'a>, + Keyword, + Paren<( + Option, + Symbol, + Option, + Symbol, + Option, + )>, + StatementOrNull, ), } #[derive(Debug, Node)] -pub struct LoopStatementDoWhile<'a> { +pub struct LoopStatementDoWhile { + pub nodes: (Keyword, StatementOrNull, Keyword, Paren, Symbol), +} + +#[derive(Debug, Node)] +pub struct LoopStatementForeach { pub nodes: ( - Keyword<'a>, - StatementOrNull<'a>, - Keyword<'a>, - Paren<'a, Expression<'a>>, - Symbol<'a>, + Keyword, + Paren<(PsOrHierarchicalArrayIdentifier, Bracket)>, + Statement, ), } #[derive(Debug, Node)] -pub struct LoopStatementForeach<'a> { +pub enum ForInitialization { + ListOfVariableAssignments(ListOfVariableAssignments), + Declaration(ForInitializationDeclaration), +} + +#[derive(Debug, Node)] +pub struct ForInitializationDeclaration { + pub nodes: (List,), +} + +#[derive(Debug, Node)] +pub struct ForVariableDeclaration { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - PsOrHierarchicalArrayIdentifier<'a>, - Bracket<'a, LoopVariables<'a>>, - ), - >, - Statement<'a>, + Option, + DataType, + List, ), } #[derive(Debug, Node)] -pub enum ForInitialization<'a> { - ListOfVariableAssignments(ListOfVariableAssignments<'a>), - Declaration(ForInitializationDeclaration<'a>), +pub struct Var { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct ForInitializationDeclaration<'a> { - pub nodes: (List, ForVariableDeclaration<'a>>,), +pub struct ForStep { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ForVariableDeclaration<'a> { - pub nodes: ( - Option>, - DataType<'a>, - List, (VariableIdentifier<'a>, Symbol<'a>, Expression<'a>)>, - ), +pub enum ForStepAssignment { + OperatorAssignment(OperatorAssignment), + IncOrDecExpression(IncOrDecExpression), + FunctionSubroutineCall(FunctionSubroutineCall), } #[derive(Debug, Node)] -pub struct Var<'a> { - pub nodes: (Keyword<'a>,), -} - -#[derive(Debug, Node)] -pub struct ForStep<'a> { - pub nodes: (List, ForStepAssignment<'a>>,), -} - -#[derive(Debug, Node)] -pub enum ForStepAssignment<'a> { - OperatorAssignment(OperatorAssignment<'a>), - IncOrDecExpression(IncOrDecExpression<'a>), - FunctionSubroutineCall(FunctionSubroutineCall<'a>), -} - -#[derive(Debug, Node)] -pub struct LoopVariables<'a> { - pub nodes: (List, Option>>,), +pub struct LoopVariables { + pub nodes: (List>,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/parallel_and_sequential_blocks.rs b/src/parser/behavioral_statements/parallel_and_sequential_blocks.rs index 34adc0b..c92d24b 100644 --- a/src/parser/behavioral_statements/parallel_and_sequential_blocks.rs +++ b/src/parser/behavioral_statements/parallel_and_sequential_blocks.rs @@ -9,45 +9,45 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum ActionBlock<'a> { - StatementOrNull(StatementOrNull<'a>), - Else(ActionBlockElse<'a>), +pub enum ActionBlock { + StatementOrNull(StatementOrNull), + Else(ActionBlockElse), } #[derive(Debug, Node)] -pub struct ActionBlockElse<'a> { - pub nodes: (Option>, Keyword<'a>, StatementOrNull<'a>), +pub struct ActionBlockElse { + pub nodes: (Option, Keyword, StatementOrNull), } #[derive(Debug, Node)] -pub struct SeqBlock<'a> { +pub struct SeqBlock { pub nodes: ( - Keyword<'a>, - Option<(Symbol<'a>, BlockIdentifier<'a>)>, - Vec>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, BlockIdentifier<'a>)>, + Keyword, + Option<(Symbol, BlockIdentifier)>, + Vec, + Vec, + Keyword, + Option<(Symbol, BlockIdentifier)>, ), } #[derive(Debug, Node)] -pub struct ParBlock<'a> { +pub struct ParBlock { pub nodes: ( - Keyword<'a>, - Option<(Symbol<'a>, BlockIdentifier<'a>)>, - Vec>, - Vec>, - JoinKeyword<'a>, - Option<(Symbol<'a>, BlockIdentifier<'a>)>, + Keyword, + Option<(Symbol, BlockIdentifier)>, + Vec, + Vec, + JoinKeyword, + Option<(Symbol, BlockIdentifier)>, ), } #[derive(Debug, Node)] -pub enum JoinKeyword<'a> { - Join(Keyword<'a>), - JoinAny(Keyword<'a>), - JoinNone(Keyword<'a>), +pub enum JoinKeyword { + Join(Keyword), + JoinAny(Keyword), + JoinNone(Keyword), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/patterns.rs b/src/parser/behavioral_statements/patterns.rs index b34d4ed..da813af 100644 --- a/src/parser/behavioral_statements/patterns.rs +++ b/src/parser/behavioral_statements/patterns.rs @@ -8,126 +8,107 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum Pattern<'a> { - Variable(Box>), - Asterisk(Symbol<'a>), - ConstantExpression(Box>), - Tagged(Box>), - List(Box>), - IdentifierList(Box>), +pub enum Pattern { + Variable(Box), + Asterisk(Symbol), + ConstantExpression(Box), + Tagged(Box), + List(Box), + IdentifierList(Box), } #[derive(Debug, Node)] -pub struct PatternVariable<'a> { - pub nodes: (Symbol<'a>, VariableIdentifier<'a>), +pub struct PatternVariable { + pub nodes: (Symbol, VariableIdentifier), } #[derive(Debug, Node)] -pub struct PatternTagged<'a> { - pub nodes: (Keyword<'a>, MemberIdentifier<'a>, Option>), +pub struct PatternTagged { + pub nodes: (Keyword, MemberIdentifier, Option), } #[derive(Debug, Node)] -pub struct PatternList<'a> { - pub nodes: (ApostropheBrace<'a, List, Pattern<'a>>>,), +pub struct PatternList { + pub nodes: (ApostropheBrace>,), } #[derive(Debug, Node)] -pub struct PatternIdentifierList<'a> { - pub nodes: - (ApostropheBrace<'a, List, (MemberIdentifier<'a>, Symbol<'a>, Pattern<'a>)>>,), +pub struct PatternIdentifierList { + pub nodes: (ApostropheBrace>,), } #[derive(Debug, Node)] -pub enum AssignmentPattern<'a> { - List(AssignmentPatternList<'a>), - Structure(AssignmentPatternStructure<'a>), - Array(AssignmentPatternArray<'a>), - Repeat(AssignmentPatternRepeat<'a>), +pub enum AssignmentPattern { + List(AssignmentPatternList), + Structure(AssignmentPatternStructure), + Array(AssignmentPatternArray), + Repeat(AssignmentPatternRepeat), } #[derive(Debug, Node)] -pub struct AssignmentPatternList<'a> { - pub nodes: (ApostropheBrace<'a, List, Expression<'a>>>,), +pub struct AssignmentPatternList { + pub nodes: (ApostropheBrace>,), } #[derive(Debug, Node)] -pub struct AssignmentPatternStructure<'a> { - pub nodes: ( - ApostropheBrace< - 'a, - List, (StructurePatternKey<'a>, Symbol<'a>, Expression<'a>)>, - >, - ), +pub struct AssignmentPatternStructure { + pub nodes: (ApostropheBrace>,), } #[derive(Debug, Node)] -pub struct AssignmentPatternArray<'a> { - pub nodes: ( - ApostropheBrace<'a, List, (ArrayPatternKey<'a>, Symbol<'a>, Expression<'a>)>>, - ), +pub struct AssignmentPatternArray { + pub nodes: (ApostropheBrace>,), } #[derive(Debug, Node)] -pub struct AssignmentPatternRepeat<'a> { - pub nodes: ( - ApostropheBrace< - 'a, - ( - ConstantExpression<'a>, - Brace<'a, List, Expression<'a>>>, - ), - >, - ), +pub struct AssignmentPatternRepeat { + pub nodes: (ApostropheBrace<(ConstantExpression, Brace>)>,), } #[derive(Debug, Node)] -pub enum StructurePatternKey<'a> { - MemberIdentifier(MemberIdentifier<'a>), - AssignmentPatternKey(AssignmentPatternKey<'a>), +pub enum StructurePatternKey { + MemberIdentifier(MemberIdentifier), + AssignmentPatternKey(AssignmentPatternKey), } #[derive(Debug, Node)] -pub enum ArrayPatternKey<'a> { - ConstantExpression(ConstantExpression<'a>), - AssignmentPatternKey(AssignmentPatternKey<'a>), +pub enum ArrayPatternKey { + ConstantExpression(ConstantExpression), + AssignmentPatternKey(AssignmentPatternKey), } #[derive(Debug, Node)] -pub enum AssignmentPatternKey<'a> { - SimpleType(SimpleType<'a>), - Default(Keyword<'a>), +pub enum AssignmentPatternKey { + SimpleType(SimpleType), + Default(Keyword), } #[derive(Debug, Node)] -pub struct AssignmentPatternExpression<'a> { - pub nodes: ( - Option>, - AssignmentPattern<'a>, - ), +pub struct AssignmentPatternExpression { + pub nodes: (Option, AssignmentPattern), } #[derive(Debug, Node)] -pub enum AssignmentPatternExpressionType<'a> { - PsTypeIdentifier(PsTypeIdentifier<'a>), - PsParameterIdentifier(PsParameterIdentifier<'a>), - IntegerAtomType(IntegerAtomType<'a>), - TypeReference(TypeReference<'a>), +pub enum AssignmentPatternExpressionType { + PsTypeIdentifier(PsTypeIdentifier), + PsParameterIdentifier(PsParameterIdentifier), + IntegerAtomType(IntegerAtomType), + TypeReference(TypeReference), } #[derive(Debug, Node)] -pub struct ConstantAssignmentPatternExpression<'a> { - pub nodes: (AssignmentPatternExpression<'a>,), +pub struct ConstantAssignmentPatternExpression { + pub nodes: (AssignmentPatternExpression,), } #[derive(Debug, Node)] -pub struct AssignmentPatternNetLvalue<'a> { - pub nodes: (ApostropheBrace<'a, List, NetLvalue<'a>>>,), +pub struct AssignmentPatternNetLvalue { + pub nodes: (ApostropheBrace>,), } #[derive(Debug, Node)] -pub struct AssignmentPatternVariableLvalue<'a> { - pub nodes: (ApostropheBrace<'a, List, VariableLvalue<'a>>>,), +pub struct AssignmentPatternVariableLvalue { + pub nodes: (ApostropheBrace>,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/procedural_blocks_and_assignments.rs b/src/parser/behavioral_statements/procedural_blocks_and_assignments.rs index 5ee9e99..0998443 100644 --- a/src/parser/behavioral_statements/procedural_blocks_and_assignments.rs +++ b/src/parser/behavioral_statements/procedural_blocks_and_assignments.rs @@ -7,125 +7,125 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct InitialConstruct<'a> { - pub nodes: (Keyword<'a>, StatementOrNull<'a>), +pub struct InitialConstruct { + pub nodes: (Keyword, StatementOrNull), } #[derive(Debug, Node)] -pub struct AlwaysConstruct<'a> { - pub nodes: (AlwaysKeyword<'a>, Statement<'a>), +pub struct AlwaysConstruct { + pub nodes: (AlwaysKeyword, Statement), } #[derive(Debug, Node)] -pub enum AlwaysKeyword<'a> { - Always(Keyword<'a>), - AlwaysComb(Keyword<'a>), - AlwaysLatch(Keyword<'a>), - AlwaysFf(Keyword<'a>), +pub enum AlwaysKeyword { + Always(Keyword), + AlwaysComb(Keyword), + AlwaysLatch(Keyword), + AlwaysFf(Keyword), } #[derive(Debug, Node)] -pub struct FinalConstruct<'a> { - pub nodes: (Keyword<'a>, FunctionStatement<'a>), +pub struct FinalConstruct { + pub nodes: (Keyword, FunctionStatement), } #[derive(Debug, Node)] -pub enum BlockingAssignment<'a> { - Variable(BlockingAssignmentVariable<'a>), - NonrangeVariable(BlockingAssignmentNonrangeVariable<'a>), - HierarchicalVariable(BlockingAssignmentHierarchicalVariable<'a>), - OperatorAssignment(OperatorAssignment<'a>), +pub enum BlockingAssignment { + Variable(BlockingAssignmentVariable), + NonrangeVariable(BlockingAssignmentNonrangeVariable), + HierarchicalVariable(BlockingAssignmentHierarchicalVariable), + OperatorAssignment(OperatorAssignment), } #[derive(Debug, Node)] -pub struct BlockingAssignmentVariable<'a> { +pub struct BlockingAssignmentVariable { pub nodes: ( - VariableLvalue<'a>, - Symbol<'a>, - DelayOrEventControl<'a>, - Expression<'a>, + VariableLvalue, + Symbol, + DelayOrEventControl, + Expression, ), } #[derive(Debug, Node)] -pub struct BlockingAssignmentNonrangeVariable<'a> { - pub nodes: (NonrangeVariableLvalue<'a>, Symbol<'a>, DynamicArrayNew<'a>), +pub struct BlockingAssignmentNonrangeVariable { + pub nodes: (NonrangeVariableLvalue, Symbol, DynamicArrayNew), } #[derive(Debug, Node)] -pub struct BlockingAssignmentHierarchicalVariable<'a> { +pub struct BlockingAssignmentHierarchicalVariable { pub nodes: ( - Option>, - HierarchicalVariableIdentifier<'a>, - Select<'a>, - Symbol<'a>, - ClassNew<'a>, + Option, + HierarchicalVariableIdentifier, + Select, + Symbol, + ClassNew, ), } #[derive(Debug, Node)] -pub struct OperatorAssignment<'a> { - pub nodes: (VariableLvalue<'a>, AssignmentOperator<'a>, Expression<'a>), +pub struct OperatorAssignment { + pub nodes: (VariableLvalue, AssignmentOperator, Expression), } #[derive(Debug, Node)] -pub struct AssignmentOperator<'a> { - pub nodes: (Symbol<'a>,), +pub struct AssignmentOperator { + pub nodes: (Symbol,), } #[derive(Debug, Node)] -pub struct NonblockingAssignment<'a> { +pub struct NonblockingAssignment { pub nodes: ( - VariableLvalue<'a>, - Symbol<'a>, - Option>, - Expression<'a>, + VariableLvalue, + Symbol, + Option, + Expression, ), } #[derive(Debug, Node)] -pub enum ProceduralContinuousAssignment<'a> { - Assign(ProceduralContinuousAssignmentAssign<'a>), - Deassign(ProceduralContinuousAssignmentDeassign<'a>), - ForceVariable(ProceduralContinuousAssignmentForceVariable<'a>), - ForceNet(ProceduralContinuousAssignmentForceNet<'a>), - ReleaseVariable(ProceduralContinuousAssignmentReleaseVariable<'a>), - ReleaseNet(ProceduralContinuousAssignmentReleaseNet<'a>), +pub enum ProceduralContinuousAssignment { + Assign(ProceduralContinuousAssignmentAssign), + Deassign(ProceduralContinuousAssignmentDeassign), + ForceVariable(ProceduralContinuousAssignmentForceVariable), + ForceNet(ProceduralContinuousAssignmentForceNet), + ReleaseVariable(ProceduralContinuousAssignmentReleaseVariable), + ReleaseNet(ProceduralContinuousAssignmentReleaseNet), } #[derive(Debug, Node)] -pub struct ProceduralContinuousAssignmentAssign<'a> { - pub nodes: (Keyword<'a>, VariableAssignment<'a>), +pub struct ProceduralContinuousAssignmentAssign { + pub nodes: (Keyword, VariableAssignment), } #[derive(Debug, Node)] -pub struct ProceduralContinuousAssignmentDeassign<'a> { - pub nodes: (Keyword<'a>, VariableLvalue<'a>), +pub struct ProceduralContinuousAssignmentDeassign { + pub nodes: (Keyword, VariableLvalue), } #[derive(Debug, Node)] -pub struct ProceduralContinuousAssignmentForceVariable<'a> { - pub nodes: (Keyword<'a>, VariableAssignment<'a>), +pub struct ProceduralContinuousAssignmentForceVariable { + pub nodes: (Keyword, VariableAssignment), } #[derive(Debug, Node)] -pub struct ProceduralContinuousAssignmentForceNet<'a> { - pub nodes: (Keyword<'a>, NetAssignment<'a>), +pub struct ProceduralContinuousAssignmentForceNet { + pub nodes: (Keyword, NetAssignment), } #[derive(Debug, Node)] -pub struct ProceduralContinuousAssignmentReleaseVariable<'a> { - pub nodes: (Keyword<'a>, VariableLvalue<'a>), +pub struct ProceduralContinuousAssignmentReleaseVariable { + pub nodes: (Keyword, VariableLvalue), } #[derive(Debug, Node)] -pub struct ProceduralContinuousAssignmentReleaseNet<'a> { - pub nodes: (Keyword<'a>, NetLvalue<'a>), +pub struct ProceduralContinuousAssignmentReleaseNet { + pub nodes: (Keyword, NetLvalue), } #[derive(Debug, Node)] -pub struct VariableAssignment<'a> { - pub nodes: (VariableLvalue<'a>, Symbol<'a>, Expression<'a>), +pub struct VariableAssignment { + pub nodes: (VariableLvalue, Symbol, Expression), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/randsequence.rs b/src/parser/behavioral_statements/randsequence.rs index 0fad411..0521141 100644 --- a/src/parser/behavioral_statements/randsequence.rs +++ b/src/parser/behavioral_statements/randsequence.rs @@ -9,143 +9,135 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct RandsequenceStatement<'a> { +pub struct RandsequenceStatement { pub nodes: ( - Keyword<'a>, - Paren<'a, Option>>, - Production<'a>, - Vec>, - Keyword<'a>, + Keyword, + Paren>, + Production, + Vec, + Keyword, ), } #[derive(Debug, Node)] -pub struct Production<'a> { +pub struct Production { pub nodes: ( - Option>, - ProductionIdentifier<'a>, - Option>>, - Symbol<'a>, - List, RsRule<'a>>, - Symbol<'a>, + Option, + ProductionIdentifier, + Option>, + Symbol, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct RsRule<'a> { +pub struct RsRule { pub nodes: ( - RsProductionList<'a>, - Option<(Symbol<'a>, WeightSpecification<'a>, Option>)>, + RsProductionList, + Option<(Symbol, WeightSpecification, Option)>, ), } #[derive(Debug, Node)] -pub enum RsProductionList<'a> { - Prod(RsProductionListProd<'a>), - Join(RsProductionListJoin<'a>), +pub enum RsProductionList { + Prod(RsProductionListProd), + Join(RsProductionListJoin), } #[derive(Debug, Node)] -pub struct RsProductionListProd<'a> { - pub nodes: (RsProd<'a>, Vec>), +pub struct RsProductionListProd { + pub nodes: (RsProd, Vec), } #[derive(Debug, Node)] -pub struct RsProductionListJoin<'a> { +pub struct RsProductionListJoin { pub nodes: ( - Keyword<'a>, - Keyword<'a>, - Option>>, - ProductionItem<'a>, - ProductionItem<'a>, - Vec>, + Keyword, + Keyword, + Option>, + ProductionItem, + ProductionItem, + Vec, ), } #[derive(Debug, Node)] -pub enum WeightSpecification<'a> { - IntegralNumber(IntegralNumber<'a>), - PsIdentifier(PsIdentifier<'a>), - Expression(WeightSpecificationExpression<'a>), +pub enum WeightSpecification { + IntegralNumber(IntegralNumber), + PsIdentifier(PsIdentifier), + Expression(WeightSpecificationExpression), } #[derive(Debug, Node)] -pub struct WeightSpecificationExpression<'a> { - pub nodes: (Paren<'a, Expression<'a>>,), +pub struct WeightSpecificationExpression { + pub nodes: (Paren,), } #[derive(Debug, Node)] -pub struct RsCodeBlock<'a> { - pub nodes: (Brace<'a, (Vec>, Vec>)>,), +pub struct RsCodeBlock { + pub nodes: (Brace<(Vec, Vec)>,), } #[derive(Debug, Node)] -pub enum RsProd<'a> { - ProductionItem(ProductionItem<'a>), - RsCodeBlock(RsCodeBlock<'a>), - RsIfElse(RsIfElse<'a>), - RsRepeat(RsRepeat<'a>), - RsCase(RsCase<'a>), +pub enum RsProd { + ProductionItem(ProductionItem), + RsCodeBlock(RsCodeBlock), + RsIfElse(RsIfElse), + RsRepeat(RsRepeat), + RsCase(RsCase), } #[derive(Debug, Node)] -pub struct ProductionItem<'a> { +pub struct ProductionItem { + pub nodes: (ProductionIdentifier, Option>), +} + +#[derive(Debug, Node)] +pub struct RsIfElse { pub nodes: ( - ProductionIdentifier<'a>, - Option>>, + Keyword, + Paren, + ProductionItem, + Option<(Keyword, ProductionItem)>, ), } #[derive(Debug, Node)] -pub struct RsIfElse<'a> { +pub struct RsRepeat { + pub nodes: (Keyword, Paren, ProductionItem), +} + +#[derive(Debug, Node)] +pub struct RsCase { pub nodes: ( - Keyword<'a>, - Paren<'a, Expression<'a>>, - ProductionItem<'a>, - Option<(Keyword<'a>, ProductionItem<'a>)>, + Keyword, + Paren, + RsCaseItem, + Vec, + Keyword, ), } #[derive(Debug, Node)] -pub struct RsRepeat<'a> { - pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, ProductionItem<'a>), +pub enum RsCaseItem { + NonDefault(RsCaseItemNondefault), + Default(RsCaseItemDefault), } #[derive(Debug, Node)] -pub struct RsCase<'a> { +pub struct RsCaseItemNondefault { pub nodes: ( - Keyword<'a>, - Paren<'a, CaseExpression<'a>>, - RsCaseItem<'a>, - Vec>, - Keyword<'a>, + List, + Symbol, + ProductionItem, + Symbol, ), } #[derive(Debug, Node)] -pub enum RsCaseItem<'a> { - NonDefault(RsCaseItemNondefault<'a>), - Default(RsCaseItemDefault<'a>), -} - -#[derive(Debug, Node)] -pub struct RsCaseItemNondefault<'a> { - pub nodes: ( - List, CaseItemExpression<'a>>, - Symbol<'a>, - ProductionItem<'a>, - Symbol<'a>, - ), -} - -#[derive(Debug, Node)] -pub struct RsCaseItemDefault<'a> { - pub nodes: ( - Keyword<'a>, - Option>, - ProductionItem<'a>, - Symbol<'a>, - ), +pub struct RsCaseItemDefault { + pub nodes: (Keyword, Option, ProductionItem, Symbol), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/statements.rs b/src/parser/behavioral_statements/statements.rs index 4da95e4..7568a01 100644 --- a/src/parser/behavioral_statements/statements.rs +++ b/src/parser/behavioral_statements/statements.rs @@ -9,68 +9,68 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum StatementOrNull<'a> { - Statement(Statement<'a>), - Attribute(StatementOrNullAttribute<'a>), +pub enum StatementOrNull { + Statement(Statement), + Attribute(StatementOrNullAttribute), } #[derive(Debug, Node)] -pub struct StatementOrNullAttribute<'a> { - pub nodes: (Vec>, Symbol<'a>), +pub struct StatementOrNullAttribute { + pub nodes: (Vec, Symbol), } #[derive(Debug, Node)] -pub struct Statement<'a> { +pub struct Statement { pub nodes: ( - Option<(BlockIdentifier<'a>, Symbol<'a>)>, - Vec>, - StatementItem<'a>, + Option<(BlockIdentifier, Symbol)>, + Vec, + StatementItem, ), } #[derive(Debug, Node)] -pub enum StatementItem<'a> { - BlockingAssignment(Box<(BlockingAssignment<'a>, Symbol<'a>)>), - NonblockingAssignment(Box<(NonblockingAssignment<'a>, Symbol<'a>)>), - ProceduralContinuousAssignment(Box<(ProceduralContinuousAssignment<'a>, Symbol<'a>)>), - CaseStatement(Box>), - ConditionalStatement(Box>), - IncOrDecExpression(Box<(IncOrDecExpression<'a>, Symbol<'a>)>), - SubroutineCallStatement(Box>), - DisableStatement(Box>), - EventTrigger(Box>), - LoopStatement(Box>), - JumpStatement(Box>), - ParBlock(Box>), - ProceduralTimingControlStatement(Box>), - SeqBlock(Box>), - WaitStatement(Box>), - ProceduralAssertionStatement(Box>), - ClockingDrive(Box<(ClockingDrive<'a>, Symbol<'a>)>), - RandsequenceStatement(Box>), - RandcaseStatement(Box>), - ExpectPropertyStatement(Box>), +pub enum StatementItem { + BlockingAssignment(Box<(BlockingAssignment, Symbol)>), + NonblockingAssignment(Box<(NonblockingAssignment, Symbol)>), + ProceduralContinuousAssignment(Box<(ProceduralContinuousAssignment, Symbol)>), + CaseStatement(Box), + ConditionalStatement(Box), + IncOrDecExpression(Box<(IncOrDecExpression, Symbol)>), + SubroutineCallStatement(Box), + DisableStatement(Box), + EventTrigger(Box), + LoopStatement(Box), + JumpStatement(Box), + ParBlock(Box), + ProceduralTimingControlStatement(Box), + SeqBlock(Box), + WaitStatement(Box), + ProceduralAssertionStatement(Box), + ClockingDrive(Box<(ClockingDrive, Symbol)>), + RandsequenceStatement(Box), + RandcaseStatement(Box), + ExpectPropertyStatement(Box), } #[derive(Debug, Node)] -pub struct FunctionStatement<'a> { - pub nodes: (Statement<'a>,), +pub struct FunctionStatement { + pub nodes: (Statement,), } #[derive(Debug, Node)] -pub enum FunctionStatementOrNull<'a> { - Statement(FunctionStatement<'a>), - Attribute(FunctionStatementOrNullAttribute<'a>), +pub enum FunctionStatementOrNull { + Statement(FunctionStatement), + Attribute(FunctionStatementOrNullAttribute), } #[derive(Debug, Node)] -pub struct FunctionStatementOrNullAttribute<'a> { - pub nodes: (Vec>, Symbol<'a>), +pub struct FunctionStatementOrNullAttribute { + pub nodes: (Vec, Symbol), } #[derive(Debug, Node)] -pub struct VariableIdentifierList<'a> { - pub nodes: (List, VariableIdentifier<'a>>,), +pub struct VariableIdentifierList { + pub nodes: (List,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/subroutine_call_statements.rs b/src/parser/behavioral_statements/subroutine_call_statements.rs index fa2dc46..a06de3f 100644 --- a/src/parser/behavioral_statements/subroutine_call_statements.rs +++ b/src/parser/behavioral_statements/subroutine_call_statements.rs @@ -8,19 +8,14 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum SubroutineCallStatement<'a> { - SubroutineCall((SubroutineCall<'a>, Symbol<'a>)), - Function(SubroutineCallStatementFunction<'a>), +pub enum SubroutineCallStatement { + SubroutineCall((SubroutineCall, Symbol)), + Function(SubroutineCallStatementFunction), } #[derive(Debug, Node)] -pub struct SubroutineCallStatementFunction<'a> { - pub nodes: ( - Keyword<'a>, - Symbol<'a>, - Paren<'a, FunctionSubroutineCall<'a>>, - Symbol<'a>, - ), +pub struct SubroutineCallStatementFunction { + pub nodes: (Keyword, Symbol, Paren, Symbol), } // ----------------------------------------------------------------------------- diff --git a/src/parser/behavioral_statements/timing_control_statements.rs b/src/parser/behavioral_statements/timing_control_statements.rs index ccc08d3..bd28582 100644 --- a/src/parser/behavioral_statements/timing_control_statements.rs +++ b/src/parser/behavioral_statements/timing_control_statements.rs @@ -8,206 +8,206 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct ProceduralTimingControlStatement<'a> { - pub nodes: (ProceduralTimingControl<'a>, StatementOrNull<'a>), +pub struct ProceduralTimingControlStatement { + pub nodes: (ProceduralTimingControl, StatementOrNull), } #[derive(Debug, Node)] -pub enum DelayOrEventControl<'a> { - Delay(DelayControl<'a>), - Event(EventControl<'a>), - Repeat(DelayOrEventControlRepeat<'a>), +pub enum DelayOrEventControl { + Delay(DelayControl), + Event(EventControl), + Repeat(DelayOrEventControlRepeat), } #[derive(Debug, Node)] -pub struct DelayOrEventControlRepeat<'a> { - pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, EventControl<'a>), +pub struct DelayOrEventControlRepeat { + pub nodes: (Keyword, Paren, EventControl), } #[derive(Debug, Node)] -pub enum DelayControl<'a> { - Delay(DelayControlDelay<'a>), - Mintypmax(DelayControlMintypmax<'a>), +pub enum DelayControl { + Delay(DelayControlDelay), + Mintypmax(DelayControlMintypmax), } #[derive(Debug, Node)] -pub struct DelayControlDelay<'a> { - pub nodes: (Symbol<'a>, DelayValue<'a>), +pub struct DelayControlDelay { + pub nodes: (Symbol, DelayValue), } #[derive(Debug, Node)] -pub struct DelayControlMintypmax<'a> { - pub nodes: (Symbol<'a>, Paren<'a, MintypmaxExpression<'a>>), +pub struct DelayControlMintypmax { + pub nodes: (Symbol, Paren), } #[derive(Debug, Node)] -pub enum EventControl<'a> { - EventIdentifier(EventControlEventIdentifier<'a>), - EventExpression(EventControlEventExpression<'a>), - Asterisk(EventControlAsterisk<'a>), - ParenAsterisk(EventControlParenAsterisk<'a>), - SequenceIdentifier(EventControlSequenceIdentifier<'a>), +pub enum EventControl { + EventIdentifier(EventControlEventIdentifier), + EventExpression(EventControlEventExpression), + Asterisk(EventControlAsterisk), + ParenAsterisk(EventControlParenAsterisk), + SequenceIdentifier(EventControlSequenceIdentifier), } #[derive(Debug, Node)] -pub struct EventControlEventIdentifier<'a> { - pub nodes: (Symbol<'a>, HierarchicalEventIdentifier<'a>), +pub struct EventControlEventIdentifier { + pub nodes: (Symbol, HierarchicalEventIdentifier), } #[derive(Debug, Node)] -pub struct EventControlEventExpression<'a> { - pub nodes: (Symbol<'a>, Paren<'a, EventExpression<'a>>), +pub struct EventControlEventExpression { + pub nodes: (Symbol, Paren), } #[derive(Debug, Node)] -pub struct EventControlAsterisk<'a> { - pub nodes: (Symbol<'a>,), +pub struct EventControlAsterisk { + pub nodes: (Symbol,), } #[derive(Debug, Node)] -pub struct EventControlParenAsterisk<'a> { - pub nodes: (Symbol<'a>, Paren<'a, Symbol<'a>>), +pub struct EventControlParenAsterisk { + pub nodes: (Symbol, Paren), } #[derive(Debug, Node)] -pub struct EventControlSequenceIdentifier<'a> { - pub nodes: (Symbol<'a>, PsOrHierarchicalSequenceIdentifier<'a>), +pub struct EventControlSequenceIdentifier { + pub nodes: (Symbol, PsOrHierarchicalSequenceIdentifier), } #[derive(Debug, Node)] -pub enum EventExpression<'a> { - Expression(Box>), - Sequence(Box>), - Or(Box>), - Comma(Box>), - Paren(Box>), +pub enum EventExpression { + Expression(Box), + Sequence(Box), + Or(Box), + Comma(Box), + Paren(Box), } #[derive(Debug, Node)] -pub struct EventExpressionExpression<'a> { +pub struct EventExpressionExpression { pub nodes: ( - Option>, - Expression<'a>, - Option<(Keyword<'a>, Expression<'a>)>, + Option, + Expression, + Option<(Keyword, Expression)>, ), } #[derive(Debug, Node)] -pub struct EventExpressionSequence<'a> { - pub nodes: (SequenceInstance<'a>, Option<(Keyword<'a>, Expression<'a>)>), +pub struct EventExpressionSequence { + pub nodes: (SequenceInstance, Option<(Keyword, Expression)>), } #[derive(Debug, Node)] -pub struct EventExpressionOr<'a> { - pub nodes: (EventExpression<'a>, Keyword<'a>, EventExpression<'a>), +pub struct EventExpressionOr { + pub nodes: (EventExpression, Keyword, EventExpression), } #[derive(Debug, Node)] -pub struct EventExpressionComma<'a> { - pub nodes: (EventExpression<'a>, Symbol<'a>, EventExpression<'a>), +pub struct EventExpressionComma { + pub nodes: (EventExpression, Symbol, EventExpression), } #[derive(Debug, Node)] -pub struct EventExpressionParen<'a> { - pub nodes: (Paren<'a, EventExpression<'a>>,), +pub struct EventExpressionParen { + pub nodes: (Paren,), } #[derive(Debug, Node)] -pub enum ProceduralTimingControl<'a> { - DelayControl(DelayControl<'a>), - EventControl(EventControl<'a>), - CycleDelay(CycleDelay<'a>), +pub enum ProceduralTimingControl { + DelayControl(DelayControl), + EventControl(EventControl), + CycleDelay(CycleDelay), } #[derive(Debug, Node)] -pub enum JumpStatement<'a> { - Return(JumpStatementReturn<'a>), - Break(JumpStatementBreak<'a>), - Continue(JumpStatementContinue<'a>), +pub enum JumpStatement { + Return(JumpStatementReturn), + Break(JumpStatementBreak), + Continue(JumpStatementContinue), } #[derive(Debug, Node)] -pub struct JumpStatementReturn<'a> { - pub nodes: (Keyword<'a>, Option>, Symbol<'a>), +pub struct JumpStatementReturn { + pub nodes: (Keyword, Option, Symbol), } #[derive(Debug, Node)] -pub struct JumpStatementBreak<'a> { - pub nodes: (Keyword<'a>, Symbol<'a>), +pub struct JumpStatementBreak { + pub nodes: (Keyword, Symbol), } #[derive(Debug, Node)] -pub struct JumpStatementContinue<'a> { - pub nodes: (Keyword<'a>, Symbol<'a>), +pub struct JumpStatementContinue { + pub nodes: (Keyword, Symbol), } #[derive(Debug, Node)] -pub enum WaitStatement<'a> { - Wait(WaitStatementWait<'a>), - Fork(WaitStatementFork<'a>), - Order(WaitStatementOrder<'a>), +pub enum WaitStatement { + Wait(WaitStatementWait), + Fork(WaitStatementFork), + Order(WaitStatementOrder), } #[derive(Debug, Node)] -pub struct WaitStatementWait<'a> { - pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>), +pub struct WaitStatementWait { + pub nodes: (Keyword, Paren, StatementOrNull), } #[derive(Debug, Node)] -pub struct WaitStatementFork<'a> { - pub nodes: (Keyword<'a>, Keyword<'a>, Symbol<'a>), +pub struct WaitStatementFork { + pub nodes: (Keyword, Keyword, Symbol), } #[derive(Debug, Node)] -pub struct WaitStatementOrder<'a> { +pub struct WaitStatementOrder { pub nodes: ( - Keyword<'a>, - Paren<'a, List, HierarchicalIdentifier<'a>>>, - ActionBlock<'a>, + Keyword, + Paren>, + ActionBlock, ), } #[derive(Debug, Node)] -pub enum EventTrigger<'a> { - Named(EventTriggerNamed<'a>), - Nonblocking(EventTriggerNonblocking<'a>), +pub enum EventTrigger { + Named(EventTriggerNamed), + Nonblocking(EventTriggerNonblocking), } #[derive(Debug, Node)] -pub struct EventTriggerNamed<'a> { - pub nodes: (Symbol<'a>, HierarchicalEventIdentifier<'a>, Symbol<'a>), +pub struct EventTriggerNamed { + pub nodes: (Symbol, HierarchicalEventIdentifier, Symbol), } #[derive(Debug, Node)] -pub struct EventTriggerNonblocking<'a> { +pub struct EventTriggerNonblocking { pub nodes: ( - Symbol<'a>, - Option>, - HierarchicalEventIdentifier<'a>, - Symbol<'a>, + Symbol, + Option, + HierarchicalEventIdentifier, + Symbol, ), } #[derive(Debug, Node)] -pub enum DisableStatement<'a> { - Task(DisableStatementTask<'a>), - Block(DisableStatementBlock<'a>), - Fork(DisableStatementFork<'a>), +pub enum DisableStatement { + Task(DisableStatementTask), + Block(DisableStatementBlock), + Fork(DisableStatementFork), } #[derive(Debug, Node)] -pub struct DisableStatementTask<'a> { - pub nodes: (Keyword<'a>, HierarchicalTaskIdentifier<'a>, Symbol<'a>), +pub struct DisableStatementTask { + pub nodes: (Keyword, HierarchicalTaskIdentifier, Symbol), } #[derive(Debug, Node)] -pub struct DisableStatementBlock<'a> { - pub nodes: (Keyword<'a>, HierarchicalBlockIdentifier<'a>, Symbol<'a>), +pub struct DisableStatementBlock { + pub nodes: (Keyword, HierarchicalBlockIdentifier, Symbol), } #[derive(Debug, Node)] -pub struct DisableStatementFork<'a> { - pub nodes: (Keyword<'a>, Keyword<'a>, Symbol<'a>), +pub struct DisableStatementFork { + pub nodes: (Keyword, Keyword, Symbol), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/assertion_declarations.rs b/src/parser/declarations/assertion_declarations.rs index 5460966..6361dee 100644 --- a/src/parser/declarations/assertion_declarations.rs +++ b/src/parser/declarations/assertion_declarations.rs @@ -9,758 +9,662 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum ConcurrentAssertionItem<'a> { - Statement(ConcurrentAssertionItemStatement<'a>), - CheckerInstantiation(CheckerInstantiation<'a>), +pub enum ConcurrentAssertionItem { + Statement(ConcurrentAssertionItemStatement), + CheckerInstantiation(CheckerInstantiation), } #[derive(Debug, Node)] -pub struct ConcurrentAssertionItemStatement<'a> { +pub struct ConcurrentAssertionItemStatement { pub nodes: ( - Option<(BlockIdentifier<'a>, Symbol<'a>)>, - ConcurrentAssertionStatement<'a>, + Option<(BlockIdentifier, Symbol)>, + ConcurrentAssertionStatement, ), } #[derive(Debug, Node)] -pub enum ConcurrentAssertionStatement<'a> { - AssertPropertyStatement(AssertPropertyStatement<'a>), - AssumePropertyStatement(AssumePropertyStatement<'a>), - CoverPropertyStatement(CoverPropertyStatement<'a>), - CoverSequenceStatement(CoverSequenceStatement<'a>), - RestrictPropertyStatement(RestrictPropertyStatement<'a>), +pub enum ConcurrentAssertionStatement { + AssertPropertyStatement(AssertPropertyStatement), + AssumePropertyStatement(AssumePropertyStatement), + CoverPropertyStatement(CoverPropertyStatement), + CoverSequenceStatement(CoverSequenceStatement), + RestrictPropertyStatement(RestrictPropertyStatement), } #[derive(Debug, Node)] -pub struct AssertPropertyStatement<'a> { +pub struct AssertPropertyStatement { + pub nodes: (Keyword, Keyword, Paren, ActionBlock), +} + +#[derive(Debug, Node)] +pub struct AssumePropertyStatement { + pub nodes: (Keyword, Keyword, Paren, ActionBlock), +} + +#[derive(Debug, Node)] +pub struct CoverPropertyStatement { + pub nodes: (Keyword, Keyword, Paren, StatementOrNull), +} + +#[derive(Debug, Node)] +pub struct ExpectPropertyStatement { + pub nodes: (Keyword, Paren, ActionBlock), +} + +#[derive(Debug, Node)] +pub struct CoverSequenceStatement { pub nodes: ( - Keyword<'a>, - Keyword<'a>, - Paren<'a, PropertySpec<'a>>, - ActionBlock<'a>, - ), -} - -#[derive(Debug, Node)] -pub struct AssumePropertyStatement<'a> { - pub nodes: ( - Keyword<'a>, - Keyword<'a>, - Paren<'a, PropertySpec<'a>>, - ActionBlock<'a>, - ), -} - -#[derive(Debug, Node)] -pub struct CoverPropertyStatement<'a> { - pub nodes: ( - Keyword<'a>, - Keyword<'a>, - Paren<'a, PropertySpec<'a>>, - StatementOrNull<'a>, - ), -} - -#[derive(Debug, Node)] -pub struct ExpectPropertyStatement<'a> { - pub nodes: (Keyword<'a>, Paren<'a, PropertySpec<'a>>, ActionBlock<'a>), -} - -#[derive(Debug, Node)] -pub struct CoverSequenceStatement<'a> { - pub nodes: ( - Keyword<'a>, - Keyword<'a>, - Paren< - 'a, - ( - Option>, - Option<(Keyword<'a>, Keyword<'a>, Paren<'a, ExpressionOrDist<'a>>)>, - SequenceExpr<'a>, - ), - >, - StatementOrNull<'a>, - ), -} - -#[derive(Debug, Node)] -pub struct RestrictPropertyStatement<'a> { - pub nodes: ( - Keyword<'a>, - Keyword<'a>, - Paren<'a, PropertySpec<'a>>, - Symbol<'a>, - ), -} - -#[derive(Debug, Node)] -pub struct PropertyInstance<'a> { - pub nodes: ( - PsOrHierarchicalPropertyIdentifier<'a>, - Option>>>, - ), -} - -#[derive(Debug, Node)] -pub enum PropertyListOfArguments<'a> { - Ordered(PropertyListOfArgumentsOrdered<'a>), - Named(PropertyListOfArgumentsNamed<'a>), -} - -#[derive(Debug, Node)] -pub struct PropertyListOfArgumentsOrdered<'a> { - pub nodes: ( - List, Option>>, - Vec<( - Symbol<'a>, - Symbol<'a>, - Identifier<'a>, - Paren<'a, Option>>, + Keyword, + Keyword, + Paren<( + Option, + Option<(Keyword, Keyword, Paren)>, + SequenceExpr, )>, + StatementOrNull, ), } #[derive(Debug, Node)] -pub struct PropertyListOfArgumentsNamed<'a> { +pub struct RestrictPropertyStatement { + pub nodes: (Keyword, Keyword, Paren, Symbol), +} + +#[derive(Debug, Node)] +pub struct PropertyInstance { pub nodes: ( - List< - Symbol<'a>, - ( - Symbol<'a>, - Identifier<'a>, - Paren<'a, Option>>, - ), - >, + PsOrHierarchicalPropertyIdentifier, + Option>>, ), } #[derive(Debug, Node)] -pub enum PropertyActualArg<'a> { - PropertyExpr(PropertyExpr<'a>), - SequenceActualArg(SequenceActualArg<'a>), +pub enum PropertyListOfArguments { + Ordered(PropertyListOfArgumentsOrdered), + Named(PropertyListOfArgumentsNamed), } #[derive(Debug, Node)] -pub enum AssertionItemDeclaration<'a> { - PropertyDeclaration(PropertyDeclaration<'a>), - SequenceDeclaration(SequenceDeclaration<'a>), - LetDeclaration(LetDeclaration<'a>), -} - -#[derive(Debug, Node)] -pub struct PropertyDeclaration<'a> { +pub struct PropertyListOfArgumentsOrdered { pub nodes: ( - Keyword<'a>, - PropertyIdentifier<'a>, - Option>>>, - Symbol<'a>, - Vec>, - PropertySpec<'a>, - Option>, - Keyword<'a>, - Option<(Symbol<'a>, PropertyIdentifier<'a>)>, + List>, + Vec<(Symbol, Symbol, Identifier, Paren>)>, ), } #[derive(Debug, Node)] -pub struct PropertyPortList<'a> { - pub nodes: (List, PropertyPortItem<'a>>,), +pub struct PropertyListOfArgumentsNamed { + pub nodes: (List>)>,), } #[derive(Debug, Node)] -pub struct PropertyPortItem<'a> { +pub enum PropertyActualArg { + PropertyExpr(PropertyExpr), + SequenceActualArg(SequenceActualArg), +} + +#[derive(Debug, Node)] +pub enum AssertionItemDeclaration { + PropertyDeclaration(PropertyDeclaration), + SequenceDeclaration(SequenceDeclaration), + LetDeclaration(LetDeclaration), +} + +#[derive(Debug, Node)] +pub struct PropertyDeclaration { pub nodes: ( - Vec>, - Option<(Local<'a>, Option>)>, - Option>, - FormalPortIdentifier<'a>, - Vec>, - Option<(Symbol<'a>, PropertyActualArg<'a>)>, + Keyword, + PropertyIdentifier, + Option>>, + Symbol, + Vec, + PropertySpec, + Option, + Keyword, + Option<(Symbol, PropertyIdentifier)>, ), } #[derive(Debug, Node)] -pub enum PropertyLvarPortDirection<'a> { - Input(Keyword<'a>), +pub struct PropertyPortList { + pub nodes: (List,), } #[derive(Debug, Node)] -pub enum PropertyFormalType<'a> { - SequenceFormalType(SequenceFormalType<'a>), - Property(Keyword<'a>), -} - -#[derive(Debug, Node)] -pub struct PropertySpec<'a> { +pub struct PropertyPortItem { pub nodes: ( - Option>, - Option<(Keyword<'a>, Keyword<'a>, Paren<'a, ExpressionOrDist<'a>>)>, - PropertyExpr<'a>, + Vec, + Option<(Local, Option)>, + Option, + FormalPortIdentifier, + Vec, + Option<(Symbol, PropertyActualArg)>, ), } #[derive(Debug, Node)] -pub enum PropertyExpr<'a> { - SequenceExpr(SequenceExpr<'a>), - Strong(PropertyExprStrong<'a>), - Weak(PropertyExprWeak<'a>), - Paren(Box>), - Not(Box>), - Or(Box>), - And(Box>), - ImplicationOverlapped(Box>), - ImplicationNonoverlapped(Box>), - If(Box>), - Case(Box>), - FollowedByOverlapped(Box>), - FollowedByNonoverlapped(Box>), - Nexttime(Box>), - SNexttime(Box>), - Always(Box>), - SAlways(Box>), - Eventually(Box>), - SEventually(Box>), - Until(Box>), - SUntil(Box>), - UntilWith(Box>), - SUntilWith(Box>), - Implies(Box>), - Iff(Box>), - AcceptOn(Box>), - RejectOn(Box>), - SyncAcceptOn(Box>), - SyncRejectOn(Box>), - PropertyInstance(Box>), - ClockingEvent(Box>), +pub enum PropertyLvarPortDirection { + Input(Keyword), } #[derive(Debug, Node)] -pub struct PropertyExprStrong<'a> { - pub nodes: (Keyword<'a>, Paren<'a, SequenceExpr<'a>>), +pub enum PropertyFormalType { + SequenceFormalType(SequenceFormalType), + Property(Keyword), } #[derive(Debug, Node)] -pub struct PropertyExprWeak<'a> { - pub nodes: (Keyword<'a>, Paren<'a, SequenceExpr<'a>>), -} - -#[derive(Debug, Node)] -pub struct PropertyExprParen<'a> { - pub nodes: (Paren<'a, SequenceExpr<'a>>,), -} - -#[derive(Debug, Node)] -pub struct PropertyExprNot<'a> { - pub nodes: (Keyword<'a>, PropertyExpr<'a>), -} - -#[derive(Debug, Node)] -pub struct PropertyExprOr<'a> { - pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), -} - -#[derive(Debug, Node)] -pub struct PropertyExprAnd<'a> { - pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), -} - -#[derive(Debug, Node)] -pub struct PropertyExprImplicationOverlapped<'a> { - pub nodes: (SequenceExpr<'a>, Symbol<'a>, PropertyExpr<'a>), -} - -#[derive(Debug, Node)] -pub struct PropertyExprImplicationNonoverlapped<'a> { - pub nodes: (SequenceExpr<'a>, Symbol<'a>, PropertyExpr<'a>), -} - -#[derive(Debug, Node)] -pub struct PropertyExprIf<'a> { +pub struct PropertySpec { pub nodes: ( - Keyword<'a>, - Paren<'a, ExpressionOrDist<'a>>, - PropertyExpr<'a>, - Option<(Keyword<'a>, PropertyExpr<'a>)>, + Option, + Option<(Keyword, Keyword, Paren)>, + PropertyExpr, ), } #[derive(Debug, Node)] -pub struct PropertyExprCase<'a> { +pub enum PropertyExpr { + SequenceExpr(SequenceExpr), + Strong(PropertyExprStrong), + Weak(PropertyExprWeak), + Paren(Box), + Not(Box), + Or(Box), + And(Box), + ImplicationOverlapped(Box), + ImplicationNonoverlapped(Box), + If(Box), + Case(Box), + FollowedByOverlapped(Box), + FollowedByNonoverlapped(Box), + Nexttime(Box), + SNexttime(Box), + Always(Box), + SAlways(Box), + Eventually(Box), + SEventually(Box), + Until(Box), + SUntil(Box), + UntilWith(Box), + SUntilWith(Box), + Implies(Box), + Iff(Box), + AcceptOn(Box), + RejectOn(Box), + SyncAcceptOn(Box), + SyncRejectOn(Box), + PropertyInstance(Box), + ClockingEvent(Box), +} + +#[derive(Debug, Node)] +pub struct PropertyExprStrong { + pub nodes: (Keyword, Paren), +} + +#[derive(Debug, Node)] +pub struct PropertyExprWeak { + pub nodes: (Keyword, Paren), +} + +#[derive(Debug, Node)] +pub struct PropertyExprParen { + pub nodes: (Paren,), +} + +#[derive(Debug, Node)] +pub struct PropertyExprNot { + pub nodes: (Keyword, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprOr { + pub nodes: (PropertyExpr, Keyword, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprAnd { + pub nodes: (PropertyExpr, Keyword, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprImplicationOverlapped { + pub nodes: (SequenceExpr, Symbol, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprImplicationNonoverlapped { + pub nodes: (SequenceExpr, Symbol, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprIf { pub nodes: ( - Keyword<'a>, - Paren<'a, ExpressionOrDist<'a>>, - PropertyCaseItem<'a>, - Vec>, - Keyword<'a>, + Keyword, + Paren, + PropertyExpr, + Option<(Keyword, PropertyExpr)>, ), } #[derive(Debug, Node)] -pub struct PropertyExprFollowedByOverlapped<'a> { - pub nodes: (SequenceExpr<'a>, Symbol<'a>, PropertyExpr<'a>), -} - -#[derive(Debug, Node)] -pub struct PropertyExprFollowedByNonoverlapped<'a> { - pub nodes: (SequenceExpr<'a>, Symbol<'a>, PropertyExpr<'a>), -} - -#[derive(Debug, Node)] -pub struct PropertyExprNexttime<'a> { +pub struct PropertyExprCase { pub nodes: ( - Keyword<'a>, - Option>>, - PropertyExpr<'a>, + Keyword, + Paren, + PropertyCaseItem, + Vec, + Keyword, ), } #[derive(Debug, Node)] -pub struct PropertyExprSNexttime<'a> { +pub struct PropertyExprFollowedByOverlapped { + pub nodes: (SequenceExpr, Symbol, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprFollowedByNonoverlapped { + pub nodes: (SequenceExpr, Symbol, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprNexttime { + pub nodes: (Keyword, Option>, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprSNexttime { + pub nodes: (Keyword, Option>, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprAlways { pub nodes: ( - Keyword<'a>, - Option>>, - PropertyExpr<'a>, + Keyword, + Option>, + PropertyExpr, ), } #[derive(Debug, Node)] -pub struct PropertyExprAlways<'a> { +pub struct PropertyExprSAlways { pub nodes: ( - Keyword<'a>, - Option>>, - PropertyExpr<'a>, + Keyword, + Bracket, + PropertyExpr, ), } #[derive(Debug, Node)] -pub struct PropertyExprSAlways<'a> { +pub struct PropertyExprEventually { + pub nodes: (Keyword, Bracket, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprSEventually { pub nodes: ( - Keyword<'a>, - Bracket<'a, CycleDelayConstRangeExpression<'a>>, - PropertyExpr<'a>, + Keyword, + Option>, + PropertyExpr, ), } #[derive(Debug, Node)] -pub struct PropertyExprEventually<'a> { +pub struct PropertyExprUntil { + pub nodes: (PropertyExpr, Keyword, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprSUntil { + pub nodes: (PropertyExpr, Keyword, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprUntilWith { + pub nodes: (PropertyExpr, Keyword, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprSUntilWith { + pub nodes: (PropertyExpr, Keyword, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprImplies { + pub nodes: (PropertyExpr, Keyword, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprIff { + pub nodes: (PropertyExpr, Keyword, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprAcceptOn { + pub nodes: (Keyword, Paren, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprRejectOn { + pub nodes: (Keyword, Paren, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprSyncAcceptOn { + pub nodes: (Keyword, Paren, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprSyncRejectOn { + pub nodes: (Keyword, Paren, PropertyExpr), +} + +#[derive(Debug, Node)] +pub struct PropertyExprClockingEvent { + pub nodes: (ClockingEvent, PropertyExpr), +} + +#[derive(Debug, Node)] +pub enum PropertyCaseItem { + Nondefault(PropertyCaseItemNondefault), + Default(PropertyCaseItemDefault), +} + +#[derive(Debug, Node)] +pub struct PropertyCaseItemNondefault { + pub nodes: (List, Symbol, PropertyExpr, Symbol), +} + +#[derive(Debug, Node)] +pub struct PropertyCaseItemDefault { + pub nodes: (Keyword, Option, PropertyExpr, Symbol), +} + +#[derive(Debug, Node)] +pub struct SequenceDeclaration { pub nodes: ( - Keyword<'a>, - Bracket<'a, ConstantRange<'a>>, - PropertyExpr<'a>, + Keyword, + SequenceIdentifier, + Option>>, + Symbol, + Vec, + SequenceExpr, + Option, + Keyword, + Option<(Symbol, SequenceIdentifier)>, ), } #[derive(Debug, Node)] -pub struct PropertyExprSEventually<'a> { +pub struct SequencePortList { + pub nodes: (List,), +} + +#[derive(Debug, Node)] +pub struct SequencePortItem { pub nodes: ( - Keyword<'a>, - Option>>, - PropertyExpr<'a>, + Vec, + Option<(Local, Option)>, + Option, + FormalPortIdentifier, + Vec, + Option<(Symbol, SequenceActualArg)>, ), } #[derive(Debug, Node)] -pub struct PropertyExprUntil<'a> { - pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), +pub enum SequenceLvarPortDirection { + Input(Keyword), + Inout(Keyword), + Output(Keyword), } #[derive(Debug, Node)] -pub struct PropertyExprSUntil<'a> { - pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), +pub enum SequenceFormalType { + DataTypeOrImplicit(DataTypeOrImplicit), + Sequence(Keyword), + Untyped(Keyword), } #[derive(Debug, Node)] -pub struct PropertyExprUntilWith<'a> { - pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), +pub enum SequenceExpr { + CycleDelayExpr(Box), + ExprCycleDelayExpr(Box), + Expression(SequenceExprExpression), + Instance(Box), + Paren(Box), + And(Box), + Intersect(Box), + Or(Box), + FirstMatch(Box), + Throughout(Box), + Within(Box), + ClockingEvent(Box), } #[derive(Debug, Node)] -pub struct PropertyExprSUntilWith<'a> { - pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), -} - -#[derive(Debug, Node)] -pub struct PropertyExprImplies<'a> { - pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), -} - -#[derive(Debug, Node)] -pub struct PropertyExprIff<'a> { - pub nodes: (PropertyExpr<'a>, Keyword<'a>, PropertyExpr<'a>), -} - -#[derive(Debug, Node)] -pub struct PropertyExprAcceptOn<'a> { +pub struct SequenceExprCycleDelayExpr { pub nodes: ( - Keyword<'a>, - Paren<'a, ExpressionOrDist<'a>>, - PropertyExpr<'a>, + CycleDelayRange, + SequenceExpr, + Vec<(CycleDelayRange, SequenceExpr)>, ), } #[derive(Debug, Node)] -pub struct PropertyExprRejectOn<'a> { +pub struct SequenceExprExprCycleDelayExpr { pub nodes: ( - Keyword<'a>, - Paren<'a, ExpressionOrDist<'a>>, - PropertyExpr<'a>, + SequenceExpr, + CycleDelayRange, + SequenceExpr, + Vec<(CycleDelayRange, SequenceExpr)>, ), } #[derive(Debug, Node)] -pub struct PropertyExprSyncAcceptOn<'a> { +pub struct SequenceExprExpression { + pub nodes: (ExpressionOrDist, Option), +} + +#[derive(Debug, Node)] +pub struct SequenceExprInstance { + pub nodes: (SequenceInstance, Option), +} + +#[derive(Debug, Node)] +pub struct SequenceExprParen { pub nodes: ( - Keyword<'a>, - Paren<'a, ExpressionOrDist<'a>>, - PropertyExpr<'a>, + Paren<(SequenceExpr, Vec<(Symbol, SequenceMatchItem)>)>, + Option, ), } #[derive(Debug, Node)] -pub struct PropertyExprSyncRejectOn<'a> { +pub struct SequenceExprAnd { + pub nodes: (SequenceExpr, Keyword, SequenceExpr), +} + +#[derive(Debug, Node)] +pub struct SequenceExprIntersect { + pub nodes: (SequenceExpr, Keyword, SequenceExpr), +} + +#[derive(Debug, Node)] +pub struct SequenceExprOr { + pub nodes: (SequenceExpr, Keyword, SequenceExpr), +} + +#[derive(Debug, Node)] +pub struct SequenceExprFirstMatch { pub nodes: ( - Keyword<'a>, - Paren<'a, ExpressionOrDist<'a>>, - PropertyExpr<'a>, + Keyword, + Paren<(SequenceExpr, Vec<(Symbol, SequenceMatchItem)>)>, ), } #[derive(Debug, Node)] -pub struct PropertyExprClockingEvent<'a> { - pub nodes: (ClockingEvent<'a>, PropertyExpr<'a>), +pub struct SequenceExprThroughout { + pub nodes: (ExpressionOrDist, Keyword, SequenceExpr), } #[derive(Debug, Node)] -pub enum PropertyCaseItem<'a> { - Nondefault(PropertyCaseItemNondefault<'a>), - Default(PropertyCaseItemDefault<'a>), +pub struct SequenceExprWithin { + pub nodes: (SequenceExpr, Keyword, SequenceExpr), } #[derive(Debug, Node)] -pub struct PropertyCaseItemNondefault<'a> { +pub struct SequenceExprClockingEvent { + pub nodes: (ClockingEvent, SequenceExpr), +} + +#[derive(Debug, Node)] +pub enum CycleDelayRange { + Primary(CycleDelayRangePrimary), + Expression(CycleDelayRangeExpression), + Asterisk(CycleDelayRangeAsterisk), + Plus(CycleDelayRangePlus), +} + +#[derive(Debug, Node)] +pub struct CycleDelayRangePrimary { + pub nodes: (Symbol, ConstantPrimary), +} + +#[derive(Debug, Node)] +pub struct CycleDelayRangeExpression { + pub nodes: (Symbol, Bracket), +} + +#[derive(Debug, Node)] +pub struct CycleDelayRangeAsterisk { + pub nodes: (Symbol, Bracket), +} + +#[derive(Debug, Node)] +pub struct CycleDelayRangePlus { + pub nodes: (Symbol, Bracket), +} + +#[derive(Debug, Node)] +pub struct SequenceMethodCall { + pub nodes: (SequenceInstance, Symbol, MethodIdentifier), +} + +#[derive(Debug, Node)] +pub enum SequenceMatchItem { + OperatorAssignment(OperatorAssignment), + IncOrDecExpression(IncOrDecExpression), + SubroutineCall(SubroutineCall), +} + +#[derive(Debug, Node)] +pub struct SequenceInstance { pub nodes: ( - List, ExpressionOrDist<'a>>, - Symbol<'a>, - PropertyExpr<'a>, - Symbol<'a>, + PsOrHierarchicalSequenceIdentifier, + Option>>, ), } #[derive(Debug, Node)] -pub struct PropertyCaseItemDefault<'a> { +pub enum SequenceListOfArguments { + Ordered(SequenceListOfArgumentsOrdered), + Named(SequenceListOfArgumentsNamed), +} + +#[derive(Debug, Node)] +pub struct SequenceListOfArgumentsOrdered { pub nodes: ( - Keyword<'a>, - Option>, - PropertyExpr<'a>, - Symbol<'a>, + List>, + Vec<(Symbol, Symbol, Identifier, Paren>)>, ), } #[derive(Debug, Node)] -pub struct SequenceDeclaration<'a> { - pub nodes: ( - Keyword<'a>, - SequenceIdentifier<'a>, - Option>>>, - Symbol<'a>, - Vec>, - SequenceExpr<'a>, - Option>, - Keyword<'a>, - Option<(Symbol<'a>, SequenceIdentifier<'a>)>, - ), +pub struct SequenceListOfArgumentsNamed { + pub nodes: (List>)>,), } #[derive(Debug, Node)] -pub struct SequencePortList<'a> { - pub nodes: (List, SequencePortItem<'a>>,), +pub enum SequenceActualArg { + EventExpression(EventExpression), + SequenceExpr(SequenceExpr), } #[derive(Debug, Node)] -pub struct SequencePortItem<'a> { - pub nodes: ( - Vec>, - Option<(Local<'a>, Option>)>, - Option>, - FormalPortIdentifier<'a>, - Vec>, - Option<(Symbol<'a>, SequenceActualArg<'a>)>, - ), +pub enum BooleanAbbrev { + ConsecutiveRepetition(ConsecutiveRepetition), + NonConsecutiveRepetition(NonConsecutiveRepetition), + GotoRepetition(GotoRepetition), } #[derive(Debug, Node)] -pub enum SequenceLvarPortDirection<'a> { - Input(Keyword<'a>), - Inout(Keyword<'a>), - Output(Keyword<'a>), +pub struct SequenceAbbrev { + pub nodes: (ConsecutiveRepetition,), } #[derive(Debug, Node)] -pub enum SequenceFormalType<'a> { - DataTypeOrImplicit(DataTypeOrImplicit<'a>), - Sequence(Keyword<'a>), - Untyped(Keyword<'a>), +pub enum ConsecutiveRepetition { + Expression(ConsecutiveRepetitionExpression), + Asterisk(ConsecutiveRepetitionAsterisk), + Plus(ConsecutiveRepetitionPlus), } #[derive(Debug, Node)] -pub enum SequenceExpr<'a> { - CycleDelayExpr(Box>), - ExprCycleDelayExpr(Box>), - Expression(SequenceExprExpression<'a>), - Instance(Box>), - Paren(Box>), - And(Box>), - Intersect(Box>), - Or(Box>), - FirstMatch(Box>), - Throughout(Box>), - Within(Box>), - ClockingEvent(Box>), +pub struct ConsecutiveRepetitionExpression { + pub nodes: (Bracket<(Symbol, ConstOrRangeExpression)>,), } #[derive(Debug, Node)] -pub struct SequenceExprCycleDelayExpr<'a> { - pub nodes: ( - CycleDelayRange<'a>, - SequenceExpr<'a>, - Vec<(CycleDelayRange<'a>, SequenceExpr<'a>)>, - ), +pub struct ConsecutiveRepetitionAsterisk { + pub nodes: (Bracket,), } #[derive(Debug, Node)] -pub struct SequenceExprExprCycleDelayExpr<'a> { - pub nodes: ( - SequenceExpr<'a>, - CycleDelayRange<'a>, - SequenceExpr<'a>, - Vec<(CycleDelayRange<'a>, SequenceExpr<'a>)>, - ), +pub struct ConsecutiveRepetitionPlus { + pub nodes: (Bracket,), } #[derive(Debug, Node)] -pub struct SequenceExprExpression<'a> { - pub nodes: (ExpressionOrDist<'a>, Option>), +pub struct NonConsecutiveRepetition { + pub nodes: (Bracket<(Symbol, ConstOrRangeExpression)>,), } #[derive(Debug, Node)] -pub struct SequenceExprInstance<'a> { - pub nodes: (SequenceInstance<'a>, Option>), +pub struct GotoRepetition { + pub nodes: (Bracket<(Symbol, ConstOrRangeExpression)>,), } #[derive(Debug, Node)] -pub struct SequenceExprParen<'a> { - pub nodes: ( - Paren<'a, (SequenceExpr<'a>, Vec<(Symbol<'a>, SequenceMatchItem<'a>)>)>, - Option>, - ), +pub enum ConstOrRangeExpression { + ConstantExpression(ConstantExpression), + CycleDelayConstRangeExpression(CycleDelayConstRangeExpression), } #[derive(Debug, Node)] -pub struct SequenceExprAnd<'a> { - pub nodes: (SequenceExpr<'a>, Keyword<'a>, SequenceExpr<'a>), +pub enum CycleDelayConstRangeExpression { + Binary(CycleDelayConstRangeExpressionBinary), + Dollar(CycleDelayConstRangeExpressionDollar), } #[derive(Debug, Node)] -pub struct SequenceExprIntersect<'a> { - pub nodes: (SequenceExpr<'a>, Keyword<'a>, SequenceExpr<'a>), +pub struct CycleDelayConstRangeExpressionBinary { + pub nodes: (ConstantExpression, Symbol, ConstantExpression), } #[derive(Debug, Node)] -pub struct SequenceExprOr<'a> { - pub nodes: (SequenceExpr<'a>, Keyword<'a>, SequenceExpr<'a>), +pub struct CycleDelayConstRangeExpressionDollar { + pub nodes: (ConstantExpression, Symbol, Symbol), } #[derive(Debug, Node)] -pub struct SequenceExprFirstMatch<'a> { - pub nodes: ( - Keyword<'a>, - Paren<'a, (SequenceExpr<'a>, Vec<(Symbol<'a>, SequenceMatchItem<'a>)>)>, - ), +pub struct ExpressionOrDist { + pub nodes: (Expression, Option<(Keyword, Brace)>), } #[derive(Debug, Node)] -pub struct SequenceExprThroughout<'a> { - pub nodes: (ExpressionOrDist<'a>, Keyword<'a>, SequenceExpr<'a>), -} - -#[derive(Debug, Node)] -pub struct SequenceExprWithin<'a> { - pub nodes: (SequenceExpr<'a>, Keyword<'a>, SequenceExpr<'a>), -} - -#[derive(Debug, Node)] -pub struct SequenceExprClockingEvent<'a> { - pub nodes: (ClockingEvent<'a>, SequenceExpr<'a>), -} - -#[derive(Debug, Node)] -pub enum CycleDelayRange<'a> { - Primary(CycleDelayRangePrimary<'a>), - Expression(CycleDelayRangeExpression<'a>), - Asterisk(CycleDelayRangeAsterisk<'a>), - Plus(CycleDelayRangePlus<'a>), -} - -#[derive(Debug, Node)] -pub struct CycleDelayRangePrimary<'a> { - pub nodes: (Symbol<'a>, ConstantPrimary<'a>), -} - -#[derive(Debug, Node)] -pub struct CycleDelayRangeExpression<'a> { - pub nodes: (Symbol<'a>, Bracket<'a, CycleDelayConstRangeExpression<'a>>), -} - -#[derive(Debug, Node)] -pub struct CycleDelayRangeAsterisk<'a> { - pub nodes: (Symbol<'a>, Bracket<'a, Symbol<'a>>), -} - -#[derive(Debug, Node)] -pub struct CycleDelayRangePlus<'a> { - pub nodes: (Symbol<'a>, Bracket<'a, Symbol<'a>>), -} - -#[derive(Debug, Node)] -pub struct SequenceMethodCall<'a> { - pub nodes: (SequenceInstance<'a>, Symbol<'a>, MethodIdentifier<'a>), -} - -#[derive(Debug, Node)] -pub enum SequenceMatchItem<'a> { - OperatorAssignment(OperatorAssignment<'a>), - IncOrDecExpression(IncOrDecExpression<'a>), - SubroutineCall(SubroutineCall<'a>), -} - -#[derive(Debug, Node)] -pub struct SequenceInstance<'a> { - pub nodes: ( - PsOrHierarchicalSequenceIdentifier<'a>, - Option>>>, - ), -} - -#[derive(Debug, Node)] -pub enum SequenceListOfArguments<'a> { - Ordered(SequenceListOfArgumentsOrdered<'a>), - Named(SequenceListOfArgumentsNamed<'a>), -} - -#[derive(Debug, Node)] -pub struct SequenceListOfArgumentsOrdered<'a> { - pub nodes: ( - List, Option>>, - Vec<( - Symbol<'a>, - Symbol<'a>, - Identifier<'a>, - Paren<'a, Option>>, - )>, - ), -} - -#[derive(Debug, Node)] -pub struct SequenceListOfArgumentsNamed<'a> { - pub nodes: ( - List< - Symbol<'a>, - ( - Symbol<'a>, - Identifier<'a>, - Paren<'a, Option>>, - ), - >, - ), -} - -#[derive(Debug, Node)] -pub enum SequenceActualArg<'a> { - EventExpression(EventExpression<'a>), - SequenceExpr(SequenceExpr<'a>), -} - -#[derive(Debug, Node)] -pub enum BooleanAbbrev<'a> { - ConsecutiveRepetition(ConsecutiveRepetition<'a>), - NonConsecutiveRepetition(NonConsecutiveRepetition<'a>), - GotoRepetition(GotoRepetition<'a>), -} - -#[derive(Debug, Node)] -pub struct SequenceAbbrev<'a> { - pub nodes: (ConsecutiveRepetition<'a>,), -} - -#[derive(Debug, Node)] -pub enum ConsecutiveRepetition<'a> { - Expression(ConsecutiveRepetitionExpression<'a>), - Asterisk(ConsecutiveRepetitionAsterisk<'a>), - Plus(ConsecutiveRepetitionPlus<'a>), -} - -#[derive(Debug, Node)] -pub struct ConsecutiveRepetitionExpression<'a> { - pub nodes: (Bracket<'a, (Symbol<'a>, ConstOrRangeExpression<'a>)>,), -} - -#[derive(Debug, Node)] -pub struct ConsecutiveRepetitionAsterisk<'a> { - pub nodes: (Bracket<'a, Symbol<'a>>,), -} - -#[derive(Debug, Node)] -pub struct ConsecutiveRepetitionPlus<'a> { - pub nodes: (Bracket<'a, Symbol<'a>>,), -} - -#[derive(Debug, Node)] -pub struct NonConsecutiveRepetition<'a> { - pub nodes: (Bracket<'a, (Symbol<'a>, ConstOrRangeExpression<'a>)>,), -} - -#[derive(Debug, Node)] -pub struct GotoRepetition<'a> { - pub nodes: (Bracket<'a, (Symbol<'a>, ConstOrRangeExpression<'a>)>,), -} - -#[derive(Debug, Node)] -pub enum ConstOrRangeExpression<'a> { - ConstantExpression(ConstantExpression<'a>), - CycleDelayConstRangeExpression(CycleDelayConstRangeExpression<'a>), -} - -#[derive(Debug, Node)] -pub enum CycleDelayConstRangeExpression<'a> { - Binary(CycleDelayConstRangeExpressionBinary<'a>), - Dollar(CycleDelayConstRangeExpressionDollar<'a>), -} - -#[derive(Debug, Node)] -pub struct CycleDelayConstRangeExpressionBinary<'a> { - pub nodes: (ConstantExpression<'a>, Symbol<'a>, ConstantExpression<'a>), -} - -#[derive(Debug, Node)] -pub struct CycleDelayConstRangeExpressionDollar<'a> { - pub nodes: (ConstantExpression<'a>, Symbol<'a>, Symbol<'a>), -} - -#[derive(Debug, Node)] -pub struct ExpressionOrDist<'a> { - pub nodes: ( - Expression<'a>, - Option<(Keyword<'a>, Brace<'a, DistList<'a>>)>, - ), -} - -#[derive(Debug, Node)] -pub struct AssertionVariableDeclaration<'a> { - pub nodes: ( - VarDataType<'a>, - ListOfVariableDeclAssignments<'a>, - Symbol<'a>, - ), +pub struct AssertionVariableDeclaration { + pub nodes: (VarDataType, ListOfVariableDeclAssignments, Symbol), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/block_item_declarations.rs b/src/parser/declarations/block_item_declarations.rs index e820799..7920737 100644 --- a/src/parser/declarations/block_item_declarations.rs +++ b/src/parser/declarations/block_item_declarations.rs @@ -7,39 +7,39 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum BlockItemDeclaration<'a> { - Data(BlockItemDeclarationData<'a>), - LocalParameter(BlockItemDeclarationLocalParameter<'a>), - Parameter(BlockItemDeclarationParameter<'a>), - Let(BlockItemDeclarationLet<'a>), +pub enum BlockItemDeclaration { + Data(BlockItemDeclarationData), + LocalParameter(BlockItemDeclarationLocalParameter), + Parameter(BlockItemDeclarationParameter), + Let(BlockItemDeclarationLet), } #[derive(Debug, Node)] -pub struct BlockItemDeclarationData<'a> { - pub nodes: (Vec>, DataDeclaration<'a>), +pub struct BlockItemDeclarationData { + pub nodes: (Vec, DataDeclaration), } #[derive(Debug, Node)] -pub struct BlockItemDeclarationLocalParameter<'a> { +pub struct BlockItemDeclarationLocalParameter { pub nodes: ( - Vec>, - LocalParameterDeclaration<'a>, - Symbol<'a>, + Vec, + LocalParameterDeclaration, + Symbol, ), } #[derive(Debug, Node)] -pub struct BlockItemDeclarationParameter<'a> { +pub struct BlockItemDeclarationParameter { pub nodes: ( - Vec>, - ParameterDeclaration<'a>, - Symbol<'a>, + Vec, + ParameterDeclaration, + Symbol, ), } #[derive(Debug, Node)] -pub struct BlockItemDeclarationLet<'a> { - pub nodes: (Vec>, LetDeclaration<'a>), +pub struct BlockItemDeclarationLet { + pub nodes: (Vec, LetDeclaration), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/covergroup_declarations.rs b/src/parser/declarations/covergroup_declarations.rs index c38d9fc..f71bb78 100644 --- a/src/parser/declarations/covergroup_declarations.rs +++ b/src/parser/declarations/covergroup_declarations.rs @@ -9,514 +9,468 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct CovergroupDeclaration<'a> { +pub struct CovergroupDeclaration { pub nodes: ( - Keyword<'a>, - CovergroupIdentifier<'a>, - Option>>>, - Option>, - Symbol<'a>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, CovergroupIdentifier<'a>)>, + Keyword, + CovergroupIdentifier, + Option>>, + Option, + Symbol, + Vec, + Keyword, + Option<(Symbol, CovergroupIdentifier)>, ), } #[derive(Debug, Node)] -pub enum CoverageSpecOrOption<'a> { - Spec(CoverageSpecOrOptionSpec<'a>), - Option(CoverageSpecOrOptionOption<'a>), +pub enum CoverageSpecOrOption { + Spec(CoverageSpecOrOptionSpec), + Option(CoverageSpecOrOptionOption), } #[derive(Debug, Node)] -pub struct CoverageSpecOrOptionSpec<'a> { - pub nodes: (Vec>, CoverageSpec<'a>), +pub struct CoverageSpecOrOptionSpec { + pub nodes: (Vec, CoverageSpec), } #[derive(Debug, Node)] -pub struct CoverageSpecOrOptionOption<'a> { - pub nodes: (Vec>, CoverageOption<'a>, Symbol<'a>), +pub struct CoverageSpecOrOptionOption { + pub nodes: (Vec, CoverageOption, Symbol), } #[derive(Debug, Node)] -pub enum CoverageOption<'a> { - Option(CoverageOptionOption<'a>), - TypeOption(CoverageOptionTypeOption<'a>), +pub enum CoverageOption { + Option(CoverageOptionOption), + TypeOption(CoverageOptionTypeOption), } #[derive(Debug, Node)] -pub struct CoverageOptionOption<'a> { +pub struct CoverageOptionOption { + pub nodes: (Keyword, Symbol, MemberIdentifier, Symbol, Expression), +} + +#[derive(Debug, Node)] +pub struct CoverageOptionTypeOption { pub nodes: ( - Keyword<'a>, - Symbol<'a>, - MemberIdentifier<'a>, - Symbol<'a>, - Expression<'a>, + Keyword, + Symbol, + MemberIdentifier, + Symbol, + ConstantExpression, ), } #[derive(Debug, Node)] -pub struct CoverageOptionTypeOption<'a> { +pub enum CoverageSpec { + CoverPoint(CoverPoint), + CoverCross(CoverCross), +} + +#[derive(Debug, Node)] +pub enum CoverageEvent { + ClockingEvent(ClockingEvent), + Sample(CoverageEventSample), + At(CoverageEventAt), +} + +#[derive(Debug, Node)] +pub struct CoverageEventSample { + pub nodes: (Keyword, Keyword, Keyword, Paren>), +} + +#[derive(Debug, Node)] +pub struct CoverageEventAt { + pub nodes: (Symbol, Paren), +} + +#[derive(Debug, Node)] +pub enum BlockEventExpression { + Or(Box), + Begin(BlockEventExpressionBegin), + End(BlockEventExpressionEnd), +} + +#[derive(Debug, Node)] +pub struct BlockEventExpressionOr { + pub nodes: (BlockEventExpression, Keyword, BlockEventExpression), +} + +#[derive(Debug, Node)] +pub struct BlockEventExpressionBegin { + pub nodes: (Keyword, HierarchicalBtfIdentifier), +} + +#[derive(Debug, Node)] +pub struct BlockEventExpressionEnd { + pub nodes: (Keyword, HierarchicalBtfIdentifier), +} + +#[derive(Debug, Node)] +pub enum HierarchicalBtfIdentifier { + HierarchicalTfIdentifier(HierarchicalTfIdentifier), + HierarchicalBlockIdentifier(HierarchicalBlockIdentifier), + Method(HierarchicalBtfIdentifierMethod), +} + +#[derive(Debug, Node)] +pub struct HierarchicalBtfIdentifierMethod { + pub nodes: (Option, MethodIdentifier), +} + +#[derive(Debug, Node)] +pub enum HierarchicalIdentifierOrClassScope { + HierarchicalIdentifier((HierarchicalIdentifier, Symbol)), + ClassScope(ClassScope), +} + +#[derive(Debug, Node)] +pub struct CoverPoint { pub nodes: ( - Keyword<'a>, - Symbol<'a>, - MemberIdentifier<'a>, - Symbol<'a>, - ConstantExpression<'a>, + Option<(Option, CoverPointIdentifier, Symbol)>, + Keyword, + Expression, + Option<(Keyword, Paren)>, + BinsOrEmpty, ), } #[derive(Debug, Node)] -pub enum CoverageSpec<'a> { - CoverPoint(CoverPoint<'a>), - CoverCross(CoverCross<'a>), +pub enum BinsOrEmpty { + NonEmpty(BinsOrEmptyNonEmpty), + Empty(Symbol), } #[derive(Debug, Node)] -pub enum CoverageEvent<'a> { - ClockingEvent(ClockingEvent<'a>), - Sample(CoverageEventSample<'a>), - At(CoverageEventAt<'a>), +pub struct BinsOrEmptyNonEmpty { + pub nodes: (Brace<(Vec, Vec<(BinsOrOptions, Symbol)>)>,), } #[derive(Debug, Node)] -pub struct CoverageEventSample<'a> { +pub enum BinsOrOptions { + CoverageOption(CoverageOption), + Covergroup(BinsOrOptionsCovergroup), + CoverPoint(BinsOrOptionsCoverPoint), + SetCovergroup(BinsOrOptionsSetCovergroup), + TransList(BinsOrOptionsTransList), + Default(BinsOrOptionsDefault), + DefaultSequence(BinsOrOptionsDefaultSequence), +} + +#[derive(Debug, Node)] +pub struct BinsOrOptionsCovergroup { pub nodes: ( - Keyword<'a>, - Keyword<'a>, - Keyword<'a>, - Paren<'a, Option>>, + Option, + BinsKeyword, + BinIdentifier, + Option>>, + Symbol, + Brace, + Option<(Keyword, Paren)>, + Option<(Keyword, Paren)>, ), } #[derive(Debug, Node)] -pub struct CoverageEventAt<'a> { - pub nodes: (Symbol<'a>, Paren<'a, BlockEventExpression<'a>>), +pub struct Wildcard { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub enum BlockEventExpression<'a> { - Or(Box>), - Begin(BlockEventExpressionBegin<'a>), - End(BlockEventExpressionEnd<'a>), -} - -#[derive(Debug, Node)] -pub struct BlockEventExpressionOr<'a> { +pub struct BinsOrOptionsCoverPoint { pub nodes: ( - BlockEventExpression<'a>, - Keyword<'a>, - BlockEventExpression<'a>, + Option, + BinsKeyword, + BinIdentifier, + Option>>, + Symbol, + CoverPointIdentifier, + Keyword, + Paren, + Option<(Keyword, Paren)>, ), } #[derive(Debug, Node)] -pub struct BlockEventExpressionBegin<'a> { - pub nodes: (Keyword<'a>, HierarchicalBtfIdentifier<'a>), -} - -#[derive(Debug, Node)] -pub struct BlockEventExpressionEnd<'a> { - pub nodes: (Keyword<'a>, HierarchicalBtfIdentifier<'a>), -} - -#[derive(Debug, Node)] -pub enum HierarchicalBtfIdentifier<'a> { - HierarchicalTfIdentifier(HierarchicalTfIdentifier<'a>), - HierarchicalBlockIdentifier(HierarchicalBlockIdentifier<'a>), - Method(HierarchicalBtfIdentifierMethod<'a>), -} - -#[derive(Debug, Node)] -pub struct HierarchicalBtfIdentifierMethod<'a> { +pub struct BinsOrOptionsSetCovergroup { pub nodes: ( - Option>, - MethodIdentifier<'a>, + Option, + BinsKeyword, + BinIdentifier, + Option>>, + Symbol, + SetCovergroupExpression, + Option<(Keyword, Paren)>, ), } #[derive(Debug, Node)] -pub enum HierarchicalIdentifierOrClassScope<'a> { - HierarchicalIdentifier((HierarchicalIdentifier<'a>, Symbol<'a>)), - ClassScope(ClassScope<'a>), -} - -#[derive(Debug, Node)] -pub struct CoverPoint<'a> { +pub struct BinsOrOptionsTransList { pub nodes: ( - Option<( - Option>, - CoverPointIdentifier<'a>, - Symbol<'a>, - )>, - Keyword<'a>, - Expression<'a>, - Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, - BinsOrEmpty<'a>, + Option, + BinsKeyword, + BinIdentifier, + Option<(Symbol, Symbol)>, + Symbol, + TransList, + Option<(Keyword, Paren)>, ), } #[derive(Debug, Node)] -pub enum BinsOrEmpty<'a> { - NonEmpty(BinsOrEmptyNonEmpty<'a>), - Empty(Symbol<'a>), -} - -#[derive(Debug, Node)] -pub struct BinsOrEmptyNonEmpty<'a> { +pub struct BinsOrOptionsDefault { pub nodes: ( - Brace< - 'a, - ( - Vec>, - Vec<(BinsOrOptions<'a>, Symbol<'a>)>, - ), - >, + BinsKeyword, + BinIdentifier, + Option>>, + Symbol, + Keyword, + Option<(Keyword, Paren)>, ), } #[derive(Debug, Node)] -pub enum BinsOrOptions<'a> { - CoverageOption(CoverageOption<'a>), - Covergroup(BinsOrOptionsCovergroup<'a>), - CoverPoint(BinsOrOptionsCoverPoint<'a>), - SetCovergroup(BinsOrOptionsSetCovergroup<'a>), - TransList(BinsOrOptionsTransList<'a>), - Default(BinsOrOptionsDefault<'a>), - DefaultSequence(BinsOrOptionsDefaultSequence<'a>), -} - -#[derive(Debug, Node)] -pub struct BinsOrOptionsCovergroup<'a> { +pub struct BinsOrOptionsDefaultSequence { pub nodes: ( - Option>, - BinsKeyword<'a>, - BinIdentifier<'a>, - Option>>>, - Symbol<'a>, - Brace<'a, CovergroupRangeList<'a>>, - Option<(Keyword<'a>, Paren<'a, WithCovergroupExpression<'a>>)>, - Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, + BinsKeyword, + BinIdentifier, + Symbol, + Keyword, + Keyword, + Option<(Keyword, Paren)>, ), } #[derive(Debug, Node)] -pub struct Wildcard<'a> { - pub nodes: (Keyword<'a>,), +pub enum BinsKeyword { + Bins(Keyword), + IllegalBins(Keyword), + IgnoreBins(Keyword), } #[derive(Debug, Node)] -pub struct BinsOrOptionsCoverPoint<'a> { +pub struct TransList { + pub nodes: (List>,), +} + +#[derive(Debug, Node)] +pub struct TransSet { + pub nodes: (List,), +} + +#[derive(Debug, Node)] +pub enum TransRangeList { + TransItem(TransItem), + Asterisk(TransRangeListAsterisk), + Arrow(TransRangeListArrow), + Equal(TransRangeListEqual), +} + +#[derive(Debug, Node)] +pub struct TransRangeListAsterisk { + pub nodes: (TransItem, Bracket<(Symbol, RepeatRange)>), +} + +#[derive(Debug, Node)] +pub struct TransRangeListArrow { + pub nodes: (TransItem, Bracket<(Symbol, RepeatRange)>), +} + +#[derive(Debug, Node)] +pub struct TransRangeListEqual { + pub nodes: (TransItem, Bracket<(Symbol, RepeatRange)>), +} + +#[derive(Debug, Node)] +pub struct TransItem { + pub nodes: (CovergroupRangeList,), +} + +#[derive(Debug, Node)] +pub enum RepeatRange { + CovergroupExpression(CovergroupExpression), + Binary(RepeatRangeBinary), +} + +#[derive(Debug, Node)] +pub struct RepeatRangeBinary { + pub nodes: (CovergroupExpression, Symbol, CovergroupExpression), +} + +#[derive(Debug, Node)] +pub struct CoverCross { pub nodes: ( - Option>, - BinsKeyword<'a>, - BinIdentifier<'a>, - Option>>>, - Symbol<'a>, - CoverPointIdentifier<'a>, - Keyword<'a>, - Paren<'a, WithCovergroupExpression<'a>>, - Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, + Option<(CrossIdentifier, Symbol)>, + Keyword, + ListOfCrossItems, + Option<(Keyword, Paren)>, + CrossBody, ), } #[derive(Debug, Node)] -pub struct BinsOrOptionsSetCovergroup<'a> { +pub struct ListOfCrossItems { + pub nodes: (CrossItem, List), +} + +#[derive(Debug, Node)] +pub enum CrossItem { + CoverPointIdentifier(CoverPointIdentifier), + VariableIdentifier(VariableIdentifier), +} + +#[derive(Debug, Node)] +pub enum CrossBody { + NonEmpty(CrossBodyNonEmpty), + Empty(Symbol), +} + +#[derive(Debug, Node)] +pub struct CrossBodyNonEmpty { + pub nodes: (Brace>,), +} + +#[derive(Debug, Node)] +pub enum CrossBodyItem { + FunctionDeclaration(FunctionDeclaration), + BinsSelectionOrOption((BinsSelectionOrOption, Symbol)), +} + +#[derive(Debug, Node)] +pub enum BinsSelectionOrOption { + Coverage(BinsSelectionOrOptionCoverage), + Bins(BinsSelectionOrOptionBins), +} + +#[derive(Debug, Node)] +pub struct BinsSelectionOrOptionCoverage { + pub nodes: (Vec, CoverageOption), +} + +#[derive(Debug, Node)] +pub struct BinsSelectionOrOptionBins { + pub nodes: (Vec, BinsSelection), +} + +#[derive(Debug, Node)] +pub struct BinsSelection { pub nodes: ( - Option>, - BinsKeyword<'a>, - BinIdentifier<'a>, - Option>>>, - Symbol<'a>, - SetCovergroupExpression<'a>, - Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, + BinsKeyword, + BinIdentifier, + Symbol, + SelectExpression, + Option<(Keyword, Paren)>, ), } #[derive(Debug, Node)] -pub struct BinsOrOptionsTransList<'a> { +pub enum SelectExpression { + SelectCondition(SelectCondition), + Not(SelectExpressionNot), + And(Box), + Or(Box), + Paren(Box), + With(Box), + CrossIdentifier(CrossIdentifier), + CrossSet(SelectExpressionCrossSet), +} + +#[derive(Debug, Node)] +pub struct SelectExpressionNot { + pub nodes: (Symbol, SelectCondition), +} + +#[derive(Debug, Node)] +pub struct SelectExpressionAnd { + pub nodes: (SelectExpression, Symbol, SelectExpression), +} + +#[derive(Debug, Node)] +pub struct SelectExpressionOr { + pub nodes: (SelectExpression, Symbol, SelectExpression), +} + +#[derive(Debug, Node)] +pub struct SelectExpressionParen { + pub nodes: (Paren,), +} + +#[derive(Debug, Node)] +pub struct SelectExpressionWith { pub nodes: ( - Option>, - BinsKeyword<'a>, - BinIdentifier<'a>, - Option<(Symbol<'a>, Symbol<'a>)>, - Symbol<'a>, - TransList<'a>, - Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, + SelectExpression, + Keyword, + Paren, + Option<(Keyword, IntegerCovergroupExpression)>, ), } #[derive(Debug, Node)] -pub struct BinsOrOptionsDefault<'a> { +pub struct SelectExpressionCrossSet { pub nodes: ( - BinsKeyword<'a>, - BinIdentifier<'a>, - Option>>>, - Symbol<'a>, - Keyword<'a>, - Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, + CrossSetExpression, + Option<(Keyword, IntegerCovergroupExpression)>, ), } #[derive(Debug, Node)] -pub struct BinsOrOptionsDefaultSequence<'a> { +pub struct SelectCondition { pub nodes: ( - BinsKeyword<'a>, - BinIdentifier<'a>, - Symbol<'a>, - Keyword<'a>, - Keyword<'a>, - Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, + Keyword, + Paren, + Option<(Keyword, Brace)>, ), } #[derive(Debug, Node)] -pub enum BinsKeyword<'a> { - Bins(Keyword<'a>), - IllegalBins(Keyword<'a>), - IgnoreBins(Keyword<'a>), +pub enum BinsExpression { + VariableIdentifier(VariableIdentifier), + CoverPoint(BinsExpressionCoverPoint), } #[derive(Debug, Node)] -pub struct TransList<'a> { - pub nodes: (List, Paren<'a, TransSet<'a>>>,), +pub struct BinsExpressionCoverPoint { + pub nodes: (CoverPointIdentifier, Option<(Symbol, BinIdentifier)>), } #[derive(Debug, Node)] -pub struct TransSet<'a> { - pub nodes: (List, TransRangeList<'a>>,), +pub struct CovergroupRangeList { + pub nodes: (List,), } #[derive(Debug, Node)] -pub enum TransRangeList<'a> { - TransItem(TransItem<'a>), - Asterisk(TransRangeListAsterisk<'a>), - Arrow(TransRangeListArrow<'a>), - Equal(TransRangeListEqual<'a>), +pub enum CovergroupValueRange { + CovergroupExpression(CovergroupExpression), + Binary(CovergroupValueRangeBinary), } #[derive(Debug, Node)] -pub struct TransRangeListAsterisk<'a> { - pub nodes: (TransItem<'a>, Bracket<'a, (Symbol<'a>, RepeatRange<'a>)>), +pub struct CovergroupValueRangeBinary { + pub nodes: (Bracket<(CovergroupExpression, Symbol, CovergroupExpression)>,), } #[derive(Debug, Node)] -pub struct TransRangeListArrow<'a> { - pub nodes: (TransItem<'a>, Bracket<'a, (Symbol<'a>, RepeatRange<'a>)>), +pub struct WithCovergroupExpression { + pub nodes: (CovergroupExpression,), } #[derive(Debug, Node)] -pub struct TransRangeListEqual<'a> { - pub nodes: (TransItem<'a>, Bracket<'a, (Symbol<'a>, RepeatRange<'a>)>), +pub struct SetCovergroupExpression { + pub nodes: (CovergroupExpression,), } #[derive(Debug, Node)] -pub struct TransItem<'a> { - pub nodes: (CovergroupRangeList<'a>,), +pub struct IntegerCovergroupExpression { + pub nodes: (CovergroupExpression,), } #[derive(Debug, Node)] -pub enum RepeatRange<'a> { - CovergroupExpression(CovergroupExpression<'a>), - Binary(RepeatRangeBinary<'a>), +pub struct CrossSetExpression { + pub nodes: (CovergroupExpression,), } #[derive(Debug, Node)] -pub struct RepeatRangeBinary<'a> { - pub nodes: ( - CovergroupExpression<'a>, - Symbol<'a>, - CovergroupExpression<'a>, - ), -} - -#[derive(Debug, Node)] -pub struct CoverCross<'a> { - pub nodes: ( - Option<(CrossIdentifier<'a>, Symbol<'a>)>, - Keyword<'a>, - ListOfCrossItems<'a>, - Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, - CrossBody<'a>, - ), -} - -#[derive(Debug, Node)] -pub struct ListOfCrossItems<'a> { - pub nodes: (CrossItem<'a>, List, CrossItem<'a>>), -} - -#[derive(Debug, Node)] -pub enum CrossItem<'a> { - CoverPointIdentifier(CoverPointIdentifier<'a>), - VariableIdentifier(VariableIdentifier<'a>), -} - -#[derive(Debug, Node)] -pub enum CrossBody<'a> { - NonEmpty(CrossBodyNonEmpty<'a>), - Empty(Symbol<'a>), -} - -#[derive(Debug, Node)] -pub struct CrossBodyNonEmpty<'a> { - pub nodes: (Brace<'a, Vec<(CrossBodyItem<'a>, Symbol<'a>)>>,), -} - -#[derive(Debug, Node)] -pub enum CrossBodyItem<'a> { - FunctionDeclaration(FunctionDeclaration<'a>), - BinsSelectionOrOption((BinsSelectionOrOption<'a>, Symbol<'a>)), -} - -#[derive(Debug, Node)] -pub enum BinsSelectionOrOption<'a> { - Coverage(BinsSelectionOrOptionCoverage<'a>), - Bins(BinsSelectionOrOptionBins<'a>), -} - -#[derive(Debug, Node)] -pub struct BinsSelectionOrOptionCoverage<'a> { - pub nodes: (Vec>, CoverageOption<'a>), -} - -#[derive(Debug, Node)] -pub struct BinsSelectionOrOptionBins<'a> { - pub nodes: (Vec>, BinsSelection<'a>), -} - -#[derive(Debug, Node)] -pub struct BinsSelection<'a> { - pub nodes: ( - BinsKeyword<'a>, - BinIdentifier<'a>, - Symbol<'a>, - SelectExpression<'a>, - Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, - ), -} - -#[derive(Debug, Node)] -pub enum SelectExpression<'a> { - SelectCondition(SelectCondition<'a>), - Not(SelectExpressionNot<'a>), - And(Box>), - Or(Box>), - Paren(Box>), - With(Box>), - CrossIdentifier(CrossIdentifier<'a>), - CrossSet(SelectExpressionCrossSet<'a>), -} - -#[derive(Debug, Node)] -pub struct SelectExpressionNot<'a> { - pub nodes: (Symbol<'a>, SelectCondition<'a>), -} - -#[derive(Debug, Node)] -pub struct SelectExpressionAnd<'a> { - pub nodes: (SelectExpression<'a>, Symbol<'a>, SelectExpression<'a>), -} - -#[derive(Debug, Node)] -pub struct SelectExpressionOr<'a> { - pub nodes: (SelectExpression<'a>, Symbol<'a>, SelectExpression<'a>), -} - -#[derive(Debug, Node)] -pub struct SelectExpressionParen<'a> { - pub nodes: (Paren<'a, SelectExpression<'a>>,), -} - -#[derive(Debug, Node)] -pub struct SelectExpressionWith<'a> { - pub nodes: ( - SelectExpression<'a>, - Keyword<'a>, - Paren<'a, WithCovergroupExpression<'a>>, - Option<(Keyword<'a>, IntegerCovergroupExpression<'a>)>, - ), -} - -#[derive(Debug, Node)] -pub struct SelectExpressionCrossSet<'a> { - pub nodes: ( - CrossSetExpression<'a>, - Option<(Keyword<'a>, IntegerCovergroupExpression<'a>)>, - ), -} - -#[derive(Debug, Node)] -pub struct SelectCondition<'a> { - pub nodes: ( - Keyword<'a>, - Paren<'a, BinsExpression<'a>>, - Option<(Keyword<'a>, Brace<'a, CovergroupRangeList<'a>>)>, - ), -} - -#[derive(Debug, Node)] -pub enum BinsExpression<'a> { - VariableIdentifier(VariableIdentifier<'a>), - CoverPoint(BinsExpressionCoverPoint<'a>), -} - -#[derive(Debug, Node)] -pub struct BinsExpressionCoverPoint<'a> { - pub nodes: ( - CoverPointIdentifier<'a>, - Option<(Symbol<'a>, BinIdentifier<'a>)>, - ), -} - -#[derive(Debug, Node)] -pub struct CovergroupRangeList<'a> { - pub nodes: (List, CovergroupValueRange<'a>>,), -} - -#[derive(Debug, Node)] -pub enum CovergroupValueRange<'a> { - CovergroupExpression(CovergroupExpression<'a>), - Binary(CovergroupValueRangeBinary<'a>), -} - -#[derive(Debug, Node)] -pub struct CovergroupValueRangeBinary<'a> { - pub nodes: ( - Bracket< - 'a, - ( - CovergroupExpression<'a>, - Symbol<'a>, - CovergroupExpression<'a>, - ), - >, - ), -} - -#[derive(Debug, Node)] -pub struct WithCovergroupExpression<'a> { - pub nodes: (CovergroupExpression<'a>,), -} - -#[derive(Debug, Node)] -pub struct SetCovergroupExpression<'a> { - pub nodes: (CovergroupExpression<'a>,), -} - -#[derive(Debug, Node)] -pub struct IntegerCovergroupExpression<'a> { - pub nodes: (CovergroupExpression<'a>,), -} - -#[derive(Debug, Node)] -pub struct CrossSetExpression<'a> { - pub nodes: (CovergroupExpression<'a>,), -} - -#[derive(Debug, Node)] -pub struct CovergroupExpression<'a> { - pub nodes: (Expression<'a>,), +pub struct CovergroupExpression { + pub nodes: (Expression,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/declaration_assignments.rs b/src/parser/declarations/declaration_assignments.rs index 62d0811..1c71663 100644 --- a/src/parser/declarations/declaration_assignments.rs +++ b/src/parser/declarations/declaration_assignments.rs @@ -9,167 +9,140 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct DefparamAssignment<'a> { +pub struct DefparamAssignment { pub nodes: ( - HierarchicalParameterIdentifier<'a>, - Symbol<'a>, - ConstantMintypmaxExpression<'a>, + HierarchicalParameterIdentifier, + Symbol, + ConstantMintypmaxExpression, ), } #[derive(Debug, Node)] -pub struct NetDeclAssignment<'a> { +pub struct NetDeclAssignment { pub nodes: ( - NetIdentifier<'a>, - Vec>, - Option<(Symbol<'a>, Expression<'a>)>, + NetIdentifier, + Vec, + Option<(Symbol, Expression)>, ), } #[derive(Debug, Node)] -pub struct ParamAssignment<'a> { +pub struct ParamAssignment { pub nodes: ( - ParameterIdentifier<'a>, - Vec>, - Option<(Symbol<'a>, ConstantParamExpression<'a>)>, + ParameterIdentifier, + Vec, + Option<(Symbol, ConstantParamExpression)>, ), } #[derive(Debug, Node)] -pub enum SpecparamAssignment<'a> { - Mintypmax(SpecparamAssignmentMintypmax<'a>), - PulseControlSpecparam(PulseControlSpecparam<'a>), +pub enum SpecparamAssignment { + Mintypmax(SpecparamAssignmentMintypmax), + PulseControlSpecparam(PulseControlSpecparam), } #[derive(Debug, Node)] -pub struct SpecparamAssignmentMintypmax<'a> { +pub struct SpecparamAssignmentMintypmax { + pub nodes: (SpecparamIdentifier, Symbol, ConstantMintypmaxExpression), +} + +#[derive(Debug, Node)] +pub struct TypeAssignment { + pub nodes: (TypeIdentifier, Option<(Symbol, DataType)>), +} + +#[derive(Debug, Node)] +pub enum PulseControlSpecparam { + WithoutDescriptor(PulseControlSpecparamWithoutDescriptor), + WithDescriptor(PulseControlSpecparamWithDescriptor), +} + +#[derive(Debug, Node)] +pub struct PulseControlSpecparamWithoutDescriptor { pub nodes: ( - SpecparamIdentifier<'a>, - Symbol<'a>, - ConstantMintypmaxExpression<'a>, + Symbol, + Symbol, + Paren<(RejectLimitValue, Option<(Symbol, ErrorLimitValue)>)>, ), } #[derive(Debug, Node)] -pub struct TypeAssignment<'a> { - pub nodes: (TypeIdentifier<'a>, Option<(Symbol<'a>, DataType<'a>)>), -} - -#[derive(Debug, Node)] -pub enum PulseControlSpecparam<'a> { - WithoutDescriptor(PulseControlSpecparamWithoutDescriptor<'a>), - WithDescriptor(PulseControlSpecparamWithDescriptor<'a>), -} - -#[derive(Debug, Node)] -pub struct PulseControlSpecparamWithoutDescriptor<'a> { +pub struct PulseControlSpecparamWithDescriptor { pub nodes: ( - Symbol<'a>, - Symbol<'a>, - Paren< - 'a, - ( - RejectLimitValue<'a>, - Option<(Symbol<'a>, ErrorLimitValue<'a>)>, - ), - >, + Symbol, + SpecifyInputTerminalDescriptor, + Symbol, + SpecifyOutputTerminalDescriptor, + Symbol, + Paren<(RejectLimitValue, Option<(Symbol, ErrorLimitValue)>)>, ), } #[derive(Debug, Node)] -pub struct PulseControlSpecparamWithDescriptor<'a> { +pub struct ErrorLimitValue { + pub nodes: (LimitValue,), +} + +#[derive(Debug, Node)] +pub struct RejectLimitValue { + pub nodes: (LimitValue,), +} + +#[derive(Debug, Node)] +pub struct LimitValue { + pub nodes: (ConstantMintypmaxExpression,), +} + +#[derive(Debug, Node)] +pub enum VariableDeclAssignment { + Variable(VariableDeclAssignmentVariable), + DynamicArray(VariableDeclAssignmentDynamicArray), + Class(VariableDeclAssignmentClass), +} + +#[derive(Debug, Node)] +pub struct VariableDeclAssignmentVariable { pub nodes: ( - Symbol<'a>, - SpecifyInputTerminalDescriptor<'a>, - Symbol<'a>, - SpecifyOutputTerminalDescriptor<'a>, - Symbol<'a>, - Paren< - 'a, - ( - RejectLimitValue<'a>, - Option<(Symbol<'a>, ErrorLimitValue<'a>)>, - ), - >, + VariableIdentifier, + Vec, + Option<(Symbol, Expression)>, ), } #[derive(Debug, Node)] -pub struct ErrorLimitValue<'a> { - pub nodes: (LimitValue<'a>,), -} - -#[derive(Debug, Node)] -pub struct RejectLimitValue<'a> { - pub nodes: (LimitValue<'a>,), -} - -#[derive(Debug, Node)] -pub struct LimitValue<'a> { - pub nodes: (ConstantMintypmaxExpression<'a>,), -} - -#[derive(Debug, Node)] -pub enum VariableDeclAssignment<'a> { - Variable(VariableDeclAssignmentVariable<'a>), - DynamicArray(VariableDeclAssignmentDynamicArray<'a>), - Class(VariableDeclAssignmentClass<'a>), -} - -#[derive(Debug, Node)] -pub struct VariableDeclAssignmentVariable<'a> { +pub struct VariableDeclAssignmentDynamicArray { pub nodes: ( - VariableIdentifier<'a>, - Vec>, - Option<(Symbol<'a>, Expression<'a>)>, + DynamicArrayVariableIdentifier, + UnsizedDimension, + Vec, + Option<(Symbol, DynamicArrayNew)>, ), } #[derive(Debug, Node)] -pub struct VariableDeclAssignmentDynamicArray<'a> { - pub nodes: ( - DynamicArrayVariableIdentifier<'a>, - UnsizedDimension<'a>, - Vec>, - Option<(Symbol<'a>, DynamicArrayNew<'a>)>, - ), +pub struct VariableDeclAssignmentClass { + pub nodes: (ClassVariableIdentifier, Option<(Symbol, ClassNew)>), } #[derive(Debug, Node)] -pub struct VariableDeclAssignmentClass<'a> { - pub nodes: ( - ClassVariableIdentifier<'a>, - Option<(Symbol<'a>, ClassNew<'a>)>, - ), +pub enum ClassNew { + Argument(ClassNewArgument), + Expression(ClassNewExpression), } #[derive(Debug, Node)] -pub enum ClassNew<'a> { - Argument(ClassNewArgument<'a>), - Expression(ClassNewExpression<'a>), +pub struct ClassNewArgument { + pub nodes: (Option, Keyword, Option>), } #[derive(Debug, Node)] -pub struct ClassNewArgument<'a> { - pub nodes: ( - Option>, - Keyword<'a>, - Option>>, - ), +pub struct ClassNewExpression { + pub nodes: (Keyword, Expression), } #[derive(Debug, Node)] -pub struct ClassNewExpression<'a> { - pub nodes: (Keyword<'a>, Expression<'a>), -} - -#[derive(Debug, Node)] -pub struct DynamicArrayNew<'a> { - pub nodes: ( - Keyword<'a>, - Bracket<'a, Expression<'a>>, - Option>>, - ), +pub struct DynamicArrayNew { + pub nodes: (Keyword, Bracket, Option>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/declaration_lists.rs b/src/parser/declarations/declaration_lists.rs index 7692de7..2320fe2 100644 --- a/src/parser/declarations/declaration_lists.rs +++ b/src/parser/declarations/declaration_lists.rs @@ -8,83 +8,83 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct ListOfDefparamAssignments<'a> { - pub nodes: (List, DefparamAssignment<'a>>,), +pub struct ListOfDefparamAssignments { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ListOfGenvarIdentifiers<'a> { - pub nodes: (List, GenvarIdentifier<'a>>,), +pub struct ListOfGenvarIdentifiers { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ListOfInterfaceIdentifiers<'a> { - pub nodes: (List, (InterfaceIdentifier<'a>, Vec>)>,), +pub struct ListOfInterfaceIdentifiers { + pub nodes: (List)>,), } #[derive(Debug, Node)] -pub struct ListOfNetDeclAssignments<'a> { - pub nodes: (List, NetDeclAssignment<'a>>,), +pub struct ListOfNetDeclAssignments { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ListOfParamAssignments<'a> { - pub nodes: (List, ParamAssignment<'a>>,), +pub struct ListOfParamAssignments { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ListOfPortIdentifiers<'a> { - pub nodes: (List, (PortIdentifier<'a>, Vec>)>,), +pub struct ListOfPortIdentifiers { + pub nodes: (List)>,), } #[derive(Debug, Node)] -pub struct ListOfUdpPortIdentifiers<'a> { - pub nodes: (List, PortIdentifier<'a>>,), +pub struct ListOfUdpPortIdentifiers { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ListOfSpecparamAssignments<'a> { - pub nodes: (List, SpecparamAssignment<'a>>,), +pub struct ListOfSpecparamAssignments { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ListOfTfVariableIdentifiers<'a> { +pub struct ListOfTfVariableIdentifiers { pub nodes: ( List< - Symbol<'a>, + Symbol, ( - PortIdentifier<'a>, - Vec>, - Option<(Symbol<'a>, Expression<'a>)>, + PortIdentifier, + Vec, + Option<(Symbol, Expression)>, ), >, ), } #[derive(Debug, Node)] -pub struct ListOfTypeAssignments<'a> { - pub nodes: (List, TypeAssignment<'a>>,), +pub struct ListOfTypeAssignments { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ListOfVariableDeclAssignments<'a> { - pub nodes: (List, VariableDeclAssignment<'a>>,), +pub struct ListOfVariableDeclAssignments { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ListOfVariableIdentifiers<'a> { - pub nodes: (List, (VariableIdentifier<'a>, Vec>)>,), +pub struct ListOfVariableIdentifiers { + pub nodes: (List)>,), } #[derive(Debug, Node)] -pub struct ListOfVariablePortIdentifiers<'a> { +pub struct ListOfVariablePortIdentifiers { pub nodes: ( List< - Symbol<'a>, + Symbol, ( - PortIdentifier<'a>, - Vec>, - Option<(Symbol<'a>, ConstantExpression<'a>)>, + PortIdentifier, + Vec, + Option<(Symbol, ConstantExpression)>, ), >, ), diff --git a/src/parser/declarations/declaration_ranges.rs b/src/parser/declarations/declaration_ranges.rs index 60fdf03..593d5a0 100644 --- a/src/parser/declarations/declaration_ranges.rs +++ b/src/parser/declarations/declaration_ranges.rs @@ -8,64 +8,64 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum UnpackedDimension<'a> { - Range(UnpackedDimensionRange<'a>), - Expression(UnpackedDimensionExpression<'a>), +pub enum UnpackedDimension { + Range(UnpackedDimensionRange), + Expression(UnpackedDimensionExpression), } #[derive(Debug, Node)] -pub struct UnpackedDimensionRange<'a> { - pub nodes: (Bracket<'a, ConstantRange<'a>>,), +pub struct UnpackedDimensionRange { + pub nodes: (Bracket,), } #[derive(Debug, Node)] -pub struct UnpackedDimensionExpression<'a> { - pub nodes: (Bracket<'a, ConstantExpression<'a>>,), +pub struct UnpackedDimensionExpression { + pub nodes: (Bracket,), } #[derive(Debug, Node)] -pub enum PackedDimension<'a> { - Range(PackedDimensionRange<'a>), - UnsizedDimension(UnsizedDimension<'a>), +pub enum PackedDimension { + Range(PackedDimensionRange), + UnsizedDimension(UnsizedDimension), } #[derive(Debug, Node)] -pub struct PackedDimensionRange<'a> { - pub nodes: (Bracket<'a, ConstantRange<'a>>,), +pub struct PackedDimensionRange { + pub nodes: (Bracket,), } #[derive(Debug, Node)] -pub enum AssociativeDimension<'a> { - DataType(AssociativeDimensionDataType<'a>), - Asterisk(AssociativeDimensionAsterisk<'a>), +pub enum AssociativeDimension { + DataType(AssociativeDimensionDataType), + Asterisk(AssociativeDimensionAsterisk), } #[derive(Debug, Node)] -pub struct AssociativeDimensionDataType<'a> { - pub nodes: (Bracket<'a, DataType<'a>>,), +pub struct AssociativeDimensionDataType { + pub nodes: (Bracket,), } #[derive(Debug, Node)] -pub struct AssociativeDimensionAsterisk<'a> { - pub nodes: (Bracket<'a, Symbol<'a>>,), +pub struct AssociativeDimensionAsterisk { + pub nodes: (Bracket,), } #[derive(Debug, Node)] -pub enum VariableDimension<'a> { - UnsizedDimension(UnsizedDimension<'a>), - UnpackedDimension(UnpackedDimension<'a>), - AssociativeDimension(AssociativeDimension<'a>), - QueueDimension(QueueDimension<'a>), +pub enum VariableDimension { + UnsizedDimension(UnsizedDimension), + UnpackedDimension(UnpackedDimension), + AssociativeDimension(AssociativeDimension), + QueueDimension(QueueDimension), } #[derive(Debug, Node)] -pub struct QueueDimension<'a> { - pub nodes: (Bracket<'a, (Symbol<'a>, Option<(Symbol<'a>, ConstantExpression<'a>)>)>,), +pub struct QueueDimension { + pub nodes: (Bracket<(Symbol, Option<(Symbol, ConstantExpression)>)>,), } #[derive(Debug, Node)] -pub struct UnsizedDimension<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>), +pub struct UnsizedDimension { + pub nodes: (Symbol, Symbol), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/delays.rs b/src/parser/declarations/delays.rs index d819027..9eeefa0 100644 --- a/src/parser/declarations/delays.rs +++ b/src/parser/declarations/delays.rs @@ -8,66 +8,57 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum Delay3<'a> { - Single(Delay3Single<'a>), - Mintypmax(Delay3Mintypmax<'a>), +pub enum Delay3 { + Single(Delay3Single), + Mintypmax(Delay3Mintypmax), } #[derive(Debug, Node)] -pub struct Delay3Single<'a> { - pub nodes: (Symbol<'a>, DelayValue<'a>), +pub struct Delay3Single { + pub nodes: (Symbol, DelayValue), } #[derive(Debug, Node)] -pub struct Delay3Mintypmax<'a> { +pub struct Delay3Mintypmax { pub nodes: ( - Symbol<'a>, - Paren< - 'a, - ( - MintypmaxExpression<'a>, - Option<( - Symbol<'a>, - MintypmaxExpression<'a>, - Option<(Symbol<'a>, MintypmaxExpression<'a>)>, - )>, - ), - >, + Symbol, + Paren<( + MintypmaxExpression, + Option<( + Symbol, + MintypmaxExpression, + Option<(Symbol, MintypmaxExpression)>, + )>, + )>, ), } #[derive(Debug, Node)] -pub enum Delay2<'a> { - Single(Delay2Single<'a>), - Mintypmax(Delay2Mintypmax<'a>), +pub enum Delay2 { + Single(Delay2Single), + Mintypmax(Delay2Mintypmax), } #[derive(Debug, Node)] -pub struct Delay2Single<'a> { - pub nodes: (Symbol<'a>, DelayValue<'a>), +pub struct Delay2Single { + pub nodes: (Symbol, DelayValue), } #[derive(Debug, Node)] -pub struct Delay2Mintypmax<'a> { +pub struct Delay2Mintypmax { pub nodes: ( - Symbol<'a>, - Paren< - 'a, - ( - MintypmaxExpression<'a>, - Option<(Symbol<'a>, MintypmaxExpression<'a>)>, - ), - >, + Symbol, + Paren<(MintypmaxExpression, Option<(Symbol, MintypmaxExpression)>)>, ), } #[derive(Debug, Node)] -pub enum DelayValue<'a> { - UnsignedNumber(UnsignedNumber<'a>), - RealNumber(RealNumber<'a>), - PsIdentifier(PsIdentifier<'a>), - TimeLiteral(TimeLiteral<'a>), - Step1(Keyword<'a>), +pub enum DelayValue { + UnsignedNumber(UnsignedNumber), + RealNumber(RealNumber), + PsIdentifier(PsIdentifier), + TimeLiteral(TimeLiteral), + Step1(Keyword), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/function_declarations.rs b/src/parser/declarations/function_declarations.rs index f4db4c6..eb22b97 100644 --- a/src/parser/declarations/function_declarations.rs +++ b/src/parser/declarations/function_declarations.rs @@ -9,152 +9,148 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum FunctionDataTypeOrImplicit<'a> { - DataTypeOrVoid(DataTypeOrVoid<'a>), - ImplicitDataType(ImplicitDataType<'a>), +pub enum FunctionDataTypeOrImplicit { + DataTypeOrVoid(DataTypeOrVoid), + ImplicitDataType(ImplicitDataType), } #[derive(Debug, Node)] -pub struct FunctionDeclaration<'a> { +pub struct FunctionDeclaration { + pub nodes: (Keyword, Option, FunctionBodyDeclaration), +} + +#[derive(Debug, Node)] +pub enum FunctionBodyDeclaration { + WithoutPort(FunctionBodyDeclarationWithoutPort), + WithPort(FunctionBodyDeclarationWithPort), +} + +#[derive(Debug, Node)] +pub struct FunctionBodyDeclarationWithoutPort { pub nodes: ( - Keyword<'a>, - Option>, - FunctionBodyDeclaration<'a>, + Option, + Option, + FunctionIdentifier, + Symbol, + Vec, + Vec, + Keyword, + Option<(Symbol, FunctionIdentifier)>, ), } #[derive(Debug, Node)] -pub enum FunctionBodyDeclaration<'a> { - WithoutPort(FunctionBodyDeclarationWithoutPort<'a>), - WithPort(FunctionBodyDeclarationWithPort<'a>), -} - -#[derive(Debug, Node)] -pub struct FunctionBodyDeclarationWithoutPort<'a> { +pub struct FunctionBodyDeclarationWithPort { pub nodes: ( - Option>, - Option>, - FunctionIdentifier<'a>, - Symbol<'a>, - Vec>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, FunctionIdentifier<'a>)>, + Option, + Option, + FunctionIdentifier, + Paren>, + Symbol, + Vec, + Vec, + Keyword, + Option<(Symbol, FunctionIdentifier)>, ), } #[derive(Debug, Node)] -pub struct FunctionBodyDeclarationWithPort<'a> { +pub enum InterfaceIdentifierOrClassScope { + InterfaceIdentifier((InterfaceIdentifier, Symbol)), + ClassScope(ClassScope), +} + +#[derive(Debug, Node)] +pub struct FunctionPrototype { pub nodes: ( - Option>, - Option>, - FunctionIdentifier<'a>, - Paren<'a, Option>>, - Symbol<'a>, - Vec>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, FunctionIdentifier<'a>)>, + Keyword, + DataTypeOrVoid, + FunctionIdentifier, + Option>>, ), } #[derive(Debug, Node)] -pub enum InterfaceIdentifierOrClassScope<'a> { - InterfaceIdentifier((InterfaceIdentifier<'a>, Symbol<'a>)), - ClassScope(ClassScope<'a>), +pub enum DpiImportExport { + ImportFunction(DpiImportExportImportFunction), + ImportTask(DpiImportExportImportTask), + ExportFunction(DpiImportExportExportFunction), + ExportTask(DpiImportExportExportTask), } #[derive(Debug, Node)] -pub struct FunctionPrototype<'a> { +pub struct DpiImportExportImportFunction { pub nodes: ( - Keyword<'a>, - DataTypeOrVoid<'a>, - FunctionIdentifier<'a>, - Option>>>, + Keyword, + DpiSpecString, + Option, + Option<(CIdentifier, Symbol)>, + DpiFunctionProto, + Symbol, ), } #[derive(Debug, Node)] -pub enum DpiImportExport<'a> { - ImportFunction(DpiImportExportImportFunction<'a>), - ImportTask(DpiImportExportImportTask<'a>), - ExportFunction(DpiImportExportExportFunction<'a>), - ExportTask(DpiImportExportExportTask<'a>), -} - -#[derive(Debug, Node)] -pub struct DpiImportExportImportFunction<'a> { +pub struct DpiImportExportImportTask { pub nodes: ( - Keyword<'a>, - DpiSpecString<'a>, - Option>, - Option<(CIdentifier<'a>, Symbol<'a>)>, - DpiFunctionProto<'a>, - Symbol<'a>, + Keyword, + DpiSpecString, + Option, + Option<(CIdentifier, Symbol)>, + DpiTaskProto, + Symbol, ), } #[derive(Debug, Node)] -pub struct DpiImportExportImportTask<'a> { +pub struct DpiImportExportExportFunction { pub nodes: ( - Keyword<'a>, - DpiSpecString<'a>, - Option>, - Option<(CIdentifier<'a>, Symbol<'a>)>, - DpiTaskProto<'a>, - Symbol<'a>, + Keyword, + DpiSpecString, + Option<(CIdentifier, Symbol)>, + Keyword, + FunctionIdentifier, + Symbol, ), } #[derive(Debug, Node)] -pub struct DpiImportExportExportFunction<'a> { +pub struct DpiImportExportExportTask { pub nodes: ( - Keyword<'a>, - DpiSpecString<'a>, - Option<(CIdentifier<'a>, Symbol<'a>)>, - Keyword<'a>, - FunctionIdentifier<'a>, - Symbol<'a>, + Keyword, + DpiSpecString, + Option<(CIdentifier, Symbol)>, + Keyword, + TaskIdentifier, + Symbol, ), } #[derive(Debug, Node)] -pub struct DpiImportExportExportTask<'a> { - pub nodes: ( - Keyword<'a>, - DpiSpecString<'a>, - Option<(CIdentifier<'a>, Symbol<'a>)>, - Keyword<'a>, - TaskIdentifier<'a>, - Symbol<'a>, - ), +pub enum DpiSpecString { + DpiC(Keyword), + Dpi(Keyword), } #[derive(Debug, Node)] -pub enum DpiSpecString<'a> { - DpiC(Keyword<'a>), - Dpi(Keyword<'a>), +pub enum DpiFunctionImportProperty { + Context(Keyword), + Pure(Keyword), } #[derive(Debug, Node)] -pub enum DpiFunctionImportProperty<'a> { - Context(Keyword<'a>), - Pure(Keyword<'a>), +pub enum DpiTaskImportProperty { + Context(Keyword), } #[derive(Debug, Node)] -pub enum DpiTaskImportProperty<'a> { - Context(Keyword<'a>), +pub struct DpiFunctionProto { + pub nodes: (FunctionPrototype,), } #[derive(Debug, Node)] -pub struct DpiFunctionProto<'a> { - pub nodes: (FunctionPrototype<'a>,), -} - -#[derive(Debug, Node)] -pub struct DpiTaskProto<'a> { - pub nodes: (TaskPrototype<'a>,), +pub struct DpiTaskProto { + pub nodes: (TaskPrototype,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/interface_declarations.rs b/src/parser/declarations/interface_declarations.rs index 59560b2..3d8d673 100644 --- a/src/parser/declarations/interface_declarations.rs +++ b/src/parser/declarations/interface_declarations.rs @@ -8,88 +8,81 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct ModportDeclaration<'a> { - pub nodes: (Keyword<'a>, List, ModportItem<'a>>, Symbol<'a>), +pub struct ModportDeclaration { + pub nodes: (Keyword, List, Symbol), } #[derive(Debug, Node)] -pub struct ModportItem<'a> { +pub struct ModportItem { pub nodes: ( - ModportIdentifier<'a>, - Paren<'a, List, ModportPortsDeclaraton<'a>>>, + ModportIdentifier, + Paren>, ), } #[derive(Debug, Node)] -pub enum ModportPortsDeclaraton<'a> { - Simple(ModportPortsDeclaratonSimple<'a>), - Tf(ModportPortsDeclaratonTf<'a>), - Clocking(ModportPortsDeclaratonClocking<'a>), +pub enum ModportPortsDeclaraton { + Simple(ModportPortsDeclaratonSimple), + Tf(ModportPortsDeclaratonTf), + Clocking(ModportPortsDeclaratonClocking), } #[derive(Debug, Node)] -pub struct ModportPortsDeclaratonSimple<'a> { - pub nodes: ( - Vec>, - ModportSimplePortsDeclaration<'a>, - ), +pub struct ModportPortsDeclaratonSimple { + pub nodes: (Vec, ModportSimplePortsDeclaration), } #[derive(Debug, Node)] -pub struct ModportPortsDeclaratonTf<'a> { - pub nodes: (Vec>, ModportTfPortsDeclaration<'a>), +pub struct ModportPortsDeclaratonTf { + pub nodes: (Vec, ModportTfPortsDeclaration), } #[derive(Debug, Node)] -pub struct ModportPortsDeclaratonClocking<'a> { - pub nodes: (Vec>, ModportClockingDeclaration<'a>), +pub struct ModportPortsDeclaratonClocking { + pub nodes: (Vec, ModportClockingDeclaration), } #[derive(Debug, Node)] -pub struct ModportClockingDeclaration<'a> { - pub nodes: (Keyword<'a>, ClockingIdentifier<'a>), +pub struct ModportClockingDeclaration { + pub nodes: (Keyword, ClockingIdentifier), } #[derive(Debug, Node)] -pub struct ModportSimplePortsDeclaration<'a> { - pub nodes: (PortDirection<'a>, List, ModportSimplePort<'a>>), +pub struct ModportSimplePortsDeclaration { + pub nodes: (PortDirection, List), } #[derive(Debug, Node)] -pub enum ModportSimplePort<'a> { - Ordered(ModportSimplePortOrdered<'a>), - Named(ModportSimplePortNamed<'a>), +pub enum ModportSimplePort { + Ordered(ModportSimplePortOrdered), + Named(ModportSimplePortNamed), } #[derive(Debug, Node)] -pub struct ModportSimplePortOrdered<'a> { - pub nodes: (PortIdentifier<'a>,), +pub struct ModportSimplePortOrdered { + pub nodes: (PortIdentifier,), } #[derive(Debug, Node)] -pub struct ModportSimplePortNamed<'a> { - pub nodes: ( - Symbol<'a>, - PortIdentifier<'a>, - Paren<'a, Option>>, - ), +pub struct ModportSimplePortNamed { + pub nodes: (Symbol, PortIdentifier, Paren>), } #[derive(Debug, Node)] -pub struct ModportTfPortsDeclaration<'a> { - pub nodes: (ImportExport<'a>, List, ModportTfPort<'a>>), +pub struct ModportTfPortsDeclaration { + pub nodes: (ImportExport, List), } #[derive(Debug, Node)] -pub enum ModportTfPort<'a> { - MethodPrototype(MethodPrototype<'a>), - TfIdentifier(TfIdentifier<'a>), +pub enum ModportTfPort { + MethodPrototype(MethodPrototype), + TfIdentifier(TfIdentifier), } #[derive(Debug, Node)] -pub enum ImportExport<'a> { - Import(Keyword<'a>), - Export(Keyword<'a>), +pub enum ImportExport { + Import(Keyword), + Export(Keyword), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/let_declarations.rs b/src/parser/declarations/let_declarations.rs index 6a3d6c9..ddc42e3 100644 --- a/src/parser/declarations/let_declarations.rs +++ b/src/parser/declarations/let_declarations.rs @@ -9,89 +9,75 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct LetDeclaration<'a> { +pub struct LetDeclaration { pub nodes: ( - Keyword<'a>, - LetIdentifier<'a>, - Option>>>, - Symbol<'a>, - Expression<'a>, - Symbol<'a>, + Keyword, + LetIdentifier, + Option>>, + Symbol, + Expression, + Symbol, ), } #[derive(Debug, Node)] -pub struct LetIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct LetIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct LetPortList<'a> { - pub nodes: (List, LetPortItem<'a>>,), +pub struct LetPortList { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct LetPortItem<'a> { +pub struct LetPortItem { pub nodes: ( - Vec>, - Option>, - FormalPortIdentifier<'a>, - Vec>, - Option<(Symbol<'a>, Expression<'a>)>, + Vec, + Option, + FormalPortIdentifier, + Vec, + Option<(Symbol, Expression)>, ), } #[derive(Debug, Node)] -pub enum LetFormalType<'a> { - DataTypeOrImplicit(DataTypeOrImplicit<'a>), - Untyped(Keyword<'a>), +pub enum LetFormalType { + DataTypeOrImplicit(DataTypeOrImplicit), + Untyped(Keyword), } #[derive(Debug, Node)] -pub struct LetExpression<'a> { +pub struct LetExpression { pub nodes: ( - Option>, - LetIdentifier<'a>, - Option>>>, + Option, + LetIdentifier, + Option>>, ), } #[derive(Debug, Node)] -pub enum LetListOfArguments<'a> { - Ordered(LetListOfArgumentsOrdered<'a>), - Named(LetListOfArgumentsNamed<'a>), +pub enum LetListOfArguments { + Ordered(LetListOfArgumentsOrdered), + Named(LetListOfArgumentsNamed), } #[derive(Debug, Node)] -pub struct LetListOfArgumentsOrdered<'a> { +pub struct LetListOfArgumentsOrdered { pub nodes: ( - List, Option>>, - Vec<( - Symbol<'a>, - Symbol<'a>, - Identifier<'a>, - Paren<'a, Option>>, - )>, + List>, + Vec<(Symbol, Symbol, Identifier, Paren>)>, ), } #[derive(Debug, Node)] -pub struct LetListOfArgumentsNamed<'a> { - pub nodes: ( - List< - Symbol<'a>, - ( - Symbol<'a>, - Identifier<'a>, - Paren<'a, Option>>, - ), - >, - ), +pub struct LetListOfArgumentsNamed { + pub nodes: (List>)>,), } #[derive(Debug, Node)] -pub struct LetActualArg<'a> { - pub nodes: (Expression<'a>,), +pub struct LetActualArg { + pub nodes: (Expression,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/module_parameter_declarations.rs b/src/parser/declarations/module_parameter_declarations.rs index b37d3b2..fcb0280 100644 --- a/src/parser/declarations/module_parameter_declarations.rs +++ b/src/parser/declarations/module_parameter_declarations.rs @@ -7,52 +7,52 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum LocalParameterDeclaration<'a> { - Param(LocalParameterDeclarationParam<'a>), - Type(LocalParameterDeclarationType<'a>), +pub enum LocalParameterDeclaration { + Param(LocalParameterDeclarationParam), + Type(LocalParameterDeclarationType), } #[derive(Debug, Node)] -pub struct LocalParameterDeclarationParam<'a> { +pub struct LocalParameterDeclarationParam { pub nodes: ( - Keyword<'a>, - Option>, - ListOfParamAssignments<'a>, + Keyword, + Option, + ListOfParamAssignments, ), } #[derive(Debug, Node)] -pub struct LocalParameterDeclarationType<'a> { - pub nodes: (Keyword<'a>, Keyword<'a>, ListOfTypeAssignments<'a>), +pub struct LocalParameterDeclarationType { + pub nodes: (Keyword, Keyword, ListOfTypeAssignments), } #[derive(Debug, Node)] -pub enum ParameterDeclaration<'a> { - Param(ParameterDeclarationParam<'a>), - Type(ParameterDeclarationType<'a>), +pub enum ParameterDeclaration { + Param(ParameterDeclarationParam), + Type(ParameterDeclarationType), } #[derive(Debug, Node)] -pub struct ParameterDeclarationParam<'a> { +pub struct ParameterDeclarationParam { pub nodes: ( - Keyword<'a>, - Option>, - ListOfParamAssignments<'a>, + Keyword, + Option, + ListOfParamAssignments, ), } #[derive(Debug, Node)] -pub struct ParameterDeclarationType<'a> { - pub nodes: (Keyword<'a>, Keyword<'a>, ListOfTypeAssignments<'a>), +pub struct ParameterDeclarationType { + pub nodes: (Keyword, Keyword, ListOfTypeAssignments), } #[derive(Debug, Node)] -pub struct SpecparamDeclaration<'a> { +pub struct SpecparamDeclaration { pub nodes: ( - Keyword<'a>, - Option>, - ListOfSpecparamAssignments<'a>, - Symbol<'a>, + Keyword, + Option, + ListOfSpecparamAssignments, + Symbol, ), } diff --git a/src/parser/declarations/net_and_variable_types.rs b/src/parser/declarations/net_and_variable_types.rs index 0f8e7fe..61a66ce 100644 --- a/src/parser/declarations/net_and_variable_types.rs +++ b/src/parser/declarations/net_and_variable_types.rs @@ -9,290 +9,278 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum CastingType<'a> { - SimpleType(Box>), - ConstantPrimary(Box>), - Signing(Box>), - String(Keyword<'a>), - Const(Keyword<'a>), +pub enum CastingType { + SimpleType(Box), + ConstantPrimary(Box), + Signing(Box), + String(Keyword), + Const(Keyword), } #[derive(Debug, Node)] -pub enum DataType<'a> { - Vector(DataTypeVector<'a>), - Atom(DataTypeAtom<'a>), - NonIntegerType(NonIntegerType<'a>), - StructUnion(Box>), - Enum(DataTypeEnum<'a>), - String(Keyword<'a>), - Chandle(Keyword<'a>), - Virtual(DataTypeVirtual<'a>), - Type(DataTypeType<'a>), - ClassType(ClassType<'a>), - Event(Keyword<'a>), - PsCovergroupIdentifier(PsCovergroupIdentifier<'a>), - TypeReference(Box>), +pub enum DataType { + Vector(DataTypeVector), + Atom(DataTypeAtom), + NonIntegerType(NonIntegerType), + StructUnion(Box), + Enum(DataTypeEnum), + String(Keyword), + Chandle(Keyword), + Virtual(DataTypeVirtual), + Type(DataTypeType), + ClassType(ClassType), + Event(Keyword), + PsCovergroupIdentifier(PsCovergroupIdentifier), + TypeReference(Box), } #[derive(Debug, Node)] -pub struct DataTypeVector<'a> { +pub struct DataTypeVector { + pub nodes: (IntegerVectorType, Option, Vec), +} + +#[derive(Debug, Node)] +pub struct DataTypeAtom { + pub nodes: (IntegerAtomType, Option), +} + +#[derive(Debug, Node)] +pub struct DataTypeStructUnion { pub nodes: ( - IntegerVectorType<'a>, - Option>, - Vec>, + StructUnion, + Option<(Packed, Option)>, + Brace<(StructUnionMember, Vec)>, + Vec, ), } #[derive(Debug, Node)] -pub struct DataTypeAtom<'a> { - pub nodes: (IntegerAtomType<'a>, Option>), +pub struct Packed { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct DataTypeStructUnion<'a> { +pub struct DataTypeEnum { pub nodes: ( - StructUnion<'a>, - Option<(Packed<'a>, Option>)>, - Brace<'a, (StructUnionMember<'a>, Vec>)>, - Vec>, + Keyword, + Option, + Brace>, + Vec, ), } #[derive(Debug, Node)] -pub struct Packed<'a> { - pub nodes: (Keyword<'a>,), -} - -#[derive(Debug, Node)] -pub struct DataTypeEnum<'a> { +pub struct DataTypeVirtual { pub nodes: ( - Keyword<'a>, - Option>, - Brace<'a, List, EnumNameDeclaration<'a>>>, - Vec>, + Keyword, + Option, + InterfaceIdentifier, + Option, + Option<(Symbol, ModportIdentifier)>, ), } #[derive(Debug, Node)] -pub struct DataTypeVirtual<'a> { +pub struct Interface { + pub nodes: (Keyword,), +} + +#[derive(Debug, Node)] +pub struct DataTypeType { pub nodes: ( - Keyword<'a>, - Option>, - InterfaceIdentifier<'a>, - Option>, - Option<(Symbol<'a>, ModportIdentifier<'a>)>, + Option, + TypeIdentifier, + Vec, ), } #[derive(Debug, Node)] -pub struct Interface<'a> { - pub nodes: (Keyword<'a>,), +pub enum DataTypeOrImplicit { + DataType(DataType), + ImplicitDataType(ImplicitDataType), } #[derive(Debug, Node)] -pub struct DataTypeType<'a> { +pub struct ImplicitDataType { + pub nodes: (Option, Vec), +} + +#[derive(Debug, Node)] +pub enum EnumBaseType { + Atom(EnumBaseTypeAtom), + Vector(EnumBaseTypeVector), + Type(EnumBaseTypeType), +} + +#[derive(Debug, Node)] +pub struct EnumBaseTypeAtom { + pub nodes: (IntegerAtomType, Option), +} + +#[derive(Debug, Node)] +pub struct EnumBaseTypeVector { + pub nodes: (IntegerVectorType, Option, Option), +} + +#[derive(Debug, Node)] +pub struct EnumBaseTypeType { + pub nodes: (TypeIdentifier, Option), +} + +#[derive(Debug, Node)] +pub struct EnumNameDeclaration { pub nodes: ( - Option>, - TypeIdentifier<'a>, - Vec>, + EnumIdentifier, + Option)>>, + Option<(Symbol, ConstantExpression)>, ), } #[derive(Debug, Node)] -pub enum DataTypeOrImplicit<'a> { - DataType(DataType<'a>), - ImplicitDataType(ImplicitDataType<'a>), +pub struct ClassScope { + pub nodes: (ClassType, Symbol), } #[derive(Debug, Node)] -pub struct ImplicitDataType<'a> { - pub nodes: (Option>, Vec>), -} - -#[derive(Debug, Node)] -pub enum EnumBaseType<'a> { - Atom(EnumBaseTypeAtom<'a>), - Vector(EnumBaseTypeVector<'a>), - Type(EnumBaseTypeType<'a>), -} - -#[derive(Debug, Node)] -pub struct EnumBaseTypeAtom<'a> { - pub nodes: (IntegerAtomType<'a>, Option>), -} - -#[derive(Debug, Node)] -pub struct EnumBaseTypeVector<'a> { +pub struct ClassType { pub nodes: ( - IntegerVectorType<'a>, - Option>, - Option>, + PsClassIdentifier, + Option, + Vec<(Symbol, ClassIdentifier, Option)>, ), } #[derive(Debug, Node)] -pub struct EnumBaseTypeType<'a> { - pub nodes: (TypeIdentifier<'a>, Option>), +pub enum IntegerType { + IntegerVectorType(IntegerVectorType), + IntegerAtomType(IntegerAtomType), } #[derive(Debug, Node)] -pub struct EnumNameDeclaration<'a> { +pub enum IntegerAtomType { + Byte(Keyword), + Shortint(Keyword), + Int(Keyword), + Longint(Keyword), + Integer(Keyword), + Time(Keyword), +} + +#[derive(Debug, Node)] +pub enum IntegerVectorType { + Bit(Keyword), + Logic(Keyword), + Reg(Keyword), +} + +#[derive(Debug, Node)] +pub enum NonIntegerType { + Shortreal(Keyword), + Real(Keyword), + Realtime(Keyword), +} + +#[derive(Debug, Node)] +pub enum NetType { + Supply0(Keyword), + Supply1(Keyword), + Tri(Keyword), + Triand(Keyword), + Trior(Keyword), + Trireg(Keyword), + Tri0(Keyword), + Tri1(Keyword), + Uwire(Keyword), + Wire(Keyword), + Wand(Keyword), + Wor(Keyword), +} + +#[derive(Debug, Node)] +pub enum NetPortType { + DataType(NetPortTypeDataType), + NetTypeIdentifier(NetTypeIdentifier), + Interconnect(NetPortTypeInterconnect), +} + +#[derive(Debug, Node)] +pub struct NetPortTypeDataType { + pub nodes: (Option, DataTypeOrImplicit), +} + +#[derive(Debug, Node)] +pub struct NetPortTypeInterconnect { + pub nodes: (Keyword, ImplicitDataType), +} + +#[derive(Debug, Node)] +pub struct VariablePortType { + pub nodes: (VarDataType,), +} + +#[derive(Debug, Node)] +pub enum VarDataType { + DataType(DataType), + Var(VarDataTypeVar), +} + +#[derive(Debug, Node)] +pub struct VarDataTypeVar { + pub nodes: (Keyword, DataTypeOrImplicit), +} + +#[derive(Debug, Node)] +pub enum Signing { + Signed(Keyword), + Unsigned(Keyword), +} + +#[derive(Debug, Node)] +pub enum SimpleType { + IntegerType(IntegerType), + NonIntegerType(NonIntegerType), + PsTypeIdentifier(PsTypeIdentifier), + PsParameterIdentifier(PsParameterIdentifier), +} + +#[derive(Debug, Node)] +pub struct StructUnionMember { pub nodes: ( - EnumIdentifier<'a>, - Option, Option<(Symbol<'a>, IntegralNumber<'a>)>)>>, - Option<(Symbol<'a>, ConstantExpression<'a>)>, + Vec, + Option, + DataTypeOrVoid, + ListOfVariableDeclAssignments, + Symbol, ), } #[derive(Debug, Node)] -pub struct ClassScope<'a> { - pub nodes: (ClassType<'a>, Symbol<'a>), +pub enum DataTypeOrVoid { + DataType(DataType), + Void(Keyword), } #[derive(Debug, Node)] -pub struct ClassType<'a> { - pub nodes: ( - PsClassIdentifier<'a>, - Option>, - Vec<( - Symbol<'a>, - ClassIdentifier<'a>, - Option>, - )>, - ), +pub enum StructUnion { + Struct(Keyword), + Union(Keyword), + UnionTagged((Keyword, Keyword)), } #[derive(Debug, Node)] -pub enum IntegerType<'a> { - IntegerVectorType(IntegerVectorType<'a>), - IntegerAtomType(IntegerAtomType<'a>), +pub enum TypeReference { + Expression(TypeReferenceExpression), + DataType(TypeReferenceDataType), } #[derive(Debug, Node)] -pub enum IntegerAtomType<'a> { - Byte(Keyword<'a>), - Shortint(Keyword<'a>), - Int(Keyword<'a>), - Longint(Keyword<'a>), - Integer(Keyword<'a>), - Time(Keyword<'a>), +pub struct TypeReferenceExpression { + pub nodes: (Keyword, Paren), } #[derive(Debug, Node)] -pub enum IntegerVectorType<'a> { - Bit(Keyword<'a>), - Logic(Keyword<'a>), - Reg(Keyword<'a>), -} - -#[derive(Debug, Node)] -pub enum NonIntegerType<'a> { - Shortreal(Keyword<'a>), - Real(Keyword<'a>), - Realtime(Keyword<'a>), -} - -#[derive(Debug, Node)] -pub enum NetType<'a> { - Supply0(Keyword<'a>), - Supply1(Keyword<'a>), - Tri(Keyword<'a>), - Triand(Keyword<'a>), - Trior(Keyword<'a>), - Trireg(Keyword<'a>), - Tri0(Keyword<'a>), - Tri1(Keyword<'a>), - Uwire(Keyword<'a>), - Wire(Keyword<'a>), - Wand(Keyword<'a>), - Wor(Keyword<'a>), -} - -#[derive(Debug, Node)] -pub enum NetPortType<'a> { - DataType(NetPortTypeDataType<'a>), - NetTypeIdentifier(NetTypeIdentifier<'a>), - Interconnect(NetPortTypeInterconnect<'a>), -} - -#[derive(Debug, Node)] -pub struct NetPortTypeDataType<'a> { - pub nodes: (Option>, DataTypeOrImplicit<'a>), -} - -#[derive(Debug, Node)] -pub struct NetPortTypeInterconnect<'a> { - pub nodes: (Keyword<'a>, ImplicitDataType<'a>), -} - -#[derive(Debug, Node)] -pub struct VariablePortType<'a> { - pub nodes: (VarDataType<'a>,), -} - -#[derive(Debug, Node)] -pub enum VarDataType<'a> { - DataType(DataType<'a>), - Var(VarDataTypeVar<'a>), -} - -#[derive(Debug, Node)] -pub struct VarDataTypeVar<'a> { - pub nodes: (Keyword<'a>, DataTypeOrImplicit<'a>), -} - -#[derive(Debug, Node)] -pub enum Signing<'a> { - Signed(Keyword<'a>), - Unsigned(Keyword<'a>), -} - -#[derive(Debug, Node)] -pub enum SimpleType<'a> { - IntegerType(IntegerType<'a>), - NonIntegerType(NonIntegerType<'a>), - PsTypeIdentifier(PsTypeIdentifier<'a>), - PsParameterIdentifier(PsParameterIdentifier<'a>), -} - -#[derive(Debug, Node)] -pub struct StructUnionMember<'a> { - pub nodes: ( - Vec>, - Option>, - DataTypeOrVoid<'a>, - ListOfVariableDeclAssignments<'a>, - Symbol<'a>, - ), -} - -#[derive(Debug, Node)] -pub enum DataTypeOrVoid<'a> { - DataType(DataType<'a>), - Void(Keyword<'a>), -} - -#[derive(Debug, Node)] -pub enum StructUnion<'a> { - Struct(Keyword<'a>), - Union(Keyword<'a>), - UnionTagged((Keyword<'a>, Keyword<'a>)), -} - -#[derive(Debug, Node)] -pub enum TypeReference<'a> { - Expression(TypeReferenceExpression<'a>), - DataType(TypeReferenceDataType<'a>), -} - -#[derive(Debug, Node)] -pub struct TypeReferenceExpression<'a> { - pub nodes: (Keyword<'a>, Paren<'a, Expression<'a>>), -} - -#[derive(Debug, Node)] -pub struct TypeReferenceDataType<'a> { - pub nodes: (Keyword<'a>, Paren<'a, DataType<'a>>), +pub struct TypeReferenceDataType { + pub nodes: (Keyword, Paren), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/port_declarations.rs b/src/parser/declarations/port_declarations.rs index 3a08425..a4066d1 100644 --- a/src/parser/declarations/port_declarations.rs +++ b/src/parser/declarations/port_declarations.rs @@ -8,77 +8,77 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct InoutDeclaration<'a> { +pub struct InoutDeclaration { pub nodes: ( - Keyword<'a>, - Option>, - ListOfPortIdentifiers<'a>, + Keyword, + Option, + ListOfPortIdentifiers, ), } #[derive(Debug, Node)] -pub enum InputDeclaration<'a> { - Net(InputDeclarationNet<'a>), - Variable(InputDeclarationVariable<'a>), +pub enum InputDeclaration { + Net(InputDeclarationNet), + Variable(InputDeclarationVariable), } #[derive(Debug, Node)] -pub struct InputDeclarationNet<'a> { +pub struct InputDeclarationNet { pub nodes: ( - Keyword<'a>, - Option>, - ListOfPortIdentifiers<'a>, + Keyword, + Option, + ListOfPortIdentifiers, ), } #[derive(Debug, Node)] -pub struct InputDeclarationVariable<'a> { +pub struct InputDeclarationVariable { pub nodes: ( - Keyword<'a>, - VariablePortType<'a>, - ListOfVariableIdentifiers<'a>, + Keyword, + VariablePortType, + ListOfVariableIdentifiers, ), } #[derive(Debug, Node)] -pub enum OutputDeclaration<'a> { - Net(OutputDeclarationNet<'a>), - Variable(OutputDeclarationVariable<'a>), +pub enum OutputDeclaration { + Net(OutputDeclarationNet), + Variable(OutputDeclarationVariable), } #[derive(Debug, Node)] -pub struct OutputDeclarationNet<'a> { +pub struct OutputDeclarationNet { pub nodes: ( - Keyword<'a>, - Option>, - ListOfPortIdentifiers<'a>, + Keyword, + Option, + ListOfPortIdentifiers, ), } #[derive(Debug, Node)] -pub struct OutputDeclarationVariable<'a> { +pub struct OutputDeclarationVariable { pub nodes: ( - Keyword<'a>, - VariablePortType<'a>, - ListOfVariableIdentifiers<'a>, + Keyword, + VariablePortType, + ListOfVariableIdentifiers, ), } #[derive(Debug, Node)] -pub struct InterfacePortDeclaration<'a> { +pub struct InterfacePortDeclaration { pub nodes: ( - InterfaceIdentifier<'a>, - Option<(Symbol<'a>, ModportIdentifier<'a>)>, - ListOfInterfaceIdentifiers<'a>, + InterfaceIdentifier, + Option<(Symbol, ModportIdentifier)>, + ListOfInterfaceIdentifiers, ), } #[derive(Debug, Node)] -pub struct RefDeclaration<'a> { +pub struct RefDeclaration { pub nodes: ( - Keyword<'a>, - VariablePortType<'a>, - ListOfVariableIdentifiers<'a>, + Keyword, + VariablePortType, + ListOfVariableIdentifiers, ), } diff --git a/src/parser/declarations/strengths.rs b/src/parser/declarations/strengths.rs index 0239268..be38fe0 100644 --- a/src/parser/declarations/strengths.rs +++ b/src/parser/declarations/strengths.rs @@ -7,81 +7,81 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum DriveStrength<'a> { - Strength01(DriveStrength01<'a>), - Strength10(DriveStrength10<'a>), - Strength0z(DriveStrength0z<'a>), - Strength1z(DriveStrength1z<'a>), - Strengthz0(DriveStrengthz0<'a>), - Strengthz1(DriveStrengthz1<'a>), +pub enum DriveStrength { + Strength01(DriveStrength01), + Strength10(DriveStrength10), + Strength0z(DriveStrength0z), + Strength1z(DriveStrength1z), + Strengthz0(DriveStrengthz0), + Strengthz1(DriveStrengthz1), } #[derive(Debug, Node)] -pub struct DriveStrength01<'a> { - pub nodes: (Paren<'a, (Strength0<'a>, Symbol<'a>, Strength1<'a>)>,), +pub struct DriveStrength01 { + pub nodes: (Paren<(Strength0, Symbol, Strength1)>,), } #[derive(Debug, Node)] -pub struct DriveStrength10<'a> { - pub nodes: (Paren<'a, (Strength1<'a>, Symbol<'a>, Strength0<'a>)>,), +pub struct DriveStrength10 { + pub nodes: (Paren<(Strength1, Symbol, Strength0)>,), } #[derive(Debug, Node)] -pub struct DriveStrength0z<'a> { - pub nodes: (Paren<'a, (Strength0<'a>, Symbol<'a>, Keyword<'a>)>,), +pub struct DriveStrength0z { + pub nodes: (Paren<(Strength0, Symbol, Keyword)>,), } #[derive(Debug, Node)] -pub struct DriveStrength1z<'a> { - pub nodes: (Paren<'a, (Strength1<'a>, Symbol<'a>, Keyword<'a>)>,), +pub struct DriveStrength1z { + pub nodes: (Paren<(Strength1, Symbol, Keyword)>,), } #[derive(Debug, Node)] -pub struct DriveStrengthz1<'a> { - pub nodes: (Paren<'a, (Keyword<'a>, Symbol<'a>, Strength1<'a>)>,), +pub struct DriveStrengthz1 { + pub nodes: (Paren<(Keyword, Symbol, Strength1)>,), } #[derive(Debug, Node)] -pub struct DriveStrengthz0<'a> { - pub nodes: (Paren<'a, (Keyword<'a>, Symbol<'a>, Strength0<'a>)>,), +pub struct DriveStrengthz0 { + pub nodes: (Paren<(Keyword, Symbol, Strength0)>,), } #[derive(Debug, Node)] -pub enum Strength0<'a> { - Supply0(Keyword<'a>), - Strong0(Keyword<'a>), - Pull0(Keyword<'a>), - Weak0(Keyword<'a>), +pub enum Strength0 { + Supply0(Keyword), + Strong0(Keyword), + Pull0(Keyword), + Weak0(Keyword), } #[derive(Debug, Node)] -pub enum Strength1<'a> { - Supply1(Keyword<'a>), - Strong1(Keyword<'a>), - Pull1(Keyword<'a>), - Weak1(Keyword<'a>), +pub enum Strength1 { + Supply1(Keyword), + Strong1(Keyword), + Pull1(Keyword), + Weak1(Keyword), } #[derive(Debug, Node)] -pub enum ChargeStrength<'a> { - Small(ChargeStrengthSmall<'a>), - Medium(ChargeStrengthMedium<'a>), - Large(ChargeStrengthLarge<'a>), +pub enum ChargeStrength { + Small(ChargeStrengthSmall), + Medium(ChargeStrengthMedium), + Large(ChargeStrengthLarge), } #[derive(Debug, Node)] -pub struct ChargeStrengthSmall<'a> { - pub nodes: (Paren<'a, Keyword<'a>>,), +pub struct ChargeStrengthSmall { + pub nodes: (Paren,), } #[derive(Debug, Node)] -pub struct ChargeStrengthMedium<'a> { - pub nodes: (Paren<'a, Keyword<'a>>,), +pub struct ChargeStrengthMedium { + pub nodes: (Paren,), } #[derive(Debug, Node)] -pub struct ChargeStrengthLarge<'a> { - pub nodes: (Paren<'a, Keyword<'a>>,), +pub struct ChargeStrengthLarge { + pub nodes: (Paren,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/task_declarations.rs b/src/parser/declarations/task_declarations.rs index bdace00..0ee7c7a 100644 --- a/src/parser/declarations/task_declarations.rs +++ b/src/parser/declarations/task_declarations.rs @@ -9,94 +9,90 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct TaskDeclaration<'a> { - pub nodes: (Keyword<'a>, Option>, TaskBodyDeclaration<'a>), +pub struct TaskDeclaration { + pub nodes: (Keyword, Option, TaskBodyDeclaration), } #[derive(Debug, Node)] -pub enum TaskBodyDeclaration<'a> { - WithoutPort(TaskBodyDeclarationWithoutPort<'a>), - WithPort(TaskBodyDeclarationWithPort<'a>), +pub enum TaskBodyDeclaration { + WithoutPort(TaskBodyDeclarationWithoutPort), + WithPort(TaskBodyDeclarationWithPort), } #[derive(Debug, Node)] -pub struct TaskBodyDeclarationWithoutPort<'a> { +pub struct TaskBodyDeclarationWithoutPort { pub nodes: ( - Option>, - TaskIdentifier<'a>, - Symbol<'a>, - Vec>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, TaskIdentifier<'a>)>, + Option, + TaskIdentifier, + Symbol, + Vec, + Vec, + Keyword, + Option<(Symbol, TaskIdentifier)>, ), } #[derive(Debug, Node)] -pub struct TaskBodyDeclarationWithPort<'a> { +pub struct TaskBodyDeclarationWithPort { pub nodes: ( - Option>, - TaskIdentifier<'a>, - Paren<'a, Option>>, - Symbol<'a>, - Vec>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, TaskIdentifier<'a>)>, + Option, + TaskIdentifier, + Paren>, + Symbol, + Vec, + Vec, + Keyword, + Option<(Symbol, TaskIdentifier)>, ), } #[derive(Debug, Node)] -pub enum TfItemDeclaration<'a> { - BlockItemDeclaration(BlockItemDeclaration<'a>), - TfPortDeclaration(TfPortDeclaration<'a>), +pub enum TfItemDeclaration { + BlockItemDeclaration(BlockItemDeclaration), + TfPortDeclaration(TfPortDeclaration), } #[derive(Debug, Node)] -pub struct TfPortList<'a> { - pub nodes: (List, TfPortItem<'a>>,), +pub struct TfPortList { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct TfPortItem<'a> { +pub struct TfPortItem { pub nodes: ( - Vec>, - Option>, - Option>, - Option>, + Vec, + Option, + Option, + Option, Option<( - PortIdentifier<'a>, - Vec>, - Option<(Symbol<'a>, Expression<'a>)>, + PortIdentifier, + Vec, + Option<(Symbol, Expression)>, )>, ), } #[derive(Debug, Node)] -pub enum TfPortDirection<'a> { - PortDirection(PortDirection<'a>), - ConstRef((Keyword<'a>, Keyword<'a>)), +pub enum TfPortDirection { + PortDirection(PortDirection), + ConstRef((Keyword, Keyword)), } #[derive(Debug, Node)] -pub struct TfPortDeclaration<'a> { +pub struct TfPortDeclaration { pub nodes: ( - Vec>, - TfPortDirection<'a>, - Option>, - Option>, - ListOfTfVariableIdentifiers<'a>, - Symbol<'a>, + Vec, + TfPortDirection, + Option, + Option, + ListOfTfVariableIdentifiers, + Symbol, ), } #[derive(Debug, Node)] -pub struct TaskPrototype<'a> { - pub nodes: ( - Keyword<'a>, - TaskIdentifier<'a>, - Option>>>, - ), +pub struct TaskPrototype { + pub nodes: (Keyword, TaskIdentifier, Option>>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/declarations/type_declarations.rs b/src/parser/declarations/type_declarations.rs index 7205831..6514140 100644 --- a/src/parser/declarations/type_declarations.rs +++ b/src/parser/declarations/type_declarations.rs @@ -9,221 +9,221 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum DataDeclaration<'a> { - Variable(DataDeclarationVariable<'a>), - TypeDeclaration(TypeDeclaration<'a>), - PackageImportDeclaration(PackageImportDeclaration<'a>), - NetTypeDeclaration(NetTypeDeclaration<'a>), +pub enum DataDeclaration { + Variable(DataDeclarationVariable), + TypeDeclaration(TypeDeclaration), + PackageImportDeclaration(PackageImportDeclaration), + NetTypeDeclaration(NetTypeDeclaration), } #[derive(Debug, Node)] -pub struct DataDeclarationVariable<'a> { +pub struct DataDeclarationVariable { pub nodes: ( - Option>, - Option>, - Option>, - Option>, - ListOfVariableDeclAssignments<'a>, - Symbol<'a>, + Option, + Option, + Option, + Option, + ListOfVariableDeclAssignments, + Symbol, ), } #[derive(Debug, Node)] -pub struct Const<'a> { - pub nodes: (Keyword<'a>,), +pub struct Const { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct PackageImportDeclaration<'a> { +pub struct PackageImportDeclaration { pub nodes: ( - Keyword<'a>, - List, PackageImportItem<'a>>, - Symbol<'a>, + Keyword, + List, + Symbol, ), } #[derive(Debug, Node)] -pub enum PackageImportItem<'a> { - Identifier(PackageImportItemIdentifier<'a>), - Asterisk(PackageImportItemAsterisk<'a>), +pub enum PackageImportItem { + Identifier(PackageImportItemIdentifier), + Asterisk(PackageImportItemAsterisk), } #[derive(Debug, Node)] -pub struct PackageImportItemIdentifier<'a> { - pub nodes: (PackageIdentifier<'a>, Symbol<'a>, Identifier<'a>), +pub struct PackageImportItemIdentifier { + pub nodes: (PackageIdentifier, Symbol, Identifier), } #[derive(Debug, Node)] -pub struct PackageImportItemAsterisk<'a> { - pub nodes: (PackageIdentifier<'a>, Symbol<'a>, Symbol<'a>), +pub struct PackageImportItemAsterisk { + pub nodes: (PackageIdentifier, Symbol, Symbol), } #[derive(Debug, Node)] -pub enum PackageExportDeclaration<'a> { - Asterisk(PackageExportDeclarationAsterisk<'a>), - Item(PackageExportDeclarationItem<'a>), +pub enum PackageExportDeclaration { + Asterisk(PackageExportDeclarationAsterisk), + Item(PackageExportDeclarationItem), } #[derive(Debug, Node)] -pub struct PackageExportDeclarationAsterisk<'a> { - pub nodes: (Keyword<'a>, Symbol<'a>, Symbol<'a>), +pub struct PackageExportDeclarationAsterisk { + pub nodes: (Keyword, Symbol, Symbol), } #[derive(Debug, Node)] -pub struct PackageExportDeclarationItem<'a> { +pub struct PackageExportDeclarationItem { pub nodes: ( - Keyword<'a>, - List, PackageImportItem<'a>>, - Symbol<'a>, + Keyword, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct GenvarDeclaration<'a> { - pub nodes: (Keyword<'a>, ListOfGenvarIdentifiers<'a>, Symbol<'a>), +pub struct GenvarDeclaration { + pub nodes: (Keyword, ListOfGenvarIdentifiers, Symbol), } #[derive(Debug, Node)] -pub enum NetDeclaration<'a> { - NetType(NetDeclarationNetType<'a>), - NetTypeIdentifier(NetDeclarationNetTypeIdentifier<'a>), - Interconnect(NetDeclarationInterconnect<'a>), +pub enum NetDeclaration { + NetType(NetDeclarationNetType), + NetTypeIdentifier(NetDeclarationNetTypeIdentifier), + Interconnect(NetDeclarationInterconnect), } #[derive(Debug, Node)] -pub struct NetDeclarationNetType<'a> { +pub struct NetDeclarationNetType { pub nodes: ( - NetType<'a>, - Option>, - Option>, - Option>, - Option>, - ListOfNetDeclAssignments<'a>, - Symbol<'a>, + NetType, + Option, + Option, + Option, + Option, + ListOfNetDeclAssignments, + Symbol, ), } #[derive(Debug, Node)] -pub enum Strength<'a> { - Drive(DriveStrength<'a>), - Charge(ChargeStrength<'a>), +pub enum Strength { + Drive(DriveStrength), + Charge(ChargeStrength), } #[derive(Debug, Node)] -pub enum VectorScalar<'a> { - Vectored(Keyword<'a>), - Scalared(Keyword<'a>), +pub enum VectorScalar { + Vectored(Keyword), + Scalared(Keyword), } #[derive(Debug, Node)] -pub struct NetDeclarationNetTypeIdentifier<'a> { +pub struct NetDeclarationNetTypeIdentifier { pub nodes: ( - NetTypeIdentifier<'a>, - Option>, - ListOfNetDeclAssignments<'a>, - Symbol<'a>, + NetTypeIdentifier, + Option, + ListOfNetDeclAssignments, + Symbol, ), } #[derive(Debug, Node)] -pub struct NetDeclarationInterconnect<'a> { +pub struct NetDeclarationInterconnect { pub nodes: ( - Keyword<'a>, - ImplicitDataType<'a>, - Option<(Symbol<'a>, DelayValue<'a>)>, - NetIdentifier<'a>, - Vec>, - Option<(Symbol<'a>, NetIdentifier<'a>, Vec>)>, - Symbol<'a>, + Keyword, + ImplicitDataType, + Option<(Symbol, DelayValue)>, + NetIdentifier, + Vec, + Option<(Symbol, NetIdentifier, Vec)>, + Symbol, ), } #[derive(Debug, Node)] -pub enum TypeDeclaration<'a> { - DataType(TypeDeclarationDataType<'a>), - Interface(TypeDeclarationInterface<'a>), - Reserved(TypeDeclarationReserved<'a>), +pub enum TypeDeclaration { + DataType(TypeDeclarationDataType), + Interface(TypeDeclarationInterface), + Reserved(TypeDeclarationReserved), } #[derive(Debug, Node)] -pub struct TypeDeclarationDataType<'a> { +pub struct TypeDeclarationDataType { pub nodes: ( - Keyword<'a>, - DataType<'a>, - TypeIdentifier<'a>, - Vec>, - Symbol<'a>, + Keyword, + DataType, + TypeIdentifier, + Vec, + Symbol, ), } #[derive(Debug, Node)] -pub struct TypeDeclarationInterface<'a> { +pub struct TypeDeclarationInterface { pub nodes: ( - Keyword<'a>, - InterfaceInstanceIdentifier<'a>, - ConstantBitSelect<'a>, - Symbol<'a>, - TypeIdentifier<'a>, - TypeIdentifier<'a>, - Symbol<'a>, + Keyword, + InterfaceInstanceIdentifier, + ConstantBitSelect, + Symbol, + TypeIdentifier, + TypeIdentifier, + Symbol, ), } #[derive(Debug, Node)] -pub struct TypeDeclarationReserved<'a> { +pub struct TypeDeclarationReserved { pub nodes: ( - Keyword<'a>, - Option>, - TypeIdentifier<'a>, - Symbol<'a>, + Keyword, + Option, + TypeIdentifier, + Symbol, ), } #[derive(Debug, Node)] -pub enum TypeDeclarationKeyword<'a> { - Enum(Keyword<'a>), - Struct(Keyword<'a>), - Union(Keyword<'a>), - Class(Keyword<'a>), - InterfaceClass((Keyword<'a>, Keyword<'a>)), +pub enum TypeDeclarationKeyword { + Enum(Keyword), + Struct(Keyword), + Union(Keyword), + Class(Keyword), + InterfaceClass((Keyword, Keyword)), } #[derive(Debug, Node)] -pub enum NetTypeDeclaration<'a> { - DataType(NetTypeDeclarationDataType<'a>), - NetType(NetTypeDeclarationNetType<'a>), +pub enum NetTypeDeclaration { + DataType(NetTypeDeclarationDataType), + NetType(NetTypeDeclarationNetType), } #[derive(Debug, Node)] -pub struct NetTypeDeclarationDataType<'a> { +pub struct NetTypeDeclarationDataType { pub nodes: ( - Keyword<'a>, - DataType<'a>, - NetTypeIdentifier<'a>, + Keyword, + DataType, + NetTypeIdentifier, Option<( - Keyword<'a>, - Option>, - TfIdentifier<'a>, + Keyword, + Option, + TfIdentifier, )>, - Symbol<'a>, + Symbol, ), } #[derive(Debug, Node)] -pub struct NetTypeDeclarationNetType<'a> { +pub struct NetTypeDeclarationNetType { pub nodes: ( - Keyword<'a>, - Option>, - NetTypeIdentifier<'a>, - NetTypeIdentifier<'a>, - Symbol<'a>, + Keyword, + Option, + NetTypeIdentifier, + NetTypeIdentifier, + Symbol, ), } #[derive(Debug, Node)] -pub enum Lifetime<'a> { - Static(Keyword<'a>), - Automatic(Keyword<'a>), +pub enum Lifetime { + Static(Keyword), + Automatic(Keyword), } // ----------------------------------------------------------------------------- diff --git a/src/parser/expressions/concatenations.rs b/src/parser/expressions/concatenations.rs index 0ebdd15..4852894 100644 --- a/src/parser/expressions/concatenations.rs +++ b/src/parser/expressions/concatenations.rs @@ -8,99 +8,99 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct Concatenation<'a> { - pub nodes: (Brace<'a, List, Expression<'a>>>,), +pub struct Concatenation { + pub nodes: (Brace< List>,), } #[derive(Debug, Node)] -pub struct ConstantConcatenation<'a> { - pub nodes: (Brace<'a, List, ConstantExpression<'a>>>,), +pub struct ConstantConcatenation { + pub nodes: (Brace< List>,), } #[derive(Debug, Node)] -pub struct ConstantMultipleConcatenation<'a> { - pub nodes: (Brace<'a, (ConstantExpression<'a>, ConstantConcatenation<'a>)>,), +pub struct ConstantMultipleConcatenation { + pub nodes: (Brace< (ConstantExpression, ConstantConcatenation)>,), } #[derive(Debug, Node)] -pub struct ModulePathConcatenation<'a> { - pub nodes: (Brace<'a, List, ModulePathExpression<'a>>>,), +pub struct ModulePathConcatenation { + pub nodes: (Brace< List>,), } #[derive(Debug, Node)] -pub struct ModulePathMultipleConcatenation<'a> { - pub nodes: (Brace<'a, (ConstantExpression<'a>, ModulePathConcatenation<'a>)>,), +pub struct ModulePathMultipleConcatenation { + pub nodes: (Brace< (ConstantExpression, ModulePathConcatenation)>,), } #[derive(Debug, Node)] -pub struct MultipleConcatenation<'a> { - pub nodes: (Brace<'a, (Expression<'a>, Concatenation<'a>)>,), +pub struct MultipleConcatenation { + pub nodes: (Brace< (Expression, Concatenation)>,), } #[derive(Debug, Node)] -pub struct StreamingConcatenation<'a> { +pub struct StreamingConcatenation { pub nodes: ( Brace< - 'a, + ( - StreamOperator<'a>, - Option>, - StreamConcatenation<'a>, + StreamOperator, + Option, + StreamConcatenation, ), >, ), } #[derive(Debug, Node)] -pub struct StreamOperator<'a> { - pub nodes: (Symbol<'a>,), +pub struct StreamOperator { + pub nodes: (Symbol,), } #[derive(Debug, Node)] -pub enum SliceSize<'a> { - SimpleType(SimpleType<'a>), - ConstantExpression(ConstantExpression<'a>), +pub enum SliceSize { + SimpleType(SimpleType), + ConstantExpression(ConstantExpression), } #[derive(Debug, Node)] -pub struct StreamConcatenation<'a> { - pub nodes: (Brace<'a, List, StreamExpression<'a>>>,), +pub struct StreamConcatenation { + pub nodes: (Brace< List>,), } #[derive(Debug, Node)] -pub struct StreamExpression<'a> { +pub struct StreamExpression { pub nodes: ( - Expression<'a>, - Option<(Keyword<'a>, Bracket<'a, ArrayRangeExpression<'a>>)>, + Expression, + Option<(Keyword, Bracket< ArrayRangeExpression>)>, ), } #[derive(Debug, Node)] -pub enum ArrayRangeExpression<'a> { - Expression(Expression<'a>), - Colon(ArrayRangeExpressionColon<'a>), - PlusColon(ArrayRangeExpressionPlusColon<'a>), - MinusColon(ArrayRangeExpressionMinusColon<'a>), +pub enum ArrayRangeExpression { + Expression(Expression), + Colon(ArrayRangeExpressionColon), + PlusColon(ArrayRangeExpressionPlusColon), + MinusColon(ArrayRangeExpressionMinusColon), } #[derive(Debug, Node)] -pub struct ArrayRangeExpressionColon<'a> { - pub nodes: (Expression<'a>, Symbol<'a>, Expression<'a>), +pub struct ArrayRangeExpressionColon { + pub nodes: (Expression, Symbol, Expression), } #[derive(Debug, Node)] -pub struct ArrayRangeExpressionPlusColon<'a> { - pub nodes: (Expression<'a>, Symbol<'a>, Expression<'a>), +pub struct ArrayRangeExpressionPlusColon { + pub nodes: (Expression, Symbol, Expression), } #[derive(Debug, Node)] -pub struct ArrayRangeExpressionMinusColon<'a> { - pub nodes: (Expression<'a>, Symbol<'a>, Expression<'a>), +pub struct ArrayRangeExpressionMinusColon { + pub nodes: (Expression, Symbol, Expression), } #[derive(Debug, Node)] -pub struct EmptyUnpackedArrayConcatenation<'a> { - pub nodes: (Symbol<'a>, Symbol<'a>), +pub struct EmptyUnpackedArrayConcatenation { + pub nodes: (Symbol, Symbol), } // ----------------------------------------------------------------------------- diff --git a/src/parser/expressions/expression_leftside_values.rs b/src/parser/expressions/expression_leftside_values.rs index 9d86e0a..64b0690 100644 --- a/src/parser/expressions/expression_leftside_values.rs +++ b/src/parser/expressions/expression_leftside_values.rs @@ -7,66 +7,66 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum NetLvalue<'a> { - Identifier(NetLvalueIdentifier<'a>), - Lvalue(Box>), - Pattern(Box>), +pub enum NetLvalue { + Identifier(NetLvalueIdentifier), + Lvalue(Box), + Pattern(Box), } #[derive(Debug, Node)] -pub struct NetLvalueIdentifier<'a> { - pub nodes: (PsOrHierarchicalNetIdentifier<'a>, ConstantSelect<'a>), +pub struct NetLvalueIdentifier { + pub nodes: (PsOrHierarchicalNetIdentifier, ConstantSelect), } #[derive(Debug, Node)] -pub struct NetLvalueLvalue<'a> { - pub nodes: (Brace<'a, List, NetLvalue<'a>>>,), +pub struct NetLvalueLvalue { + pub nodes: (Brace>,), } #[derive(Debug, Node)] -pub struct NetLvaluePattern<'a> { +pub struct NetLvaluePattern { pub nodes: ( - Option>, - AssignmentPatternNetLvalue<'a>, + Option, + AssignmentPatternNetLvalue, ), } #[derive(Debug, Node)] -pub enum VariableLvalue<'a> { - Identifier(VariableLvalueIdentifier<'a>), - Lvalue(Box>), - Pattern(Box>), - StreamingConcatenation(StreamingConcatenation<'a>), +pub enum VariableLvalue { + Identifier(VariableLvalueIdentifier), + Lvalue(Box), + Pattern(Box), + StreamingConcatenation(StreamingConcatenation), } #[derive(Debug, Node)] -pub struct VariableLvalueIdentifier<'a> { +pub struct VariableLvalueIdentifier { pub nodes: ( - Option>, - HierarchicalVariableIdentifier<'a>, - Select<'a>, + Option, + HierarchicalVariableIdentifier, + Select, ), } #[derive(Debug, Node)] -pub struct VariableLvalueLvalue<'a> { - pub nodes: (Brace<'a, List, VariableLvalue<'a>>>,), +pub struct VariableLvalueLvalue { + pub nodes: (Brace>,), } #[derive(Debug, Node)] -pub struct VariableLvaluePattern<'a> { +pub struct VariableLvaluePattern { pub nodes: ( - Option>, - AssignmentPatternVariableLvalue<'a>, + Option, + AssignmentPatternVariableLvalue, ), } #[derive(Debug, Node)] -pub struct NonrangeVariableLvalue<'a> { +pub struct NonrangeVariableLvalue { pub nodes: ( - Option>, - HierarchicalVariableIdentifier<'a>, - NonrangeSelect<'a>, + Option, + HierarchicalVariableIdentifier, + NonrangeSelect, ), } diff --git a/src/parser/expressions/expressions.rs b/src/parser/expressions/expressions.rs index 573e6ea..bfcb237 100644 --- a/src/parser/expressions/expressions.rs +++ b/src/parser/expressions/expressions.rs @@ -8,273 +8,273 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum IncOrDecExpression<'a> { - Prefix(IncOrDecExpressionPrefix<'a>), - Suffix(IncOrDecExpressionSuffix<'a>), +pub enum IncOrDecExpression { + Prefix(IncOrDecExpressionPrefix), + Suffix(IncOrDecExpressionSuffix), } #[derive(Debug, Node)] -pub struct IncOrDecExpressionPrefix<'a> { +pub struct IncOrDecExpressionPrefix { pub nodes: ( - IncOrDecOperator<'a>, - Vec>, - VariableLvalue<'a>, + IncOrDecOperator, + Vec, + VariableLvalue, ), } #[derive(Debug, Node)] -pub struct IncOrDecExpressionSuffix<'a> { +pub struct IncOrDecExpressionSuffix { pub nodes: ( - VariableLvalue<'a>, - Vec>, - IncOrDecOperator<'a>, + VariableLvalue, + Vec, + IncOrDecOperator, ), } #[derive(Debug, Node)] -pub struct ConditionalExpression<'a> { +pub struct ConditionalExpression { pub nodes: ( - CondPredicate<'a>, - Symbol<'a>, - Vec>, - Expression<'a>, - Symbol<'a>, - Expression<'a>, + CondPredicate, + Symbol, + Vec, + Expression, + Symbol, + Expression, ), } #[derive(Debug, Node)] -pub enum ConstantExpression<'a> { - ConstantPrimary(Box>), - Unary(Box>), - Binary(Box>), - Ternary(Box>), +pub enum ConstantExpression { + ConstantPrimary(Box), + Unary(Box), + Binary(Box), + Ternary(Box), } #[derive(Debug, Node)] -pub struct ConstantExpressionUnary<'a> { +pub struct ConstantExpressionUnary { pub nodes: ( - UnaryOperator<'a>, - Vec>, - ConstantPrimary<'a>, + UnaryOperator, + Vec, + ConstantPrimary, ), } #[derive(Debug, Node)] -pub struct ConstantExpressionBinary<'a> { +pub struct ConstantExpressionBinary { pub nodes: ( - ConstantExpression<'a>, - BinaryOperator<'a>, - Vec>, - ConstantExpression<'a>, + ConstantExpression, + BinaryOperator, + Vec, + ConstantExpression, ), } #[derive(Debug, Node)] -pub struct ConstantExpressionTernary<'a> { +pub struct ConstantExpressionTernary { pub nodes: ( - ConstantExpression<'a>, - Symbol<'a>, - Vec>, - ConstantExpression<'a>, - Symbol<'a>, - ConstantExpression<'a>, + ConstantExpression, + Symbol, + Vec, + ConstantExpression, + Symbol, + ConstantExpression, ), } #[derive(Debug, Node)] -pub enum ConstantMintypmaxExpression<'a> { - Unary(ConstantExpression<'a>), - Ternary(ConstantMintypmaxExpressionTernary<'a>), +pub enum ConstantMintypmaxExpression { + Unary(ConstantExpression), + Ternary(ConstantMintypmaxExpressionTernary), } #[derive(Debug, Node)] -pub struct ConstantMintypmaxExpressionTernary<'a> { +pub struct ConstantMintypmaxExpressionTernary { pub nodes: ( - ConstantExpression<'a>, - Symbol<'a>, - ConstantExpression<'a>, - Symbol<'a>, - ConstantExpression<'a>, + ConstantExpression, + Symbol, + ConstantExpression, + Symbol, + ConstantExpression, ), } #[derive(Debug, Node)] -pub enum ConstantParamExpression<'a> { - ConstantMintypmaxExpression(ConstantMintypmaxExpression<'a>), - DataType(DataType<'a>), - Dollar(Symbol<'a>), +pub enum ConstantParamExpression { + ConstantMintypmaxExpression(ConstantMintypmaxExpression), + DataType(DataType), + Dollar(Symbol), } #[derive(Debug, Node)] -pub enum ParamExpression<'a> { - MintypmaxExpression(MintypmaxExpression<'a>), - DataType(Box>), - Dollar(Symbol<'a>), +pub enum ParamExpression { + MintypmaxExpression(MintypmaxExpression), + DataType(Box), + Dollar(Symbol), } #[derive(Debug, Node)] -pub enum ConstantRangeExpression<'a> { - ConstantExpression(ConstantExpression<'a>), - ConstantPartSelectRange(ConstantPartSelectRange<'a>), +pub enum ConstantRangeExpression { + ConstantExpression(ConstantExpression), + ConstantPartSelectRange(ConstantPartSelectRange), } #[derive(Debug, Node)] -pub enum ConstantPartSelectRange<'a> { - ConstantRange(ConstantRange<'a>), - ConstantIndexedRange(ConstantIndexedRange<'a>), +pub enum ConstantPartSelectRange { + ConstantRange(ConstantRange), + ConstantIndexedRange(ConstantIndexedRange), } #[derive(Debug, Node)] -pub struct ConstantRange<'a> { - pub nodes: (ConstantExpression<'a>, Symbol<'a>, ConstantExpression<'a>), +pub struct ConstantRange { + pub nodes: (ConstantExpression, Symbol, ConstantExpression), } #[derive(Debug, Node)] -pub struct ConstantIndexedRange<'a> { - pub nodes: (ConstantExpression<'a>, Symbol<'a>, ConstantExpression<'a>), +pub struct ConstantIndexedRange { + pub nodes: (ConstantExpression, Symbol, ConstantExpression), } #[derive(Debug, Node)] -pub enum Expression<'a> { - Primary(Box>), - Unary(Box>), - IncOrDecExpression(Box>), - OperatorAssignment(Box>), - Binary(Box>), - ConditionalExpression(Box>), - InsideExpression(Box>), - TaggedUnionExpression(Box>), +pub enum Expression { + Primary(Box), + Unary(Box), + IncOrDecExpression(Box), + OperatorAssignment(Box), + Binary(Box), + ConditionalExpression(Box), + InsideExpression(Box), + TaggedUnionExpression(Box), } #[derive(Debug, Node)] -pub struct ExpressionUnary<'a> { - pub nodes: (UnaryOperator<'a>, Vec>, Primary<'a>), +pub struct ExpressionUnary { + pub nodes: (UnaryOperator, Vec, Primary), } #[derive(Debug, Node)] -pub struct ExpressionOperatorAssignment<'a> { - pub nodes: (Paren<'a, OperatorAssignment<'a>>,), +pub struct ExpressionOperatorAssignment { + pub nodes: (Paren< OperatorAssignment>,), } #[derive(Debug, Node)] -pub struct ExpressionBinary<'a> { +pub struct ExpressionBinary { pub nodes: ( - Expression<'a>, - BinaryOperator<'a>, - Vec>, - Expression<'a>, + Expression, + BinaryOperator, + Vec, + Expression, ), } #[derive(Debug, Node)] -pub struct TaggedUnionExpression<'a> { - pub nodes: (Keyword<'a>, MemberIdentifier<'a>, Option>), +pub struct TaggedUnionExpression { + pub nodes: (Keyword, MemberIdentifier, Option), } #[derive(Debug, Node)] -pub struct InsideExpression<'a> { - pub nodes: (Expression<'a>, Keyword<'a>, Brace<'a, OpenRangeList<'a>>), +pub struct InsideExpression { + pub nodes: (Expression, Keyword, Brace< OpenRangeList>), } #[derive(Debug, Node)] -pub enum ValueRange<'a> { - Expression(Expression<'a>), - Binary(ValueRangeBinary<'a>), +pub enum ValueRange { + Expression(Expression), + Binary(ValueRangeBinary), } #[derive(Debug, Node)] -pub struct ValueRangeBinary<'a> { - pub nodes: (Bracket<'a, (Expression<'a>, Symbol<'a>, Expression<'a>)>,), +pub struct ValueRangeBinary { + pub nodes: (Bracket< (Expression, Symbol, Expression)>,), } #[derive(Debug, Node)] -pub enum MintypmaxExpression<'a> { - Expression(Expression<'a>), - Ternary(MintypmaxExpressionTernary<'a>), +pub enum MintypmaxExpression { + Expression(Expression), + Ternary(MintypmaxExpressionTernary), } #[derive(Debug, Node)] -pub struct MintypmaxExpressionTernary<'a> { +pub struct MintypmaxExpressionTernary { pub nodes: ( - Expression<'a>, - Symbol<'a>, - Expression<'a>, - Symbol<'a>, - Expression<'a>, + Expression, + Symbol, + Expression, + Symbol, + Expression, ), } #[derive(Debug, Node)] -pub struct ModulePathConditionalExpression<'a> { +pub struct ModulePathConditionalExpression { pub nodes: ( - ModulePathExpression<'a>, - Symbol<'a>, - Vec>, - ModulePathExpression<'a>, - Symbol<'a>, - ModulePathExpression<'a>, + ModulePathExpression, + Symbol, + Vec, + ModulePathExpression, + Symbol, + ModulePathExpression, ), } #[derive(Debug, Node)] -pub enum ModulePathExpression<'a> { - ModulePathPrimary(Box>), - Unary(Box>), - Binary(Box>), - ModulePathConditionalExpression(Box>), +pub enum ModulePathExpression { + ModulePathPrimary(Box), + Unary(Box), + Binary(Box), + ModulePathConditionalExpression(Box), } #[derive(Debug, Node)] -pub struct ModulePathExpressionUnary<'a> { +pub struct ModulePathExpressionUnary { pub nodes: ( - UnaryModulePathOperator<'a>, - Vec>, - ModulePathPrimary<'a>, + UnaryModulePathOperator, + Vec, + ModulePathPrimary, ), } #[derive(Debug, Node)] -pub struct ModulePathExpressionBinary<'a> { +pub struct ModulePathExpressionBinary { pub nodes: ( - ModulePathExpression<'a>, - BinaryModulePathOperator<'a>, - Vec>, - ModulePathExpression<'a>, + ModulePathExpression, + BinaryModulePathOperator, + Vec, + ModulePathExpression, ), } #[derive(Debug, Node)] -pub enum ModulePathMintypmaxExpression<'a> { - ModulePathExpression(ModulePathExpression<'a>), - Ternary(ModulePathMintypmaxExpressionTernary<'a>), +pub enum ModulePathMintypmaxExpression { + ModulePathExpression(ModulePathExpression), + Ternary(ModulePathMintypmaxExpressionTernary), } #[derive(Debug, Node)] -pub struct ModulePathMintypmaxExpressionTernary<'a> { +pub struct ModulePathMintypmaxExpressionTernary { pub nodes: ( - ModulePathExpression<'a>, - Symbol<'a>, - ModulePathExpression<'a>, - Symbol<'a>, - ModulePathExpression<'a>, + ModulePathExpression, + Symbol, + ModulePathExpression, + Symbol, + ModulePathExpression, ), } #[derive(Debug, Node)] -pub enum PartSelectRange<'a> { - ConstantRange(ConstantRange<'a>), - IndexedRange(IndexedRange<'a>), +pub enum PartSelectRange { + ConstantRange(ConstantRange), + IndexedRange(IndexedRange), } #[derive(Debug, Node)] -pub struct IndexedRange<'a> { - pub nodes: (Expression<'a>, Symbol<'a>, ConstantExpression<'a>), +pub struct IndexedRange { + pub nodes: (Expression, Symbol, ConstantExpression), } #[derive(Debug, Node)] -pub struct GenvarExpression<'a> { - pub nodes: (ConstantExpression<'a>,), +pub struct GenvarExpression { + pub nodes: (ConstantExpression,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/expressions/numbers.rs b/src/parser/expressions/numbers.rs index 8614f97..e41b6d1 100644 --- a/src/parser/expressions/numbers.rs +++ b/src/parser/expressions/numbers.rs @@ -11,153 +11,153 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum Number<'a> { - IntegralNumber(IntegralNumber<'a>), - RealNumber(RealNumber<'a>), +pub enum Number { + IntegralNumber(IntegralNumber), + RealNumber(RealNumber), } #[derive(Debug, Node)] -pub enum IntegralNumber<'a> { - DecimalNumber(DecimalNumber<'a>), - OctalNumber(OctalNumber<'a>), - BinaryNumber(BinaryNumber<'a>), - HexNumber(HexNumber<'a>), +pub enum IntegralNumber { + DecimalNumber(DecimalNumber), + OctalNumber(OctalNumber), + BinaryNumber(BinaryNumber), + HexNumber(HexNumber), } #[derive(Debug, Node)] -pub enum DecimalNumber<'a> { - UnsignedNumber(UnsignedNumber<'a>), - BaseUnsigned(DecimalNumberBaseUnsigned<'a>), - BaseXNumber(DecimalNumberBaseXNumber<'a>), - BaseZNumber(DecimalNumberBaseZNumber<'a>), +pub enum DecimalNumber { + UnsignedNumber(UnsignedNumber), + BaseUnsigned(DecimalNumberBaseUnsigned), + BaseXNumber(DecimalNumberBaseXNumber), + BaseZNumber(DecimalNumberBaseZNumber), } #[derive(Debug, Node)] -pub struct DecimalNumberBaseUnsigned<'a> { - pub nodes: (Option>, DecimalBase<'a>, UnsignedNumber<'a>), +pub struct DecimalNumberBaseUnsigned { + pub nodes: (Option, DecimalBase, UnsignedNumber), } #[derive(Debug, Node)] -pub struct DecimalNumberBaseXNumber<'a> { - pub nodes: (Option>, DecimalBase<'a>, XNumber<'a>), +pub struct DecimalNumberBaseXNumber { + pub nodes: (Option, DecimalBase, XNumber), } #[derive(Debug, Node)] -pub struct DecimalNumberBaseZNumber<'a> { - pub nodes: (Option>, DecimalBase<'a>, ZNumber<'a>), +pub struct DecimalNumberBaseZNumber { + pub nodes: (Option, DecimalBase, ZNumber), } #[derive(Debug, Node)] -pub struct BinaryNumber<'a> { - pub nodes: (Option>, BinaryBase<'a>, BinaryValue<'a>), +pub struct BinaryNumber { + pub nodes: (Option, BinaryBase, BinaryValue), } #[derive(Debug, Node)] -pub struct OctalNumber<'a> { - pub nodes: (Option>, OctalBase<'a>, OctalValue<'a>), +pub struct OctalNumber { + pub nodes: (Option, OctalBase, OctalValue), } #[derive(Debug, Node)] -pub struct HexNumber<'a> { - pub nodes: (Option>, HexBase<'a>, HexValue<'a>), +pub struct HexNumber { + pub nodes: (Option, HexBase, HexValue), } #[derive(Debug, Node)] -pub enum Sign<'a> { - Plus(Symbol<'a>), - Minus(Symbol<'a>), +pub enum Sign { + Plus(Symbol), + Minus(Symbol), } #[derive(Debug, Node)] -pub struct Size<'a> { - pub nodes: (NonZeroUnsignedNumber<'a>,), +pub struct Size { + pub nodes: (NonZeroUnsignedNumber,), } #[derive(Debug, Node)] -pub struct NonZeroUnsignedNumber<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct NonZeroUnsignedNumber { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub enum RealNumber<'a> { - FixedPointNumber(FixedPointNumber<'a>), - Floating(RealNumberFloating<'a>), +pub enum RealNumber { + FixedPointNumber(FixedPointNumber), + Floating(RealNumberFloating), } #[derive(Debug, Node)] -pub struct RealNumberFloating<'a> { +pub struct RealNumberFloating { pub nodes: ( - UnsignedNumber<'a>, - Option<(Symbol<'a>, UnsignedNumber<'a>)>, - Exp<'a>, - Option>, - UnsignedNumber<'a>, + UnsignedNumber, + Option<(Symbol, UnsignedNumber)>, + Exp, + Option, + UnsignedNumber, ), } #[derive(Debug, Node)] -pub struct FixedPointNumber<'a> { - pub nodes: (UnsignedNumber<'a>, Symbol<'a>, UnsignedNumber<'a>), +pub struct FixedPointNumber { + pub nodes: (UnsignedNumber, Symbol, UnsignedNumber), } #[derive(Debug, Node)] -pub struct Exp<'a> { - pub nodes: (Symbol<'a>,), +pub struct Exp { + pub nodes: (Symbol,), } #[derive(Debug, Node)] -pub struct UnsignedNumber<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct UnsignedNumber { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct BinaryValue<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct BinaryValue { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct OctalValue<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct OctalValue { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct HexValue<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct HexValue { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct DecimalBase<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct DecimalBase { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct BinaryBase<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct BinaryBase { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct OctalBase<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct OctalBase { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct HexBase<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct HexBase { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct XNumber<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct XNumber { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct ZNumber<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct ZNumber { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct UnbasedUnsizedLiteral<'a> { - pub nodes: (Symbol<'a>,), +pub struct UnbasedUnsizedLiteral { + pub nodes: (Symbol,), } // ----------------------------------------------------------------------------- @@ -268,11 +268,12 @@ pub fn non_zero_unsigned_number(s: Span) -> IResult } #[parser] -pub fn non_zero_unsigned_number_impl(s: Span) -> IResult { +pub fn non_zero_unsigned_number_impl(s: Span) -> IResult { let (s, a) = is_a("123456789")(s)?; - fold_many0(alt((tag("_"), digit1)), a, |acc, item| { + let (s, a) = fold_many0(alt((tag("_"), digit1)), a, |acc, item| { concat(acc, item).unwrap() - })(s) + })(s)?; + Ok((s, a.into())) } #[parser] @@ -301,7 +302,9 @@ pub fn real_number_floating(s: Span) -> IResult { #[parser] pub fn fixed_point_number(s: Span) -> IResult { let (s, a) = unsigned_number(s)?; - let (s, b) = map(tag("."), |x| Symbol { nodes: (x, vec![]) })(s)?;; + let (s, b) = map(tag("."), |x: Span| Symbol { + nodes: (x.into(), vec![]), + })(s)?; let (s, c) = unsigned_number(s)?; Ok((s, FixedPointNumber { nodes: (a, b, c) })) } @@ -319,11 +322,12 @@ pub fn unsigned_number(s: Span) -> IResult { } #[parser] -pub fn unsigned_number_impl(s: Span) -> IResult { +pub fn unsigned_number_impl(s: Span) -> IResult { let (s, a) = digit1(s)?; - fold_many0(alt((tag("_"), digit1)), a, |acc, item| { + let (s, a) = fold_many0(alt((tag("_"), digit1)), a, |acc, item| { concat(acc, item).unwrap() - })(s) + })(s)?; + Ok((s, a.into())) } #[parser] @@ -333,11 +337,12 @@ pub fn binary_value(s: Span) -> IResult { } #[parser] -pub fn binary_value_impl(s: Span) -> IResult { +pub fn binary_value_impl(s: Span) -> IResult { let (s, a) = is_a("01xXzZ?")(s)?; - fold_many0(alt((tag("_"), is_a("01xXzZ?"))), a, |acc, item| { + let (s, a) = fold_many0(alt((tag("_"), is_a("01xXzZ?"))), a, |acc, item| { concat(acc, item).unwrap() - })(s) + })(s)?; + Ok((s, a.into())) } #[parser] @@ -347,11 +352,12 @@ pub fn octal_value(s: Span) -> IResult { } #[parser] -pub fn octal_value_impl(s: Span) -> IResult { +pub fn octal_value_impl(s: Span) -> IResult { let (s, a) = is_a("01234567xXzZ?")(s)?; - fold_many0(alt((tag("_"), is_a("01234567xXzZ?"))), a, |acc, item| { + let (s, a) = fold_many0(alt((tag("_"), is_a("01234567xXzZ?"))), a, |acc, item| { concat(acc, item).unwrap() - })(s) + })(s)?; + Ok((s, a.into())) } #[parser] @@ -361,13 +367,14 @@ pub fn hex_value(s: Span) -> IResult { } #[parser] -pub fn hex_value_impl(s: Span) -> IResult { +pub fn hex_value_impl(s: Span) -> IResult { let (s, a) = is_a("0123456789abcdefABCDEFxXzZ?")(s)?; - fold_many0( + let (s, a) = fold_many0( alt((tag("_"), is_a("0123456789abcdefABCDEFxXzZ?"))), a, |acc, item| concat(acc, item).unwrap(), - )(s) + )(s)?; + Ok((s, a.into())) } #[parser] @@ -377,8 +384,9 @@ pub fn decimal_base(s: Span) -> IResult { } #[parser] -pub fn decimal_base_impl(s: Span) -> IResult { - alt((tag_no_case("'d"), tag_no_case("'sd")))(s) +pub fn decimal_base_impl(s: Span) -> IResult { + let (s, a) = alt((tag_no_case("'d"), tag_no_case("'sd")))(s)?; + Ok((s, a.into())) } #[parser] @@ -388,8 +396,9 @@ pub fn binary_base(s: Span) -> IResult { } #[parser] -pub fn binary_base_impl(s: Span) -> IResult { - alt((tag_no_case("'b"), tag_no_case("'sb")))(s) +pub fn binary_base_impl(s: Span) -> IResult { + let (s, a) = alt((tag_no_case("'b"), tag_no_case("'sb")))(s)?; + Ok((s, a.into())) } #[parser] @@ -399,8 +408,9 @@ pub fn octal_base(s: Span) -> IResult { } #[parser] -pub fn octal_base_impl(s: Span) -> IResult { - alt((tag_no_case("'o"), tag_no_case("'so")))(s) +pub fn octal_base_impl(s: Span) -> IResult { + let (s, a) = alt((tag_no_case("'o"), tag_no_case("'so")))(s)?; + Ok((s, a.into())) } #[parser] @@ -410,8 +420,9 @@ pub fn hex_base(s: Span) -> IResult { } #[parser] -pub fn hex_base_impl(s: Span) -> IResult { - alt((tag_no_case("'h"), tag_no_case("'sh")))(s) +pub fn hex_base_impl(s: Span) -> IResult { + let (s, a) = alt((tag_no_case("'h"), tag_no_case("'sh")))(s)?; + Ok((s, a.into())) } #[parser] @@ -421,11 +432,12 @@ pub fn x_number(s: Span) -> IResult { } #[parser] -pub fn x_number_impl(s: Span) -> IResult { +pub fn x_number_impl(s: Span) -> IResult { let (s, a) = tag_no_case("x")(s)?; - fold_many0(alt((tag("_"), is_a("_"))), a, |acc, item| { + let (s, a) = fold_many0(alt((tag("_"), is_a("_"))), a, |acc, item| { concat(acc, item).unwrap() - })(s) + })(s)?; + Ok((s, a.into())) } #[parser] @@ -435,11 +447,12 @@ pub fn z_number(s: Span) -> IResult { } #[parser] -pub fn z_number_impl(s: Span) -> IResult { +pub fn z_number_impl(s: Span) -> IResult { let (s, a) = alt((tag_no_case("z"), tag("?")))(s)?; - fold_many0(alt((tag("_"), is_a("_"))), a, |acc, item| { + let (s, a) = fold_many0(alt((tag("_"), is_a("_"))), a, |acc, item| { concat(acc, item).unwrap() - })(s) + })(s)?; + Ok((s, a.into())) } #[parser] diff --git a/src/parser/expressions/operators.rs b/src/parser/expressions/operators.rs index 887e2af..bb519aa 100644 --- a/src/parser/expressions/operators.rs +++ b/src/parser/expressions/operators.rs @@ -6,28 +6,28 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct UnaryOperator<'a> { - pub nodes: (Symbol<'a>,), +pub struct UnaryOperator { + pub nodes: (Symbol,), } #[derive(Debug, Node)] -pub struct BinaryOperator<'a> { - pub nodes: (Symbol<'a>,), +pub struct BinaryOperator { + pub nodes: (Symbol,), } #[derive(Debug, Node)] -pub struct IncOrDecOperator<'a> { - pub nodes: (Symbol<'a>,), +pub struct IncOrDecOperator { + pub nodes: (Symbol,), } #[derive(Debug, Node)] -pub struct UnaryModulePathOperator<'a> { - pub nodes: (Symbol<'a>,), +pub struct UnaryModulePathOperator { + pub nodes: (Symbol,), } #[derive(Debug, Node)] -pub struct BinaryModulePathOperator<'a> { - pub nodes: (Symbol<'a>,), +pub struct BinaryModulePathOperator { + pub nodes: (Symbol,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/expressions/primaries.rs b/src/parser/expressions/primaries.rs index 520ea3b..519fbe8 100644 --- a/src/parser/expressions/primaries.rs +++ b/src/parser/expressions/primaries.rs @@ -8,255 +8,255 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum ConstantPrimary<'a> { - PrimaryLiteral(PrimaryLiteral<'a>), - PsParameter(ConstantPrimaryPsParameter<'a>), - Specparam(ConstantPrimarySpecparam<'a>), - GenvarIdentifier(GenvarIdentifier<'a>), - FormalPort(ConstantPrimaryFormalPort<'a>), - Enum(ConstantPrimaryEnum<'a>), - Concatenation(ConstantPrimaryConcatenation<'a>), - MultipleConcatenation(ConstantPrimaryMultipleConcatenation<'a>), - ConstantFunctionCall(ConstantFunctionCall<'a>), - ConstantLetExpression(ConstantLetExpression<'a>), - MintypmaxExpression(ConstantPrimaryMintypmaxExpression<'a>), - ConstantCast(ConstantCast<'a>), - ConstantAssignmentPatternExpression(ConstantAssignmentPatternExpression<'a>), - TypeReference(TypeReference<'a>), - Null(Keyword<'a>), +pub enum ConstantPrimary { + PrimaryLiteral(PrimaryLiteral), + PsParameter(ConstantPrimaryPsParameter), + Specparam(ConstantPrimarySpecparam), + GenvarIdentifier(GenvarIdentifier), + FormalPort(ConstantPrimaryFormalPort), + Enum(ConstantPrimaryEnum), + Concatenation(ConstantPrimaryConcatenation), + MultipleConcatenation(ConstantPrimaryMultipleConcatenation), + ConstantFunctionCall(ConstantFunctionCall), + ConstantLetExpression(ConstantLetExpression), + MintypmaxExpression(ConstantPrimaryMintypmaxExpression), + ConstantCast(ConstantCast), + ConstantAssignmentPatternExpression(ConstantAssignmentPatternExpression), + TypeReference(TypeReference), + Null(Keyword), } #[derive(Debug, Node)] -pub struct ConstantPrimaryPsParameter<'a> { - pub nodes: (PsParameterIdentifier<'a>, ConstantSelect<'a>), +pub struct ConstantPrimaryPsParameter { + pub nodes: (PsParameterIdentifier, ConstantSelect), } #[derive(Debug, Node)] -pub struct ConstantPrimarySpecparam<'a> { +pub struct ConstantPrimarySpecparam { pub nodes: ( - SpecparamIdentifier<'a>, - Option>>, + SpecparamIdentifier, + Option>, ), } #[derive(Debug, Node)] -pub struct ConstantPrimaryFormalPort<'a> { - pub nodes: (FormalPortIdentifier<'a>, ConstantSelect<'a>), +pub struct ConstantPrimaryFormalPort { + pub nodes: (FormalPortIdentifier, ConstantSelect), } #[derive(Debug, Node)] -pub struct ConstantPrimaryEnum<'a> { - pub nodes: (PackageScopeOrClassScope<'a>, EnumIdentifier<'a>), +pub struct ConstantPrimaryEnum { + pub nodes: (PackageScopeOrClassScope, EnumIdentifier), } #[derive(Debug, Node)] -pub struct ConstantPrimaryConcatenation<'a> { +pub struct ConstantPrimaryConcatenation { pub nodes: ( - ConstantConcatenation<'a>, - Option>>, + ConstantConcatenation, + Option>, ), } #[derive(Debug, Node)] -pub struct ConstantPrimaryMultipleConcatenation<'a> { +pub struct ConstantPrimaryMultipleConcatenation { pub nodes: ( - ConstantMultipleConcatenation<'a>, - Option>>, + ConstantMultipleConcatenation, + Option>, ), } #[derive(Debug, Node)] -pub struct ConstantPrimaryMintypmaxExpression<'a> { - pub nodes: (Paren<'a, ConstantMintypmaxExpression<'a>>,), +pub struct ConstantPrimaryMintypmaxExpression { + pub nodes: (Paren< ConstantMintypmaxExpression>,), } #[derive(Debug, Node)] -pub enum ModulePathPrimary<'a> { - Number(Number<'a>), - Identifier(Identifier<'a>), - ModulePathConcatenation(ModulePathConcatenation<'a>), - ModulePathMultipleConcatenation(ModulePathMultipleConcatenation<'a>), - FunctionSubroutineCall(FunctionSubroutineCall<'a>), - Mintypmax(ModulePathPrimaryMintypmax<'a>), +pub enum ModulePathPrimary { + Number(Number), + Identifier(Identifier), + ModulePathConcatenation(ModulePathConcatenation), + ModulePathMultipleConcatenation(ModulePathMultipleConcatenation), + FunctionSubroutineCall(FunctionSubroutineCall), + Mintypmax(ModulePathPrimaryMintypmax), } #[derive(Debug, Node)] -pub struct ModulePathPrimaryMintypmax<'a> { - pub nodes: (Paren<'a, ModulePathMintypmaxExpression<'a>>,), +pub struct ModulePathPrimaryMintypmax { + pub nodes: (Paren< ModulePathMintypmaxExpression>,), } #[derive(Debug, Node)] -pub enum Primary<'a> { - PrimaryLiteral(PrimaryLiteral<'a>), - Hierarchical(PrimaryHierarchical<'a>), - EmptyUnpackedArrayConcatenation(EmptyUnpackedArrayConcatenation<'a>), - Concatenation(PrimaryConcatenation<'a>), - MultipleConcatenation(PrimaryMultipleConcatenation<'a>), - FunctionSubroutineCall(FunctionSubroutineCall<'a>), - LetExpression(LetExpression<'a>), - MintypmaxExpression(PrimaryMintypmaxExpression<'a>), - Cast(Cast<'a>), - AssignmentPatternExpression(AssignmentPatternExpression<'a>), - StreamingConcatenation(StreamingConcatenation<'a>), - SequenceMethodCall(SequenceMethodCall<'a>), - This(Keyword<'a>), - Dollar(Symbol<'a>), - Null(Keyword<'a>), +pub enum Primary { + PrimaryLiteral(PrimaryLiteral), + Hierarchical(PrimaryHierarchical), + EmptyUnpackedArrayConcatenation(EmptyUnpackedArrayConcatenation), + Concatenation(PrimaryConcatenation), + MultipleConcatenation(PrimaryMultipleConcatenation), + FunctionSubroutineCall(FunctionSubroutineCall), + LetExpression(LetExpression), + MintypmaxExpression(PrimaryMintypmaxExpression), + Cast(Cast), + AssignmentPatternExpression(AssignmentPatternExpression), + StreamingConcatenation(StreamingConcatenation), + SequenceMethodCall(SequenceMethodCall), + This(Keyword), + Dollar(Symbol), + Null(Keyword), } #[derive(Debug, Node)] -pub struct PrimaryHierarchical<'a> { +pub struct PrimaryHierarchical { pub nodes: ( - Option>, - HierarchicalIdentifier<'a>, - Select<'a>, + Option, + HierarchicalIdentifier, + Select, ), } #[derive(Debug, Node)] -pub struct PrimaryConcatenation<'a> { - pub nodes: (Concatenation<'a>, Option>>), +pub struct PrimaryConcatenation { + pub nodes: (Concatenation, Option>), } #[derive(Debug, Node)] -pub struct PrimaryMultipleConcatenation<'a> { +pub struct PrimaryMultipleConcatenation { pub nodes: ( - MultipleConcatenation<'a>, - Option>>, + MultipleConcatenation, + Option>, ), } #[derive(Debug, Node)] -pub struct PrimaryMintypmaxExpression<'a> { - pub nodes: (Paren<'a, MintypmaxExpression<'a>>,), +pub struct PrimaryMintypmaxExpression { + pub nodes: (Paren< MintypmaxExpression>,), } #[derive(Debug, Node)] -pub enum ClassQualifierOrPackageScope<'a> { - ClassQualifier(ClassQualifier<'a>), - PackageScope(PackageScope<'a>), +pub enum ClassQualifierOrPackageScope { + ClassQualifier(ClassQualifier), + PackageScope(PackageScope), } #[derive(Debug, Node)] -pub struct ClassQualifier<'a> { +pub struct ClassQualifier { pub nodes: ( - Option>, - Option>, + Option, + Option, ), } #[derive(Debug, Node)] -pub enum RangeExpression<'a> { - Expression(Expression<'a>), - PartSelectRange(PartSelectRange<'a>), +pub enum RangeExpression { + Expression(Expression), + PartSelectRange(PartSelectRange), } #[derive(Debug, Node)] -pub enum PrimaryLiteral<'a> { - Number(Number<'a>), - TimeLiteral(TimeLiteral<'a>), - UnbasedUnsizedLiteral(UnbasedUnsizedLiteral<'a>), - StringLiteral(StringLiteral<'a>), +pub enum PrimaryLiteral { + Number(Number), + TimeLiteral(TimeLiteral), + UnbasedUnsizedLiteral(UnbasedUnsizedLiteral), + StringLiteral(StringLiteral), } #[derive(Debug, Node)] -pub enum TimeLiteral<'a> { - Unsigned(TimeLiteralUnsigned<'a>), - FixedPoint(TimeLiteralFixedPoint<'a>), +pub enum TimeLiteral { + Unsigned(TimeLiteralUnsigned), + FixedPoint(TimeLiteralFixedPoint), } #[derive(Debug, Node)] -pub struct TimeLiteralUnsigned<'a> { - pub nodes: (UnsignedNumber<'a>, TimeUnit<'a>), +pub struct TimeLiteralUnsigned { + pub nodes: (UnsignedNumber, TimeUnit), } #[derive(Debug, Node)] -pub struct TimeLiteralFixedPoint<'a> { - pub nodes: (FixedPointNumber<'a>, TimeUnit<'a>), +pub struct TimeLiteralFixedPoint { + pub nodes: (FixedPointNumber, TimeUnit), } #[derive(Debug, Node)] -pub enum TimeUnit<'a> { - S(Keyword<'a>), - MS(Keyword<'a>), - US(Keyword<'a>), - NS(Keyword<'a>), - PS(Keyword<'a>), - FS(Keyword<'a>), +pub enum TimeUnit { + S(Keyword), + MS(Keyword), + US(Keyword), + NS(Keyword), + PS(Keyword), + FS(Keyword), } #[derive(Debug, Node)] -pub enum ImplicitClassHandle<'a> { - This(Keyword<'a>), - Super(Keyword<'a>), - ThisSuper((Keyword<'a>, Symbol<'a>, Keyword<'a>)), +pub enum ImplicitClassHandle { + This(Keyword), + Super(Keyword), + ThisSuper((Keyword, Symbol, Keyword)), } #[derive(Debug, Node)] -pub struct BitSelect<'a> { - nodes: (Vec>>,), +pub struct BitSelect { + nodes: (Vec>,), } #[derive(Debug, Node)] -pub struct Select<'a> { +pub struct Select { pub nodes: ( Option<( - Vec<(Symbol<'a>, MemberIdentifier<'a>, BitSelect<'a>)>, - Symbol<'a>, - MemberIdentifier<'a>, + Vec<(Symbol, MemberIdentifier, BitSelect)>, + Symbol, + MemberIdentifier, )>, - BitSelect<'a>, - Option>>, + BitSelect, + Option>, ), } #[derive(Debug, Node)] -pub struct NonrangeSelect<'a> { +pub struct NonrangeSelect { pub nodes: ( Option<( - Vec<(Symbol<'a>, MemberIdentifier<'a>, BitSelect<'a>)>, - Symbol<'a>, - MemberIdentifier<'a>, + Vec<(Symbol, MemberIdentifier, BitSelect)>, + Symbol, + MemberIdentifier, )>, - BitSelect<'a>, + BitSelect, ), } #[derive(Debug, Node)] -pub struct ConstantBitSelect<'a> { - nodes: (Vec>>,), +pub struct ConstantBitSelect { + nodes: (Vec>,), } #[derive(Debug, Node)] -pub struct ConstantSelect<'a> { +pub struct ConstantSelect { pub nodes: ( Option<( - Vec<(Symbol<'a>, MemberIdentifier<'a>, ConstantBitSelect<'a>)>, - Symbol<'a>, - MemberIdentifier<'a>, + Vec<(Symbol, MemberIdentifier, ConstantBitSelect)>, + Symbol, + MemberIdentifier, )>, - ConstantBitSelect<'a>, - Option>>, + ConstantBitSelect, + Option>, ), } #[derive(Debug, Node)] -pub struct ConstantCast<'a> { +pub struct ConstantCast { pub nodes: ( - CastingType<'a>, - Symbol<'a>, - Paren<'a, ConstantExpression<'a>>, + CastingType, + Symbol, + Paren< ConstantExpression>, ), } #[derive(Debug, Node)] -pub struct ConstantLetExpression<'a> { - pub nodes: (LetExpression<'a>,), +pub struct ConstantLetExpression { + pub nodes: (LetExpression,), } #[derive(Debug, Node)] -pub struct Cast<'a> { - pub nodes: (CastingType<'a>, Symbol<'a>, Paren<'a, Expression<'a>>), +pub struct Cast { + pub nodes: (CastingType, Symbol, Paren< Expression>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/expressions/strings.rs b/src/parser/expressions/strings.rs index 12e753e..88fefc0 100644 --- a/src/parser/expressions/strings.rs +++ b/src/parser/expressions/strings.rs @@ -9,8 +9,8 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct StringLiteral<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct StringLiteral { + pub nodes: (Locate, Vec), } // ----------------------------------------------------------------------------- @@ -22,7 +22,7 @@ pub fn string_literal(s: Span) -> IResult { } #[parser] -pub fn string_literal_impl(s: Span) -> IResult { +pub fn string_literal_impl(s: Span) -> IResult { let (s, a) = tag("\"")(s)?; let (s, b) = many1(pair(is_not("\\\""), opt(pair(tag("\\"), take(1usize)))))(s)?; let (s, c) = tag("\"")(s)?; @@ -52,7 +52,7 @@ pub fn string_literal_impl(s: Span) -> IResult { let a = concat(a, b).unwrap(); let a = concat(a, c).unwrap(); - Ok((s, a)) + Ok((s, a.into())) } // ----------------------------------------------------------------------------- diff --git a/src/parser/expressions/subroutine_calls.rs b/src/parser/expressions/subroutine_calls.rs index e4266bc..41867ca 100644 --- a/src/parser/expressions/subroutine_calls.rs +++ b/src/parser/expressions/subroutine_calls.rs @@ -9,177 +9,177 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct ConstantFunctionCall<'a> { - pub nodes: (FunctionSubroutineCall<'a>,), +pub struct ConstantFunctionCall { + pub nodes: (FunctionSubroutineCall,), } #[derive(Debug, Node)] -pub struct TfCall<'a> { +pub struct TfCall { pub nodes: ( - PsOrHierarchicalTfIdentifier<'a>, - Vec>, - Option>>, + PsOrHierarchicalTfIdentifier, + Vec, + Option>, ), } #[derive(Debug, Node)] -pub enum SystemTfCall<'a> { - ArgOptionl(SystemTfCallArgOptional<'a>), - ArgDataType(SystemTfCallArgDataType<'a>), - ArgExpression(SystemTfCallArgExpression<'a>), +pub enum SystemTfCall { + ArgOptionl(SystemTfCallArgOptional), + ArgDataType(SystemTfCallArgDataType), + ArgExpression(SystemTfCallArgExpression), } #[derive(Debug, Node)] -pub struct SystemTfCallArgOptional<'a> { +pub struct SystemTfCallArgOptional { pub nodes: ( - SystemTfIdentifier<'a>, - Option>>, + SystemTfIdentifier, + Option>, ), } #[derive(Debug, Node)] -pub struct SystemTfCallArgDataType<'a> { +pub struct SystemTfCallArgDataType { pub nodes: ( - SystemTfIdentifier<'a>, - Paren<'a, (DataType<'a>, Option<(Symbol<'a>, Expression<'a>)>)>, + SystemTfIdentifier, + Paren< (DataType, Option<(Symbol, Expression)>)>, ), } #[derive(Debug, Node)] -pub struct SystemTfCallArgExpression<'a> { +pub struct SystemTfCallArgExpression { pub nodes: ( - SystemTfIdentifier<'a>, + SystemTfIdentifier, Paren< - 'a, + ( - List, Option>>, - Option<(Symbol<'a>, Option>)>, + List>, + Option<(Symbol, Option)>, ), >, ), } #[derive(Debug, Node)] -pub enum SubroutineCall<'a> { - TfCall(Box>), - SystemTfCall(Box>), - MethodCall(Box>), - Randomize(Box>), +pub enum SubroutineCall { + TfCall(Box), + SystemTfCall(Box), + MethodCall(Box), + Randomize(Box), } #[derive(Debug, Node)] -pub struct SubroutineCallRandomize<'a> { - pub nodes: (Option<(Keyword<'a>, Symbol<'a>)>, RandomizeCall<'a>), +pub struct SubroutineCallRandomize { + pub nodes: (Option<(Keyword, Symbol)>, RandomizeCall), } #[derive(Debug, Node)] -pub struct FunctionSubroutineCall<'a> { - pub nodes: (SubroutineCall<'a>,), +pub struct FunctionSubroutineCall { + pub nodes: (SubroutineCall,), } #[derive(Debug, Node)] -pub enum ListOfArguments<'a> { - Ordered(ListOfArgumentsOrdered<'a>), - Named(ListOfArgumentsNamed<'a>), +pub enum ListOfArguments { + Ordered(ListOfArgumentsOrdered), + Named(ListOfArgumentsNamed), } #[derive(Debug, Node)] -pub struct ListOfArgumentsOrdered<'a> { +pub struct ListOfArgumentsOrdered { pub nodes: ( - List, Option>>, + List>, Vec<( - Symbol<'a>, - Symbol<'a>, - Identifier<'a>, - Paren<'a, Option>>, + Symbol, + Symbol, + Identifier, + Paren< Option>, )>, ), } #[derive(Debug, Node)] -pub struct ListOfArgumentsNamed<'a> { +pub struct ListOfArgumentsNamed { pub nodes: ( - Symbol<'a>, - Identifier<'a>, - Paren<'a, Option>>, + Symbol, + Identifier, + Paren< Option>, Vec<( - Symbol<'a>, - Symbol<'a>, - Identifier<'a>, - Paren<'a, Option>>, + Symbol, + Symbol, + Identifier, + Paren< Option>, )>, ), } #[derive(Debug, Node)] -pub struct MethodCall<'a> { - pub nodes: (MethodCallRoot<'a>, Symbol<'a>, MethodCallBody<'a>), +pub struct MethodCall { + pub nodes: (MethodCallRoot, Symbol, MethodCallBody), } #[derive(Debug, Node)] -pub enum MethodCallBody<'a> { - User(MethodCallBodyUser<'a>), - BuiltInMethodCall(BuiltInMethodCall<'a>), +pub enum MethodCallBody { + User(MethodCallBodyUser), + BuiltInMethodCall(BuiltInMethodCall), } #[derive(Debug, Node)] -pub struct MethodCallBodyUser<'a> { +pub struct MethodCallBodyUser { pub nodes: ( - MethodIdentifier<'a>, - Vec>, - Option>>, + MethodIdentifier, + Vec, + Option>, ), } #[derive(Debug, Node)] -pub enum BuiltInMethodCall<'a> { - ArrayManipulationCall(ArrayManipulationCall<'a>), - RandomizeCall(RandomizeCall<'a>), +pub enum BuiltInMethodCall { + ArrayManipulationCall(ArrayManipulationCall), + RandomizeCall(RandomizeCall), } #[derive(Debug, Node)] -pub struct ArrayManipulationCall<'a> { +pub struct ArrayManipulationCall { pub nodes: ( - ArrayMethodName<'a>, - Vec>, - Option>>, - Option<(Keyword<'a>, Paren<'a, Expression<'a>>)>, + ArrayMethodName, + Vec, + Option>, + Option<(Keyword, Paren< Expression>)>, ), } #[derive(Debug, Node)] -pub struct RandomizeCall<'a> { +pub struct RandomizeCall { pub nodes: ( - Keyword<'a>, - Vec>, - Option>>>, + Keyword, + Vec, + Option>>, Option<( - Keyword<'a>, - Option>>>, - ConstraintBlock<'a>, + Keyword, + Option>>, + ConstraintBlock, )>, ), } #[derive(Debug, Node)] -pub enum VariableIdentifierListOrNull<'a> { - VariableIdentifierList(VariableIdentifierList<'a>), - Null(Keyword<'a>), +pub enum VariableIdentifierListOrNull { + VariableIdentifierList(VariableIdentifierList), + Null(Keyword), } #[derive(Debug, Node)] -pub enum MethodCallRoot<'a> { - Primary(Primary<'a>), - ImplicitClassHandle(ImplicitClassHandle<'a>), +pub enum MethodCallRoot { + Primary(Primary), + ImplicitClassHandle(ImplicitClassHandle), } #[derive(Debug, Node)] -pub enum ArrayMethodName<'a> { - MethodIdentifier(MethodIdentifier<'a>), - Unique(Keyword<'a>), - And(Keyword<'a>), - Or(Keyword<'a>), - Xor(Keyword<'a>), +pub enum ArrayMethodName { + MethodIdentifier(MethodIdentifier), + Unique(Keyword), + And(Keyword), + Or(Keyword), + Xor(Keyword), } // ----------------------------------------------------------------------------- diff --git a/src/parser/general/attributes.rs b/src/parser/general/attributes.rs index d15863c..c5f1de4 100644 --- a/src/parser/general/attributes.rs +++ b/src/parser/general/attributes.rs @@ -7,13 +7,13 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct AttributeInstance<'a> { - pub nodes: (Symbol<'a>, List, AttrSpec<'a>>, Symbol<'a>), +pub struct AttributeInstance { + pub nodes: (Symbol, List, Symbol), } #[derive(Debug, Node)] -pub struct AttrSpec<'a> { - pub nodes: (Identifier<'a>, Option<(Symbol<'a>, ConstantExpression<'a>)>), +pub struct AttrSpec { + pub nodes: (Identifier, Option<(Symbol, ConstantExpression)>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/general/comments.rs b/src/parser/general/comments.rs index 49828f2..b185cca 100644 --- a/src/parser/general/comments.rs +++ b/src/parser/general/comments.rs @@ -7,8 +7,8 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct Comment<'a> { - nodes: (Span<'a>,), +pub struct Comment { + nodes: (Locate,), } // ----------------------------------------------------------------------------- @@ -23,7 +23,7 @@ pub fn one_line_comment(s: Span) -> IResult { let (s, a) = tag("//")(s)?; let (s, b) = is_not("\n")(s)?; let a = concat(a, b).unwrap(); - Ok((s, Comment { nodes: (a,) })) + Ok((s, Comment { nodes: (a.into(),) })) } #[parser] @@ -33,7 +33,7 @@ pub fn block_comment(s: Span) -> IResult { let (s, c) = tag("*/")(s)?; let a = concat(a, b).unwrap(); let a = concat(a, c).unwrap(); - Ok((s, Comment { nodes: (a,) })) + Ok((s, Comment { nodes: (a.into(),) })) } // ----------------------------------------------------------------------------- diff --git a/src/parser/general/identifiers.rs b/src/parser/general/identifiers.rs index 3adb100..878895f 100644 --- a/src/parser/general/identifiers.rs +++ b/src/parser/general/identifiers.rs @@ -15,532 +15,526 @@ pub const AZ09_: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012 pub const AZ09_DOLLAR: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$"; #[derive(Debug, Node)] -pub struct ArrayIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct ArrayIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct BlockIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct BlockIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct BinIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct BinIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct CIdentifier<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct CIdentifier { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct CellIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct CellIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct CheckerIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct CheckerIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct ClassIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct ClassIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct ClassVariableIdentifier<'a> { - pub nodes: (VariableIdentifier<'a>,), +pub struct ClassVariableIdentifier { + pub nodes: (VariableIdentifier,), } #[derive(Debug, Node)] -pub struct ClockingIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct ClockingIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct ConfigIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct ConfigIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct ConstIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct ConstIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct ConstraintIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct ConstraintIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct CovergroupIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct CovergroupIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct CovergroupVariableIdentifier<'a> { - pub nodes: (VariableIdentifier<'a>,), +pub struct CovergroupVariableIdentifier { + pub nodes: (VariableIdentifier,), } #[derive(Debug, Node)] -pub struct CoverPointIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct CoverPointIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct CrossIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct CrossIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct DynamicArrayVariableIdentifier<'a> { - pub nodes: (VariableIdentifier<'a>,), +pub struct DynamicArrayVariableIdentifier { + pub nodes: (VariableIdentifier,), } #[derive(Debug, Node)] -pub struct EnumIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct EnumIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct EscapedIdentifier<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct EscapedIdentifier { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct FormalIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct FormalIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct FormalPortIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct FormalPortIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct FunctionIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct FunctionIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct GenerateBlockIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct GenerateBlockIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct GenvarIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct GenvarIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct HierarchicalArrayIdentifier<'a> { - pub nodes: (HierarchicalIdentifier<'a>,), +pub struct HierarchicalArrayIdentifier { + pub nodes: (HierarchicalIdentifier,), } #[derive(Debug, Node)] -pub struct HierarchicalBlockIdentifier<'a> { - pub nodes: (HierarchicalIdentifier<'a>,), +pub struct HierarchicalBlockIdentifier { + pub nodes: (HierarchicalIdentifier,), } #[derive(Debug, Node)] -pub struct HierarchicalEventIdentifier<'a> { - pub nodes: (HierarchicalIdentifier<'a>,), +pub struct HierarchicalEventIdentifier { + pub nodes: (HierarchicalIdentifier,), } #[derive(Debug, Node)] -pub struct HierarchicalIdentifier<'a> { +pub struct HierarchicalIdentifier { pub nodes: ( - Option>, - Vec<(Identifier<'a>, ConstantBitSelect<'a>, Symbol<'a>)>, - Identifier<'a>, + Option, + Vec<(Identifier, ConstantBitSelect, Symbol)>, + Identifier, ), } #[derive(Debug, Node)] -pub struct Root<'a> { - pub nodes: (Keyword<'a>, Symbol<'a>), +pub struct Root { + pub nodes: (Keyword, Symbol), } #[derive(Debug, Node)] -pub struct HierarchicalNetIdentifier<'a> { - pub nodes: (HierarchicalIdentifier<'a>,), +pub struct HierarchicalNetIdentifier { + pub nodes: (HierarchicalIdentifier,), } #[derive(Debug, Node)] -pub struct HierarchicalParameterIdentifier<'a> { - pub nodes: (HierarchicalIdentifier<'a>,), +pub struct HierarchicalParameterIdentifier { + pub nodes: (HierarchicalIdentifier,), } #[derive(Debug, Node)] -pub struct HierarchicalPropertyIdentifier<'a> { - pub nodes: (HierarchicalIdentifier<'a>,), +pub struct HierarchicalPropertyIdentifier { + pub nodes: (HierarchicalIdentifier,), } #[derive(Debug, Node)] -pub struct HierarchicalSequenceIdentifier<'a> { - pub nodes: (HierarchicalIdentifier<'a>,), +pub struct HierarchicalSequenceIdentifier { + pub nodes: (HierarchicalIdentifier,), } #[derive(Debug, Node)] -pub struct HierarchicalTaskIdentifier<'a> { - pub nodes: (HierarchicalIdentifier<'a>,), +pub struct HierarchicalTaskIdentifier { + pub nodes: (HierarchicalIdentifier,), } #[derive(Debug, Node)] -pub struct HierarchicalTfIdentifier<'a> { - pub nodes: (HierarchicalIdentifier<'a>,), +pub struct HierarchicalTfIdentifier { + pub nodes: (HierarchicalIdentifier,), } #[derive(Debug, Node)] -pub struct HierarchicalVariableIdentifier<'a> { - pub nodes: (HierarchicalIdentifier<'a>,), +pub struct HierarchicalVariableIdentifier { + pub nodes: (HierarchicalIdentifier,), } #[derive(Debug, Node)] -pub enum Identifier<'a> { - SimpleIdentifier(SimpleIdentifier<'a>), - EscapedIdentifier(EscapedIdentifier<'a>), +pub enum Identifier { + SimpleIdentifier(SimpleIdentifier), + EscapedIdentifier(EscapedIdentifier), } #[derive(Debug, Node)] -pub struct IndexVariableIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct IndexVariableIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct InterfaceIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct InterfaceIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct InterfaceInstanceIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct InterfaceInstanceIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct InoutPortIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct InoutPortIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct InputPortIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct InputPortIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct InstanceIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct InstanceIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct LibraryIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct LibraryIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct MemberIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct MemberIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct MethodIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct MethodIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct ModportIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct ModportIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct ModuleIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct ModuleIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct NetIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct NetIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct NetTypeIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct NetTypeIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct OutputPortIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct OutputPortIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct PackageIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct PackageIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub enum PackageScope<'a> { - Package(PackageScopePackage<'a>), - Unit(Unit<'a>), +pub enum PackageScope { + Package(PackageScopePackage), + Unit(Unit), } #[derive(Debug, Node)] -pub struct PackageScopePackage<'a> { - pub nodes: (PackageIdentifier<'a>, Symbol<'a>), +pub struct PackageScopePackage { + pub nodes: (PackageIdentifier, Symbol), } #[derive(Debug, Node)] -pub struct Unit<'a> { - pub nodes: (Keyword<'a>, Symbol<'a>), +pub struct Unit { + pub nodes: (Keyword, Symbol), } #[derive(Debug, Node)] -pub struct ParameterIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct ParameterIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct PortIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct PortIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct ProductionIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct ProductionIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct ProgramIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct ProgramIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct PropertyIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct PropertyIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct PsClassIdentifier<'a> { - pub nodes: (Option>, ClassIdentifier<'a>), +pub struct PsClassIdentifier { + pub nodes: (Option, ClassIdentifier), } #[derive(Debug, Node)] -pub struct PsCovergroupIdentifier<'a> { - pub nodes: (Option>, CovergroupIdentifier<'a>), +pub struct PsCovergroupIdentifier { + pub nodes: (Option, CovergroupIdentifier), } #[derive(Debug, Node)] -pub struct PsCheckerIdentifier<'a> { - pub nodes: (Option>, CheckerIdentifier<'a>), +pub struct PsCheckerIdentifier { + pub nodes: (Option, CheckerIdentifier), } #[derive(Debug, Node)] -pub struct PsIdentifier<'a> { - pub nodes: (Option>, Identifier<'a>), +pub struct PsIdentifier { + pub nodes: (Option, Identifier), } #[derive(Debug, Node)] -pub struct PsOrHierarchicalArrayIdentifier<'a> { +pub struct PsOrHierarchicalArrayIdentifier { pub nodes: ( - Option>, - HierarchicalArrayIdentifier<'a>, + Option, + HierarchicalArrayIdentifier, ), } #[derive(Debug, Node)] -pub enum PsOrHierarchicalNetIdentifier<'a> { - PackageScope(PsOrHierarchicalNetIdentifierPackageScope<'a>), - HierarchicalNetIdentifier(HierarchicalNetIdentifier<'a>), +pub enum PsOrHierarchicalNetIdentifier { + PackageScope(PsOrHierarchicalNetIdentifierPackageScope), + HierarchicalNetIdentifier(HierarchicalNetIdentifier), } #[derive(Debug, Node)] -pub struct PsOrHierarchicalNetIdentifierPackageScope<'a> { - pub nodes: (Option>, NetIdentifier<'a>), +pub struct PsOrHierarchicalNetIdentifierPackageScope { + pub nodes: (Option, NetIdentifier), } #[derive(Debug, Node)] -pub struct PsOrHierarchicalNetIdentifierHierarchical<'a> { - pub nodes: (HierarchicalNetIdentifier<'a>), +pub struct PsOrHierarchicalNetIdentifierHierarchical { + pub nodes: (HierarchicalNetIdentifier), } #[derive(Debug, Node)] -pub enum PsOrHierarchicalPropertyIdentifier<'a> { - PackageScope(PsOrHierarchicalPropertyIdentifierPackageScope<'a>), - HierarchicalPropertyIdentifier(HierarchicalPropertyIdentifier<'a>), +pub enum PsOrHierarchicalPropertyIdentifier { + PackageScope(PsOrHierarchicalPropertyIdentifierPackageScope), + HierarchicalPropertyIdentifier(HierarchicalPropertyIdentifier), } #[derive(Debug, Node)] -pub struct PsOrHierarchicalPropertyIdentifierPackageScope<'a> { - pub nodes: (Option>, PropertyIdentifier<'a>), +pub struct PsOrHierarchicalPropertyIdentifierPackageScope { + pub nodes: (Option, PropertyIdentifier), } #[derive(Debug, Node)] -pub struct PsOrHierarchicalPropertyIdentifierHierarchical<'a> { - pub nodes: (HierarchicalPropertyIdentifier<'a>), +pub struct PsOrHierarchicalPropertyIdentifierHierarchical { + pub nodes: (HierarchicalPropertyIdentifier), } #[derive(Debug, Node)] -pub enum PsOrHierarchicalSequenceIdentifier<'a> { - PackageScope(PsOrHierarchicalSequenceIdentifierPackageScope<'a>), - HierarchicalSequenceIdentifier(HierarchicalSequenceIdentifier<'a>), +pub enum PsOrHierarchicalSequenceIdentifier { + PackageScope(PsOrHierarchicalSequenceIdentifierPackageScope), + HierarchicalSequenceIdentifier(HierarchicalSequenceIdentifier), } #[derive(Debug, Node)] -pub struct PsOrHierarchicalSequenceIdentifierPackageScope<'a> { - pub nodes: (Option>, SequenceIdentifier<'a>), +pub struct PsOrHierarchicalSequenceIdentifierPackageScope { + pub nodes: (Option, SequenceIdentifier), } #[derive(Debug, Node)] -pub struct PsOrHierarchicalSequenceIdentifierHierarchical<'a> { - pub nodes: (HierarchicalSequenceIdentifier<'a>), +pub struct PsOrHierarchicalSequenceIdentifierHierarchical { + pub nodes: (HierarchicalSequenceIdentifier), } #[derive(Debug, Node)] -pub enum PsOrHierarchicalTfIdentifier<'a> { - PackageScope(PsOrHierarchicalTfIdentifierPackageScope<'a>), - HierarchicalTfIdentifier(HierarchicalTfIdentifier<'a>), +pub enum PsOrHierarchicalTfIdentifier { + PackageScope(PsOrHierarchicalTfIdentifierPackageScope), + HierarchicalTfIdentifier(HierarchicalTfIdentifier), } #[derive(Debug, Node)] -pub struct PsOrHierarchicalTfIdentifierPackageScope<'a> { - pub nodes: (Option>, TfIdentifier<'a>), +pub struct PsOrHierarchicalTfIdentifierPackageScope { + pub nodes: (Option, TfIdentifier), } #[derive(Debug, Node)] -pub struct PsOrHierarchicalTfIdentifierHierarchical<'a> { - pub nodes: (HierarchicalTfIdentifier<'a>), +pub struct PsOrHierarchicalTfIdentifierHierarchical { + pub nodes: (HierarchicalTfIdentifier), } #[derive(Debug, Node)] -pub enum PsParameterIdentifier<'a> { - Scope(PsParameterIdentifierScope<'a>), - Generate(PsParameterIdentifierGenerate<'a>), +pub enum PsParameterIdentifier { + Scope(PsParameterIdentifierScope), + Generate(PsParameterIdentifierGenerate), } #[derive(Debug, Node)] -pub struct PsParameterIdentifierScope<'a> { - pub nodes: ( - Option>, - ParameterIdentifier<'a>, - ), +pub struct PsParameterIdentifierScope { + pub nodes: (Option, ParameterIdentifier), } #[derive(Debug, Node)] -pub struct PsParameterIdentifierGenerate<'a> { +pub struct PsParameterIdentifierGenerate { pub nodes: ( Vec<( - GenerateBlockIdentifier<'a>, - Option>>, - Symbol<'a>, + GenerateBlockIdentifier, + Option>, + Symbol, )>, - ParameterIdentifier<'a>, + ParameterIdentifier, ), } #[derive(Debug, Node)] -pub struct PsTypeIdentifier<'a> { - pub nodes: ( - Option>, - TypeIdentifier<'a>, - ), +pub struct PsTypeIdentifier { + pub nodes: (Option, TypeIdentifier), } #[derive(Debug, Node)] -pub enum LocalOrPackageScopeOrClassScope<'a> { - Local(Local<'a>), - PackageScope(PackageScope<'a>), - ClassScope(ClassScope<'a>), +pub enum LocalOrPackageScopeOrClassScope { + Local(Local), + PackageScope(PackageScope), + ClassScope(ClassScope), } #[derive(Debug, Node)] -pub struct Local<'a> { - pub nodes: (Keyword<'a>, Symbol<'a>), +pub struct Local { + pub nodes: (Keyword, Symbol), } #[derive(Debug, Node)] -pub struct SequenceIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct SequenceIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct SignalIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct SignalIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct SimpleIdentifier<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct SimpleIdentifier { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct SpecparamIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct SpecparamIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct SystemTfIdentifier<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct SystemTfIdentifier { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct TaskIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct TaskIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct TfIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct TfIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct TerminalIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct TerminalIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct TopmoduleIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct TopmoduleIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct TypeIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct TypeIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct UdpIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct UdpIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub struct VariableIdentifier<'a> { - pub nodes: (Identifier<'a>,), +pub struct VariableIdentifier { + pub nodes: (Identifier,), } #[derive(Debug, Node)] -pub enum ImplicitClassHandleOrClassScopeOrPackageScope<'a> { - ImplicitClassHandle((ImplicitClassHandle<'a>, Symbol<'a>)), - ClassScope(ClassScope<'a>), - PackageScope(PackageScope<'a>), +pub enum ImplicitClassHandleOrClassScopeOrPackageScope { + ImplicitClassHandle((ImplicitClassHandle, Symbol)), + ClassScope(ClassScope), + PackageScope(PackageScope), } #[derive(Debug, Node)] -pub enum ImplicitClassHandleOrPackageScope<'a> { - ImplicitClassHandle((ImplicitClassHandle<'a>, Symbol<'a>)), - PackageScope(PackageScope<'a>), +pub enum ImplicitClassHandleOrPackageScope { + ImplicitClassHandle((ImplicitClassHandle, Symbol)), + PackageScope(PackageScope), } #[derive(Debug, Node)] -pub enum ImplicitClassHandleOrClassScope<'a> { - ImplicitClassHandle((ImplicitClassHandle<'a>, Symbol<'a>)), - ClassScope(ClassScope<'a>), +pub enum ImplicitClassHandleOrClassScope { + ImplicitClassHandle((ImplicitClassHandle, Symbol)), + ClassScope(ClassScope), } #[derive(Debug, Node)] -pub enum PackageScopeOrClassScope<'a> { - PackageScope(PackageScope<'a>), - ClassScope(ClassScope<'a>), +pub enum PackageScopeOrClassScope { + PackageScope(PackageScope), + ClassScope(ClassScope), } // ----------------------------------------------------------------------------- @@ -570,7 +564,7 @@ pub fn c_identifier(s: Span) -> IResult { } #[parser] -pub fn c_identifier_impl(s: Span) -> IResult { +pub fn c_identifier_impl(s: Span) -> IResult { let (s, a) = is_a(AZ_)(s)?; let (s, b) = opt(is_a(AZ09_))(s)?; let a = if let Some(b) = b { @@ -581,7 +575,7 @@ pub fn c_identifier_impl(s: Span) -> IResult { if is_keyword(&a) { Err(Err::Error(make_error(s, ErrorKind::Fix))) } else { - Ok((s, a)) + Ok((s, a.into())) } } @@ -676,11 +670,11 @@ pub fn escaped_identifier(s: Span) -> IResult { } #[parser] -pub fn escaped_identifier_impl(s: Span) -> IResult { +pub fn escaped_identifier_impl(s: Span) -> IResult { let (s, a) = tag("\\")(s)?; let (s, b) = is_not(" \t\r\n")(s)?; let a = concat(a, b).unwrap(); - Ok((s, a)) + Ok((s, a.into())) } #[parser] @@ -1135,7 +1129,7 @@ pub fn simple_identifier(s: Span) -> IResult { } #[parser] -pub fn simple_identifier_impl(s: Span) -> IResult { +pub fn simple_identifier_impl(s: Span) -> IResult { let (s, a) = is_a(AZ_)(s)?; let (s, b) = opt(is_a(AZ09_DOLLAR))(s)?; let a = if let Some(b) = b { @@ -1146,7 +1140,7 @@ pub fn simple_identifier_impl(s: Span) -> IResult { if is_keyword(&a) { Err(Err::Error(make_error(s, ErrorKind::Fix))) } else { - Ok((s, a)) + Ok((s, a.into())) } } @@ -1163,11 +1157,11 @@ pub fn system_tf_identifier(s: Span) -> IResult { } #[parser] -pub fn system_tf_identifier_impl(s: Span) -> IResult { +pub fn system_tf_identifier_impl(s: Span) -> IResult { let (s, a) = tag("$")(s)?; let (s, b) = is_a(AZ09_DOLLAR)(s)?; let a = concat(a, b).unwrap(); - Ok((s, a)) + Ok((s, a.into())) } #[parser] diff --git a/src/parser/instantiations/checker_instantiation.rs b/src/parser/instantiations/checker_instantiation.rs index ed951c1..2ca7fc1 100644 --- a/src/parser/instantiations/checker_instantiation.rs +++ b/src/parser/instantiations/checker_instantiation.rs @@ -8,55 +8,55 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct CheckerInstantiation<'a> { +pub struct CheckerInstantiation { pub nodes: ( - PsCheckerIdentifier<'a>, - NameOfInstance<'a>, - Paren<'a, Option>>, - Symbol<'a>, + PsCheckerIdentifier, + NameOfInstance, + Paren< Option>, + Symbol, ), } #[derive(Debug, Node)] -pub enum ListOfCheckerPortConnections<'a> { - Ordered(ListOfCheckerPortConnectionsOrdered<'a>), - Named(ListOfCheckerPortConnectionsNamed<'a>), +pub enum ListOfCheckerPortConnections { + Ordered(ListOfCheckerPortConnectionsOrdered), + Named(ListOfCheckerPortConnectionsNamed), } #[derive(Debug, Node)] -pub struct ListOfCheckerPortConnectionsOrdered<'a> { - pub nodes: (List, OrderedCheckerPortConnection<'a>>,), +pub struct ListOfCheckerPortConnectionsOrdered { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ListOfCheckerPortConnectionsNamed<'a> { - pub nodes: (List, NamedCheckerPortConnection<'a>>,), +pub struct ListOfCheckerPortConnectionsNamed { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct OrderedCheckerPortConnection<'a> { - pub nodes: (Vec>, Option>), +pub struct OrderedCheckerPortConnection { + pub nodes: (Vec, Option), } #[derive(Debug, Node)] -pub enum NamedCheckerPortConnection<'a> { - Identifier(NamedCheckerPortConnectionIdentifier<'a>), - Asterisk(NamedCheckerPortConnectionAsterisk<'a>), +pub enum NamedCheckerPortConnection { + Identifier(NamedCheckerPortConnectionIdentifier), + Asterisk(NamedCheckerPortConnectionAsterisk), } #[derive(Debug, Node)] -pub struct NamedCheckerPortConnectionIdentifier<'a> { +pub struct NamedCheckerPortConnectionIdentifier { pub nodes: ( - Vec>, - Symbol<'a>, - FormalPortIdentifier<'a>, - Option>>>, + Vec, + Symbol, + FormalPortIdentifier, + Option>>, ), } #[derive(Debug, Node)] -pub struct NamedCheckerPortConnectionAsterisk<'a> { - pub nodes: (Vec>, Symbol<'a>), +pub struct NamedCheckerPortConnectionAsterisk { + pub nodes: (Vec, Symbol), } // ----------------------------------------------------------------------------- diff --git a/src/parser/instantiations/generated_instantiation.rs b/src/parser/instantiations/generated_instantiation.rs index 88d07a8..6ce773d 100644 --- a/src/parser/instantiations/generated_instantiation.rs +++ b/src/parser/instantiations/generated_instantiation.rs @@ -9,138 +9,138 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct GenerateRegion<'a> { - pub nodes: (Keyword<'a>, Vec>, Keyword<'a>), +pub struct GenerateRegion { + pub nodes: (Keyword, Vec, Keyword), } #[derive(Debug, Node)] -pub struct LoopGenerateConstruct<'a> { +pub struct LoopGenerateConstruct { pub nodes: ( - Keyword<'a>, + Keyword, Paren< - 'a, + ( - GenvarInitialization<'a>, - Symbol<'a>, - GenvarExpression<'a>, - Symbol<'a>, - GenvarIteration<'a>, + GenvarInitialization, + Symbol, + GenvarExpression, + Symbol, + GenvarIteration, ), >, - GenerateBlock<'a>, + GenerateBlock, ), } #[derive(Debug, Node)] -pub struct GenvarInitialization<'a> { +pub struct GenvarInitialization { pub nodes: ( - Option>, - GenvarIdentifier<'a>, - Symbol<'a>, - ConstantExpression<'a>, + Option, + GenvarIdentifier, + Symbol, + ConstantExpression, ), } #[derive(Debug, Node)] -pub struct Genvar<'a> { - pub nodes: (Keyword<'a>,), +pub struct Genvar { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub enum GenvarIteration<'a> { - Assignment(GenvarIterationAssignment<'a>), - Prefix(GenvarIterationPrefix<'a>), - Suffix(GenvarIterationSuffix<'a>), +pub enum GenvarIteration { + Assignment(GenvarIterationAssignment), + Prefix(GenvarIterationPrefix), + Suffix(GenvarIterationSuffix), } #[derive(Debug, Node)] -pub struct GenvarIterationAssignment<'a> { +pub struct GenvarIterationAssignment { pub nodes: ( - GenvarIdentifier<'a>, - AssignmentOperator<'a>, - GenvarExpression<'a>, + GenvarIdentifier, + AssignmentOperator, + GenvarExpression, ), } #[derive(Debug, Node)] -pub struct GenvarIterationPrefix<'a> { - pub nodes: (IncOrDecOperator<'a>, GenvarIdentifier<'a>), +pub struct GenvarIterationPrefix { + pub nodes: (IncOrDecOperator, GenvarIdentifier), } #[derive(Debug, Node)] -pub struct GenvarIterationSuffix<'a> { - pub nodes: (GenvarIdentifier<'a>, IncOrDecOperator<'a>), +pub struct GenvarIterationSuffix { + pub nodes: (GenvarIdentifier, IncOrDecOperator), } #[derive(Debug, Node)] -pub enum ConditionalGenerateConstruct<'a> { - If(IfGenerateConstruct<'a>), - Case(CaseGenerateConstruct<'a>), +pub enum ConditionalGenerateConstruct { + If(IfGenerateConstruct), + Case(CaseGenerateConstruct), } #[derive(Debug, Node)] -pub struct IfGenerateConstruct<'a> { +pub struct IfGenerateConstruct { pub nodes: ( - Keyword<'a>, - Paren<'a, ConstantExpression<'a>>, - GenerateBlock<'a>, - Option<(Keyword<'a>, GenerateBlock<'a>)>, + Keyword, + Paren< ConstantExpression>, + GenerateBlock, + Option<(Keyword, GenerateBlock)>, ), } #[derive(Debug, Node)] -pub struct CaseGenerateConstruct<'a> { +pub struct CaseGenerateConstruct { pub nodes: ( - Keyword<'a>, - Paren<'a, ConstantExpression<'a>>, - Vec>, - Keyword<'a>, + Keyword, + Paren< ConstantExpression>, + Vec, + Keyword, ), } #[derive(Debug, Node)] -pub enum CaseGenerateItem<'a> { - Nondefault(CaseGenerateItemNondefault<'a>), - Default(CaseGenerateItemDefault<'a>), +pub enum CaseGenerateItem { + Nondefault(CaseGenerateItemNondefault), + Default(CaseGenerateItemDefault), } #[derive(Debug, Node)] -pub struct CaseGenerateItemNondefault<'a> { +pub struct CaseGenerateItemNondefault { pub nodes: ( - List, ConstantExpression<'a>>, - Symbol<'a>, - GenerateBlock<'a>, + List, + Symbol, + GenerateBlock, ), } #[derive(Debug, Node)] -pub struct CaseGenerateItemDefault<'a> { - pub nodes: (Keyword<'a>, Option>, GenerateBlock<'a>), +pub struct CaseGenerateItemDefault { + pub nodes: (Keyword, Option, GenerateBlock), } #[derive(Debug, Node)] -pub enum GenerateBlock<'a> { - GenerateItem(GenerateItem<'a>), - Multiple(GenerateBlockMultiple<'a>), +pub enum GenerateBlock { + GenerateItem(GenerateItem), + Multiple(GenerateBlockMultiple), } #[derive(Debug, Node)] -pub struct GenerateBlockMultiple<'a> { +pub struct GenerateBlockMultiple { pub nodes: ( - Option<(GenerateBlockIdentifier<'a>, Symbol<'a>)>, - Keyword<'a>, - Option<(Symbol<'a>, GenerateBlockIdentifier<'a>)>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, GenerateBlockIdentifier<'a>)>, + Option<(GenerateBlockIdentifier, Symbol)>, + Keyword, + Option<(Symbol, GenerateBlockIdentifier)>, + Vec, + Keyword, + Option<(Symbol, GenerateBlockIdentifier)>, ), } #[derive(Debug, Node)] -pub enum GenerateItem<'a> { - ModuleOrGenerateItem(ModuleOrGenerateItem<'a>), - InterfaceOrGenerateItem(InterfaceOrGenerateItem<'a>), - CheckerOrGenerateItem(CheckerOrGenerateItem<'a>), +pub enum GenerateItem { + ModuleOrGenerateItem(ModuleOrGenerateItem), + InterfaceOrGenerateItem(InterfaceOrGenerateItem), + CheckerOrGenerateItem(CheckerOrGenerateItem), } // ----------------------------------------------------------------------------- diff --git a/src/parser/instantiations/interface_instantiation.rs b/src/parser/instantiations/interface_instantiation.rs index f3e4840..91053c4 100644 --- a/src/parser/instantiations/interface_instantiation.rs +++ b/src/parser/instantiations/interface_instantiation.rs @@ -6,12 +6,12 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct InterfaceInstantiation<'a> { +pub struct InterfaceInstantiation { pub nodes: ( - InterfaceIdentifier<'a>, - Option>, - List, HierarchicalInstance<'a>>, - Symbol<'a>, + InterfaceIdentifier, + Option, + List, + Symbol, ), } diff --git a/src/parser/instantiations/module_instantiation.rs b/src/parser/instantiations/module_instantiation.rs index 9194ede..dae0400 100644 --- a/src/parser/instantiations/module_instantiation.rs +++ b/src/parser/instantiations/module_instantiation.rs @@ -8,106 +8,106 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct ModuleInstantiation<'a> { +pub struct ModuleInstantiation { pub nodes: ( - ModuleIdentifier<'a>, - Option>, - List, HierarchicalInstance<'a>>, - Symbol<'a>, + ModuleIdentifier, + Option, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct ParameterValueAssignment<'a> { +pub struct ParameterValueAssignment { pub nodes: ( - Symbol<'a>, - Paren<'a, Option>>, + Symbol, + Paren< Option>, ), } #[derive(Debug, Node)] -pub enum ListOfParameterAssignments<'a> { - Ordered(ListOfParameterAssignmentsOrdered<'a>), - Named(ListOfParameterAssignmentsNamed<'a>), +pub enum ListOfParameterAssignments { + Ordered(ListOfParameterAssignmentsOrdered), + Named(ListOfParameterAssignmentsNamed), } #[derive(Debug, Node)] -pub struct ListOfParameterAssignmentsOrdered<'a> { - pub nodes: (List, OrderedParameterAssignment<'a>>,), +pub struct ListOfParameterAssignmentsOrdered { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ListOfParameterAssignmentsNamed<'a> { - pub nodes: (List, NamedParameterAssignment<'a>>,), +pub struct ListOfParameterAssignmentsNamed { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct OrderedParameterAssignment<'a> { - pub nodes: (ParamExpression<'a>,), +pub struct OrderedParameterAssignment { + pub nodes: (ParamExpression,), } #[derive(Debug, Node)] -pub struct NamedParameterAssignment<'a> { +pub struct NamedParameterAssignment { pub nodes: ( - Symbol<'a>, - ParameterIdentifier<'a>, - Paren<'a, Option>>, + Symbol, + ParameterIdentifier, + Paren< Option>, ), } #[derive(Debug, Node)] -pub struct HierarchicalInstance<'a> { +pub struct HierarchicalInstance { pub nodes: ( - NameOfInstance<'a>, - Paren<'a, Option>>, + NameOfInstance, + Paren< Option>, ), } #[derive(Debug, Node)] -pub struct NameOfInstance<'a> { - pub nodes: (InstanceIdentifier<'a>, Vec>), +pub struct NameOfInstance { + pub nodes: (InstanceIdentifier, Vec), } #[derive(Debug, Node)] -pub enum ListOfPortConnections<'a> { - Ordered(ListOfPortConnectionsOrdered<'a>), - Named(ListOfPortConnectionsNamed<'a>), +pub enum ListOfPortConnections { + Ordered(ListOfPortConnectionsOrdered), + Named(ListOfPortConnectionsNamed), } #[derive(Debug, Node)] -pub struct ListOfPortConnectionsOrdered<'a> { - pub nodes: (List, OrderedPortConnection<'a>>,), +pub struct ListOfPortConnectionsOrdered { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ListOfPortConnectionsNamed<'a> { - pub nodes: (List, NamedPortConnection<'a>>,), +pub struct ListOfPortConnectionsNamed { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct OrderedPortConnection<'a> { - pub nodes: (Vec>, Option>), +pub struct OrderedPortConnection { + pub nodes: (Vec, Option), } #[derive(Debug, Node)] -pub enum NamedPortConnection<'a> { - Identifier(NamedPortConnectionIdentifier<'a>), - Asterisk(NamedPortConnectionAsterisk<'a>), +pub enum NamedPortConnection { + Identifier(NamedPortConnectionIdentifier), + Asterisk(NamedPortConnectionAsterisk), } #[derive(Debug, Node)] -pub struct NamedPortConnectionIdentifier<'a> { +pub struct NamedPortConnectionIdentifier { pub nodes: ( - Vec>, - Symbol<'a>, - PortIdentifier<'a>, - Option>>>, + Vec, + Symbol, + PortIdentifier, + Option>>, ), } #[derive(Debug, Node)] -pub struct NamedPortConnectionAsterisk<'a> { - pub nodes: (Vec>, Symbol<'a>), +pub struct NamedPortConnectionAsterisk { + pub nodes: (Vec, Symbol), } // ----------------------------------------------------------------------------- diff --git a/src/parser/instantiations/program_instantiation.rs b/src/parser/instantiations/program_instantiation.rs index bf89859..b041757 100644 --- a/src/parser/instantiations/program_instantiation.rs +++ b/src/parser/instantiations/program_instantiation.rs @@ -6,12 +6,12 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct ProgramInstantiation<'a> { +pub struct ProgramInstantiation { pub nodes: ( - ProgramIdentifier<'a>, - Option>, - List, HierarchicalInstance<'a>>, - Symbol<'a>, + ProgramIdentifier, + Option, + List, + Symbol, ), } diff --git a/src/parser/primitive_instances/primitive_gate_and_switch_types.rs b/src/parser/primitive_instances/primitive_gate_and_switch_types.rs index 9a0ceb0..cf48c49 100644 --- a/src/parser/primitive_instances/primitive_gate_and_switch_types.rs +++ b/src/parser/primitive_instances/primitive_gate_and_switch_types.rs @@ -6,38 +6,38 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct CmosSwitchtype<'a> { - pub nodes: (Keyword<'a>,), +pub struct CmosSwitchtype { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct EnableGatetype<'a> { - pub nodes: (Keyword<'a>,), +pub struct EnableGatetype { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct MosSwitchtype<'a> { - pub nodes: (Keyword<'a>,), +pub struct MosSwitchtype { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct NInputGatetype<'a> { - pub nodes: (Keyword<'a>,), +pub struct NInputGatetype { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct NOutputGatetype<'a> { - pub nodes: (Keyword<'a>,), +pub struct NOutputGatetype { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct PassEnSwitchtype<'a> { - pub nodes: (Keyword<'a>,), +pub struct PassEnSwitchtype { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct PassSwitchtype<'a> { - pub nodes: (Keyword<'a>,), +pub struct PassSwitchtype { + pub nodes: (Keyword,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/primitive_instances/primitive_instantiation_and_instances.rs b/src/parser/primitive_instances/primitive_instantiation_and_instances.rs index 9c484e9..f41fd67 100644 --- a/src/parser/primitive_instances/primitive_instantiation_and_instances.rs +++ b/src/parser/primitive_instances/primitive_instantiation_and_instances.rs @@ -8,221 +8,221 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum GateInstantiation<'a> { - Cmos(GateInstantiationCmos<'a>), - Enable(GateInstantiationEnable<'a>), - Mos(GateInstantiationMos<'a>), - NInput(GateInstantiationNInput<'a>), - NOutput(GateInstantiationNOutput<'a>), - PassEn(GateInstantiationPassEn<'a>), - Pass(GateInstantiationPass<'a>), - Pulldown(GateInstantiationPulldown<'a>), - Pullup(GateInstantiationPullup<'a>), +pub enum GateInstantiation { + Cmos(GateInstantiationCmos), + Enable(GateInstantiationEnable), + Mos(GateInstantiationMos), + NInput(GateInstantiationNInput), + NOutput(GateInstantiationNOutput), + PassEn(GateInstantiationPassEn), + Pass(GateInstantiationPass), + Pulldown(GateInstantiationPulldown), + Pullup(GateInstantiationPullup), } #[derive(Debug, Node)] -pub struct GateInstantiationCmos<'a> { +pub struct GateInstantiationCmos { pub nodes: ( - CmosSwitchtype<'a>, - Option>, - List, CmosSwitchInstance<'a>>, - Symbol<'a>, + CmosSwitchtype, + Option, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct GateInstantiationEnable<'a> { +pub struct GateInstantiationEnable { pub nodes: ( - EnableGatetype<'a>, - Option>, - Option>, - List, EnableGateInstance<'a>>, - Symbol<'a>, + EnableGatetype, + Option, + Option, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct GateInstantiationMos<'a> { +pub struct GateInstantiationMos { pub nodes: ( - MosSwitchtype<'a>, - Option>, - List, MosSwitchInstance<'a>>, - Symbol<'a>, + MosSwitchtype, + Option, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct GateInstantiationNInput<'a> { +pub struct GateInstantiationNInput { pub nodes: ( - NInputGatetype<'a>, - Option>, - Option>, - List, NInputGateInstance<'a>>, - Symbol<'a>, + NInputGatetype, + Option, + Option, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct GateInstantiationNOutput<'a> { +pub struct GateInstantiationNOutput { pub nodes: ( - NOutputGatetype<'a>, - Option>, - Option>, - List, NOutputGateInstance<'a>>, - Symbol<'a>, + NOutputGatetype, + Option, + Option, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct GateInstantiationPassEn<'a> { +pub struct GateInstantiationPassEn { pub nodes: ( - PassEnSwitchtype<'a>, - Option>, - List, PassEnableSwitchInstance<'a>>, - Symbol<'a>, + PassEnSwitchtype, + Option, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct GateInstantiationPass<'a> { +pub struct GateInstantiationPass { pub nodes: ( - PassSwitchtype<'a>, - List, PassSwitchInstance<'a>>, - Symbol<'a>, + PassSwitchtype, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct GateInstantiationPulldown<'a> { +pub struct GateInstantiationPulldown { pub nodes: ( - Keyword<'a>, - Option>, - List, PullGateInstance<'a>>, - Symbol<'a>, + Keyword, + Option, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct GateInstantiationPullup<'a> { +pub struct GateInstantiationPullup { pub nodes: ( - Keyword<'a>, - Option>, - List, PullGateInstance<'a>>, - Symbol<'a>, + Keyword, + Option, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct CmosSwitchInstance<'a> { +pub struct CmosSwitchInstance { pub nodes: ( - Option>, + Option, Paren< - 'a, + ( - OutputTerminal<'a>, - Symbol<'a>, - InputTerminal<'a>, - Symbol<'a>, - NcontrolTerminal<'a>, - Symbol<'a>, - PcontrolTerminal<'a>, + OutputTerminal, + Symbol, + InputTerminal, + Symbol, + NcontrolTerminal, + Symbol, + PcontrolTerminal, ), >, ), } #[derive(Debug, Node)] -pub struct EnableGateInstance<'a> { +pub struct EnableGateInstance { pub nodes: ( - Option>, + Option, Paren< - 'a, + ( - OutputTerminal<'a>, - Symbol<'a>, - InputTerminal<'a>, - Symbol<'a>, - EnableTerminal<'a>, + OutputTerminal, + Symbol, + InputTerminal, + Symbol, + EnableTerminal, ), >, ), } #[derive(Debug, Node)] -pub struct MosSwitchInstance<'a> { +pub struct MosSwitchInstance { pub nodes: ( - Option>, + Option, Paren< - 'a, + ( - OutputTerminal<'a>, - Symbol<'a>, - InputTerminal<'a>, - Symbol<'a>, - EnableTerminal<'a>, + OutputTerminal, + Symbol, + InputTerminal, + Symbol, + EnableTerminal, ), >, ), } #[derive(Debug, Node)] -pub struct NInputGateInstance<'a> { +pub struct NInputGateInstance { pub nodes: ( - Option>, + Option, Paren< - 'a, + ( - OutputTerminal<'a>, - Symbol<'a>, - List, InputTerminal<'a>>, + OutputTerminal, + Symbol, + List, ), >, ), } #[derive(Debug, Node)] -pub struct NOutputGateInstance<'a> { +pub struct NOutputGateInstance { pub nodes: ( - Option>, + Option, Paren< - 'a, + ( - List, OutputTerminal<'a>>, - Symbol<'a>, - InputTerminal<'a>, + List, + Symbol, + InputTerminal, ), >, ), } #[derive(Debug, Node)] -pub struct PassSwitchInstance<'a> { +pub struct PassSwitchInstance { pub nodes: ( - Option>, - Paren<'a, (InoutTerminal<'a>, Symbol<'a>, InoutTerminal<'a>)>, + Option, + Paren< (InoutTerminal, Symbol, InoutTerminal)>, ), } #[derive(Debug, Node)] -pub struct PassEnableSwitchInstance<'a> { +pub struct PassEnableSwitchInstance { pub nodes: ( - Option>, + Option, Paren< - 'a, + ( - InoutTerminal<'a>, - Symbol<'a>, - InoutTerminal<'a>, - Symbol<'a>, - EnableTerminal<'a>, + InoutTerminal, + Symbol, + InoutTerminal, + Symbol, + EnableTerminal, ), >, ), } #[derive(Debug, Node)] -pub struct PullGateInstance<'a> { - pub nodes: (Option>, Paren<'a, OutputTerminal<'a>>), +pub struct PullGateInstance { + pub nodes: (Option, Paren< OutputTerminal>), } // ----------------------------------------------------------------------------- diff --git a/src/parser/primitive_instances/primitive_strengths.rs b/src/parser/primitive_instances/primitive_strengths.rs index 61ba61e..5788a5a 100644 --- a/src/parser/primitive_instances/primitive_strengths.rs +++ b/src/parser/primitive_instances/primitive_strengths.rs @@ -6,47 +6,47 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum PulldownStrength<'a> { - Strength01(PulldownStrength01<'a>), - Strength10(PulldownStrength10<'a>), - Strength0(PulldownStrength0<'a>), +pub enum PulldownStrength { + Strength01(PulldownStrength01), + Strength10(PulldownStrength10), + Strength0(PulldownStrength0), } #[derive(Debug, Node)] -pub struct PulldownStrength01<'a> { - pub nodes: (Paren<'a, (Strength0<'a>, Symbol<'a>, Strength1<'a>)>,), +pub struct PulldownStrength01 { + pub nodes: (Paren< (Strength0, Symbol, Strength1)>,), } #[derive(Debug, Node)] -pub struct PulldownStrength10<'a> { - pub nodes: (Paren<'a, (Strength1<'a>, Symbol<'a>, Strength0<'a>)>,), +pub struct PulldownStrength10 { + pub nodes: (Paren< (Strength1, Symbol, Strength0)>,), } #[derive(Debug, Node)] -pub struct PulldownStrength0<'a> { - pub nodes: (Paren<'a, Strength0<'a>>,), +pub struct PulldownStrength0 { + pub nodes: (Paren< Strength0>,), } #[derive(Debug, Node)] -pub enum PullupStrength<'a> { - Strength01(PullupStrength01<'a>), - Strength10(PullupStrength10<'a>), - Strength1(PullupStrength1<'a>), +pub enum PullupStrength { + Strength01(PullupStrength01), + Strength10(PullupStrength10), + Strength1(PullupStrength1), } #[derive(Debug, Node)] -pub struct PullupStrength01<'a> { - pub nodes: (Paren<'a, (Strength0<'a>, Symbol<'a>, Strength1<'a>)>,), +pub struct PullupStrength01 { + pub nodes: (Paren< (Strength0, Symbol, Strength1)>,), } #[derive(Debug, Node)] -pub struct PullupStrength10<'a> { - pub nodes: (Paren<'a, (Strength1<'a>, Symbol<'a>, Strength0<'a>)>,), +pub struct PullupStrength10 { + pub nodes: (Paren< (Strength1, Symbol, Strength0)>,), } #[derive(Debug, Node)] -pub struct PullupStrength1<'a> { - pub nodes: (Paren<'a, Strength1<'a>>,), +pub struct PullupStrength1 { + pub nodes: (Paren< Strength1>,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/primitive_instances/primitive_terminals.rs b/src/parser/primitive_instances/primitive_terminals.rs index e54cd50..1df3573 100644 --- a/src/parser/primitive_instances/primitive_terminals.rs +++ b/src/parser/primitive_instances/primitive_terminals.rs @@ -5,33 +5,33 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct EnableTerminal<'a> { - pub nodes: (Expression<'a>,), +pub struct EnableTerminal { + pub nodes: (Expression,), } #[derive(Debug, Node)] -pub struct InoutTerminal<'a> { - pub nodes: (NetLvalue<'a>,), +pub struct InoutTerminal { + pub nodes: (NetLvalue,), } #[derive(Debug, Node)] -pub struct InputTerminal<'a> { - pub nodes: (Expression<'a>,), +pub struct InputTerminal { + pub nodes: (Expression,), } #[derive(Debug, Node)] -pub struct NcontrolTerminal<'a> { - pub nodes: (Expression<'a>,), +pub struct NcontrolTerminal { + pub nodes: (Expression,), } #[derive(Debug, Node)] -pub struct OutputTerminal<'a> { - pub nodes: (NetLvalue<'a>,), +pub struct OutputTerminal { + pub nodes: (NetLvalue,), } #[derive(Debug, Node)] -pub struct PcontrolTerminal<'a> { - pub nodes: (Expression<'a>,), +pub struct PcontrolTerminal { + pub nodes: (Expression,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/source_text/checker_items.rs b/src/parser/source_text/checker_items.rs index 3987673..9528873 100644 --- a/src/parser/source_text/checker_items.rs +++ b/src/parser/source_text/checker_items.rs @@ -9,85 +9,85 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct CheckerPortList<'a> { - pub nodes: (List, CheckerPortItem<'a>>,), +pub struct CheckerPortList { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct CheckerPortItem<'a> { +pub struct CheckerPortItem { pub nodes: ( - Vec>, - Option>, - PropertyFormalType<'a>, - FormalPortIdentifier<'a>, - Vec>, - Option<(Symbol<'a>, PropertyActualArg<'a>)>, + Vec, + Option, + PropertyFormalType, + FormalPortIdentifier, + Vec, + Option<(Symbol, PropertyActualArg)>, ), } #[derive(Debug, Node)] -pub enum CheckerPortDirection<'a> { - Input(Keyword<'a>), - Output(Keyword<'a>), +pub enum CheckerPortDirection { + Input(Keyword), + Output(Keyword), } #[derive(Debug, Node)] -pub enum CheckerOrGenerateItem<'a> { - CheckerOrGenerateItemDeclaration(CheckerOrGenerateItemDeclaration<'a>), - InitialConstruct(InitialConstruct<'a>), - AlwaysConstruct(AlwaysConstruct<'a>), - FinalConstruct(FinalConstruct<'a>), - AssertionItem(AssertionItem<'a>), - ContinuousAssign(ContinuousAssign<'a>), - CheckerGenerateItem(CheckerGenerateItem<'a>), +pub enum CheckerOrGenerateItem { + CheckerOrGenerateItemDeclaration(CheckerOrGenerateItemDeclaration), + InitialConstruct(InitialConstruct), + AlwaysConstruct(AlwaysConstruct), + FinalConstruct(FinalConstruct), + AssertionItem(AssertionItem), + ContinuousAssign(ContinuousAssign), + CheckerGenerateItem(CheckerGenerateItem), } #[derive(Debug, Node)] -pub enum CheckerOrGenerateItemDeclaration<'a> { - Data(CheckerOrGenerateItemDeclarationData<'a>), - FunctionDeclaration(FunctionDeclaration<'a>), - CheckerDeclaration(CheckerDeclaration<'a>), - AssertionItemDeclaration(AssertionItemDeclaration<'a>), - CovergroupDeclaration(CovergroupDeclaration<'a>), - GenvarDeclaration(GenvarDeclaration<'a>), - ClockingDeclaration(ClockingDeclaration<'a>), - Clocking(CheckerOrGenerateItemDeclarationClocking<'a>), - Disable(CheckerOrGenerateItemDeclarationDisable<'a>), - Empty(Symbol<'a>), +pub enum CheckerOrGenerateItemDeclaration { + Data(CheckerOrGenerateItemDeclarationData), + FunctionDeclaration(FunctionDeclaration), + CheckerDeclaration(CheckerDeclaration), + AssertionItemDeclaration(AssertionItemDeclaration), + CovergroupDeclaration(CovergroupDeclaration), + GenvarDeclaration(GenvarDeclaration), + ClockingDeclaration(ClockingDeclaration), + Clocking(CheckerOrGenerateItemDeclarationClocking), + Disable(CheckerOrGenerateItemDeclarationDisable), + Empty(Symbol), } #[derive(Debug, Node)] -pub struct CheckerOrGenerateItemDeclarationData<'a> { - pub nodes: (Option>, DataDeclaration<'a>), +pub struct CheckerOrGenerateItemDeclarationData { + pub nodes: (Option, DataDeclaration), } #[derive(Debug, Node)] -pub struct Rand<'a> { - pub nodes: (Keyword<'a>,), +pub struct Rand { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct CheckerOrGenerateItemDeclarationClocking<'a> { - pub nodes: (Keyword<'a>, Keyword<'a>, ClockingIdentifier<'a>, Symbol<'a>), +pub struct CheckerOrGenerateItemDeclarationClocking { + pub nodes: (Keyword, Keyword, ClockingIdentifier, Symbol), } #[derive(Debug, Node)] -pub struct CheckerOrGenerateItemDeclarationDisable<'a> { +pub struct CheckerOrGenerateItemDeclarationDisable { pub nodes: ( - Keyword<'a>, - Keyword<'a>, - Keyword<'a>, - ExpressionOrDist<'a>, - Symbol<'a>, + Keyword, + Keyword, + Keyword, + ExpressionOrDist, + Symbol, ), } #[derive(Debug, Node)] -pub enum CheckerGenerateItem<'a> { - LoopGenerateConstruct(Box>), - ConditionalGenerateConstruct(Box>), - GenerateRegion(GenerateRegion<'a>), - ElaborationSystemTask(ElaborationSystemTask<'a>), +pub enum CheckerGenerateItem { + LoopGenerateConstruct(Box), + ConditionalGenerateConstruct(Box), + GenerateRegion(GenerateRegion), + ElaborationSystemTask(ElaborationSystemTask), } // ----------------------------------------------------------------------------- diff --git a/src/parser/source_text/class_items.rs b/src/parser/source_text/class_items.rs index f19e8e5..19ed8ae 100644 --- a/src/parser/source_text/class_items.rs +++ b/src/parser/source_text/class_items.rs @@ -9,193 +9,193 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum ClassItem<'a> { - Property(ClassItemProperty<'a>), - Method(ClassItemMethod<'a>), - Constraint(ClassItemConstraint<'a>), - Declaration(ClassItemDeclaration<'a>), - Covergroup(ClassItemCovergroup<'a>), - LocalParameterDeclaration((LocalParameterDeclaration<'a>, Symbol<'a>)), - ParameterDeclaration((ParameterDeclaration<'a>, Symbol<'a>)), - Empty(Symbol<'a>), +pub enum ClassItem { + Property(ClassItemProperty), + Method(ClassItemMethod), + Constraint(ClassItemConstraint), + Declaration(ClassItemDeclaration), + Covergroup(ClassItemCovergroup), + LocalParameterDeclaration((LocalParameterDeclaration, Symbol)), + ParameterDeclaration((ParameterDeclaration, Symbol)), + Empty(Symbol), } #[derive(Debug, Node)] -pub struct ClassItemProperty<'a> { - pub nodes: (Vec>, ClassProperty<'a>), +pub struct ClassItemProperty { + pub nodes: (Vec, ClassProperty), } #[derive(Debug, Node)] -pub struct ClassItemMethod<'a> { - pub nodes: (Vec>, ClassMethod<'a>), +pub struct ClassItemMethod { + pub nodes: (Vec, ClassMethod), } #[derive(Debug, Node)] -pub struct ClassItemConstraint<'a> { - pub nodes: (Vec>, ClassConstraint<'a>), +pub struct ClassItemConstraint { + pub nodes: (Vec, ClassConstraint), } #[derive(Debug, Node)] -pub struct ClassItemDeclaration<'a> { - pub nodes: (Vec>, ClassDeclaration<'a>), +pub struct ClassItemDeclaration { + pub nodes: (Vec, ClassDeclaration), } #[derive(Debug, Node)] -pub struct ClassItemCovergroup<'a> { - pub nodes: (Vec>, CovergroupDeclaration<'a>), +pub struct ClassItemCovergroup { + pub nodes: (Vec, CovergroupDeclaration), } #[derive(Debug, Node)] -pub enum ClassProperty<'a> { - NonConst(ClassPropertyNonConst<'a>), - Const(ClassPropertyConst<'a>), +pub enum ClassProperty { + NonConst(ClassPropertyNonConst), + Const(ClassPropertyConst), } #[derive(Debug, Node)] -pub struct ClassPropertyNonConst<'a> { - pub nodes: (Vec>, DataDeclaration<'a>), +pub struct ClassPropertyNonConst { + pub nodes: (Vec, DataDeclaration), } #[derive(Debug, Node)] -pub struct ClassPropertyConst<'a> { +pub struct ClassPropertyConst { pub nodes: ( - Keyword<'a>, - Vec>, - DataType<'a>, - ConstIdentifier<'a>, - Option<(Symbol<'a>, ConstantExpression<'a>)>, - Symbol<'a>, + Keyword, + Vec, + DataType, + ConstIdentifier, + Option<(Symbol, ConstantExpression)>, + Symbol, ), } #[derive(Debug, Node)] -pub enum ClassMethod<'a> { - Task(ClassMethodTask<'a>), - Function(ClassMethodFunction<'a>), - PureVirtual(ClassMethodPureVirtual<'a>), - ExternMethod(ClassMethodExternMethod<'a>), - Constructor(ClassMethodConstructor<'a>), - ExternConstructor(ClassMethodExternConstructor<'a>), +pub enum ClassMethod { + Task(ClassMethodTask), + Function(ClassMethodFunction), + PureVirtual(ClassMethodPureVirtual), + ExternMethod(ClassMethodExternMethod), + Constructor(ClassMethodConstructor), + ExternConstructor(ClassMethodExternConstructor), } #[derive(Debug, Node)] -pub struct ClassMethodTask<'a> { - pub nodes: (Vec>, TaskDeclaration<'a>), +pub struct ClassMethodTask { + pub nodes: (Vec, TaskDeclaration), } #[derive(Debug, Node)] -pub struct ClassMethodFunction<'a> { - pub nodes: (Vec>, FunctionDeclaration<'a>), +pub struct ClassMethodFunction { + pub nodes: (Vec, FunctionDeclaration), } #[derive(Debug, Node)] -pub struct ClassMethodPureVirtual<'a> { +pub struct ClassMethodPureVirtual { pub nodes: ( - Keyword<'a>, - Keyword<'a>, - Vec>, - MethodPrototype<'a>, - Symbol<'a>, + Keyword, + Keyword, + Vec, + MethodPrototype, + Symbol, ), } #[derive(Debug, Node)] -pub struct ClassMethodExternMethod<'a> { +pub struct ClassMethodExternMethod { pub nodes: ( - Keyword<'a>, - Vec>, - MethodPrototype<'a>, - Symbol<'a>, + Keyword, + Vec, + MethodPrototype, + Symbol, ), } #[derive(Debug, Node)] -pub struct ClassMethodConstructor<'a> { - pub nodes: (Vec>, ClassConstructorDeclaration<'a>), +pub struct ClassMethodConstructor { + pub nodes: (Vec, ClassConstructorDeclaration), } #[derive(Debug, Node)] -pub struct ClassMethodExternConstructor<'a> { +pub struct ClassMethodExternConstructor { pub nodes: ( - Keyword<'a>, - Vec>, - ClassConstructorPrototype<'a>, + Keyword, + Vec, + ClassConstructorPrototype, ), } #[derive(Debug, Node)] -pub struct ClassConstructorPrototype<'a> { +pub struct ClassConstructorPrototype { pub nodes: ( - Keyword<'a>, - Keyword<'a>, - Option>>>, - Symbol<'a>, + Keyword, + Keyword, + Option>>, + Symbol, ), } #[derive(Debug, Node)] -pub enum ClassConstraint<'a> { - ConstraintPrototype(ConstraintPrototype<'a>), - ConstraintDeclaration(ConstraintDeclaration<'a>), +pub enum ClassConstraint { + ConstraintPrototype(ConstraintPrototype), + ConstraintDeclaration(ConstraintDeclaration), } #[derive(Debug, Node)] -pub enum ClassItemQualifier<'a> { - Static(Keyword<'a>), - Protected(Keyword<'a>), - Local(Keyword<'a>), +pub enum ClassItemQualifier { + Static(Keyword), + Protected(Keyword), + Local(Keyword), } #[derive(Debug, Node)] -pub enum PropertyQualifier<'a> { - RandomQualifier(RandomQualifier<'a>), - ClassItemQualifier(ClassItemQualifier<'a>), +pub enum PropertyQualifier { + RandomQualifier(RandomQualifier), + ClassItemQualifier(ClassItemQualifier), } #[derive(Debug, Node)] -pub enum RandomQualifier<'a> { - Rand(Keyword<'a>), - Randc(Keyword<'a>), +pub enum RandomQualifier { + Rand(Keyword), + Randc(Keyword), } #[derive(Debug, Node)] -pub enum MethodQualifier<'a> { - Virtual(Keyword<'a>), - PureVirtual((Keyword<'a>, Keyword<'a>)), - ClassItemQualifier(ClassItemQualifier<'a>), +pub enum MethodQualifier { + Virtual(Keyword), + PureVirtual((Keyword, Keyword)), + ClassItemQualifier(ClassItemQualifier), } #[derive(Debug, Node)] -pub enum MethodPrototype<'a> { - TaskPrototype(TaskPrototype<'a>), - FunctionPrototype(FunctionPrototype<'a>), +pub enum MethodPrototype { + TaskPrototype(TaskPrototype), + FunctionPrototype(FunctionPrototype), } #[derive(Debug, Node)] -pub struct ClassConstructorDeclaration<'a> { +pub struct ClassConstructorDeclaration { pub nodes: ( - Keyword<'a>, - Option>, - Keyword<'a>, - Option>>>, - Symbol<'a>, - Vec>, + Keyword, + Option, + Keyword, + Option>>, + Symbol, + Vec, Option<( - Keyword<'a>, - Symbol<'a>, - Keyword<'a>, - Option>>, - Symbol<'a>, + Keyword, + Symbol, + Keyword, + Option>, + Symbol, )>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, New<'a>)>, + Vec, + Keyword, + Option<(Symbol, New)>, ), } #[derive(Debug, Node)] -pub struct New<'a> { - pub nodes: (Keyword<'a>,), +pub struct New { + pub nodes: (Keyword,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/source_text/configuration_source_text.rs b/src/parser/source_text/configuration_source_text.rs index 7847f92..5da92f2 100644 --- a/src/parser/source_text/configuration_source_text.rs +++ b/src/parser/source_text/configuration_source_text.rs @@ -9,137 +9,137 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct ConfigDeclaration<'a> { +pub struct ConfigDeclaration { pub nodes: ( - Keyword<'a>, - ConfigIdentifier<'a>, - Symbol<'a>, - Vec<(LocalParameterDeclaration<'a>, Symbol<'a>)>, - DesignStatement<'a>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, ConfigIdentifier<'a>)>, + Keyword, + ConfigIdentifier, + Symbol, + Vec<(LocalParameterDeclaration, Symbol)>, + DesignStatement, + Vec, + Keyword, + Option<(Symbol, ConfigIdentifier)>, ), } #[derive(Debug, Node)] -pub struct DesignStatement<'a> { +pub struct DesignStatement { pub nodes: ( - Keyword<'a>, + Keyword, Vec<( - Option<(LibraryIdentifier<'a>, Symbol<'a>)>, - CellIdentifier<'a>, + Option<(LibraryIdentifier, Symbol)>, + CellIdentifier, )>, - Symbol<'a>, + Symbol, ), } #[derive(Debug, Node)] -pub enum ConfigRuleStatement<'a> { - Default(ConfigRuleStatementDefault<'a>), - InstLib(ConfigRuleStatementInstLib<'a>), - InstUse(ConfigRuleStatementInstUse<'a>), - CellLib(ConfigRuleStatementCellLib<'a>), - CellUse(ConfigRuleStatementCellUse<'a>), +pub enum ConfigRuleStatement { + Default(ConfigRuleStatementDefault), + InstLib(ConfigRuleStatementInstLib), + InstUse(ConfigRuleStatementInstUse), + CellLib(ConfigRuleStatementCellLib), + CellUse(ConfigRuleStatementCellUse), } #[derive(Debug, Node)] -pub struct ConfigRuleStatementDefault<'a> { - pub nodes: (DefaultClause<'a>, LiblistClause<'a>, Symbol<'a>), +pub struct ConfigRuleStatementDefault { + pub nodes: (DefaultClause, LiblistClause, Symbol), } #[derive(Debug, Node)] -pub struct ConfigRuleStatementInstLib<'a> { - pub nodes: (InstClause<'a>, LiblistClause<'a>, Symbol<'a>), +pub struct ConfigRuleStatementInstLib { + pub nodes: (InstClause, LiblistClause, Symbol), } #[derive(Debug, Node)] -pub struct ConfigRuleStatementInstUse<'a> { - pub nodes: (InstClause<'a>, UseClause<'a>, Symbol<'a>), +pub struct ConfigRuleStatementInstUse { + pub nodes: (InstClause, UseClause, Symbol), } #[derive(Debug, Node)] -pub struct ConfigRuleStatementCellLib<'a> { - pub nodes: (CellClause<'a>, LiblistClause<'a>, Symbol<'a>), +pub struct ConfigRuleStatementCellLib { + pub nodes: (CellClause, LiblistClause, Symbol), } #[derive(Debug, Node)] -pub struct ConfigRuleStatementCellUse<'a> { - pub nodes: (CellClause<'a>, UseClause<'a>, Symbol<'a>), +pub struct ConfigRuleStatementCellUse { + pub nodes: (CellClause, UseClause, Symbol), } #[derive(Debug, Node)] -pub struct DefaultClause<'a> { - pub nodes: (Keyword<'a>,), +pub struct DefaultClause { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct InstClause<'a> { - pub nodes: (Keyword<'a>, InstName<'a>), +pub struct InstClause { + pub nodes: (Keyword, InstName), } #[derive(Debug, Node)] -pub struct InstName<'a> { +pub struct InstName { pub nodes: ( - TopmoduleIdentifier<'a>, - Vec<(Symbol<'a>, InstanceIdentifier<'a>)>, + TopmoduleIdentifier, + Vec<(Symbol, InstanceIdentifier)>, ), } #[derive(Debug, Node)] -pub struct CellClause<'a> { +pub struct CellClause { pub nodes: ( - Keyword<'a>, - Option<(LibraryIdentifier<'a>, Symbol<'a>)>, - CellIdentifier<'a>, + Keyword, + Option<(LibraryIdentifier, Symbol)>, + CellIdentifier, ), } #[derive(Debug, Node)] -pub struct LiblistClause<'a> { - pub nodes: (Keyword<'a>, Vec>), +pub struct LiblistClause { + pub nodes: (Keyword, Vec), } #[derive(Debug, Node)] -pub enum UseClause<'a> { - Cell(UseClauseCell<'a>), - Named(UseClauseNamed<'a>), - CellNamed(UseClauseCellNamed<'a>), +pub enum UseClause { + Cell(UseClauseCell), + Named(UseClauseNamed), + CellNamed(UseClauseCellNamed), } #[derive(Debug, Node)] -pub struct UseClauseCell<'a> { +pub struct UseClauseCell { pub nodes: ( - Keyword<'a>, - Option<(LibraryIdentifier<'a>, Symbol<'a>)>, - CellIdentifier<'a>, - Option<(Symbol<'a>, Config<'a>)>, + Keyword, + Option<(LibraryIdentifier, Symbol)>, + CellIdentifier, + Option<(Symbol, Config)>, ), } #[derive(Debug, Node)] -pub struct UseClauseNamed<'a> { +pub struct UseClauseNamed { pub nodes: ( - Keyword<'a>, - List, NamedParameterAssignment<'a>>, - Option<(Symbol<'a>, Config<'a>)>, + Keyword, + List, + Option<(Symbol, Config)>, ), } #[derive(Debug, Node)] -pub struct UseClauseCellNamed<'a> { +pub struct UseClauseCellNamed { pub nodes: ( - Keyword<'a>, - Option<(LibraryIdentifier<'a>, Symbol<'a>)>, - CellIdentifier<'a>, - List, NamedParameterAssignment<'a>>, - Option<(Symbol<'a>, Config<'a>)>, + Keyword, + Option<(LibraryIdentifier, Symbol)>, + CellIdentifier, + List, + Option<(Symbol, Config)>, ), } #[derive(Debug, Node)] -pub struct Config<'a> { - pub nodes: (Keyword<'a>,), +pub struct Config { + pub nodes: (Keyword,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/source_text/constraints.rs b/src/parser/source_text/constraints.rs index b8c621d..7fc80a1 100644 --- a/src/parser/source_text/constraints.rs +++ b/src/parser/source_text/constraints.rs @@ -9,184 +9,184 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct ConstraintDeclaration<'a> { +pub struct ConstraintDeclaration { pub nodes: ( - Option>, - Keyword<'a>, - ConstraintIdentifier<'a>, - ConstraintBlock<'a>, + Option, + Keyword, + ConstraintIdentifier, + ConstraintBlock, ), } #[derive(Debug, Node)] -pub struct Static<'a> { - pub nodes: (Keyword<'a>,), +pub struct Static { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct ConstraintBlock<'a> { - pub nodes: (Brace<'a, Vec>>,), +pub struct ConstraintBlock { + pub nodes: (Brace< Vec>,), } #[derive(Debug, Node)] -pub enum ConstraintBlockItem<'a> { - Solve(ConstraintBlockItemSolve<'a>), - ConstraintExpression(ConstraintExpression<'a>), +pub enum ConstraintBlockItem { + Solve(ConstraintBlockItemSolve), + ConstraintExpression(ConstraintExpression), } #[derive(Debug, Node)] -pub struct ConstraintBlockItemSolve<'a> { +pub struct ConstraintBlockItemSolve { pub nodes: ( - Keyword<'a>, - SolveBeforeList<'a>, - Keyword<'a>, - SolveBeforeList<'a>, - Symbol<'a>, + Keyword, + SolveBeforeList, + Keyword, + SolveBeforeList, + Symbol, ), } #[derive(Debug, Node)] -pub struct SolveBeforeList<'a> { - pub nodes: (List, ConstraintPrimary<'a>>,), +pub struct SolveBeforeList { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ConstraintPrimary<'a> { +pub struct ConstraintPrimary { pub nodes: ( - Option>, - HierarchicalIdentifier<'a>, - Select<'a>, + Option, + HierarchicalIdentifier, + Select, ), } #[derive(Debug, Node)] -pub enum ConstraintExpression<'a> { - Expression(ConstraintExpressionExpression<'a>), - UniquenessConstraint((UniquenessConstraint<'a>, Symbol<'a>)), - Arrow(ConstraintExpressionArrow<'a>), - If(ConstraintExpressionIf<'a>), - Foreach(ConstraintExpressionForeach<'a>), - Disable(ConstraintExpressionDisable<'a>), +pub enum ConstraintExpression { + Expression(ConstraintExpressionExpression), + UniquenessConstraint((UniquenessConstraint, Symbol)), + Arrow(ConstraintExpressionArrow), + If(ConstraintExpressionIf), + Foreach(ConstraintExpressionForeach), + Disable(ConstraintExpressionDisable), } #[derive(Debug, Node)] -pub struct ConstraintExpressionExpression<'a> { - pub nodes: (Option>, ExpressionOrDist<'a>, Symbol<'a>), +pub struct ConstraintExpressionExpression { + pub nodes: (Option, ExpressionOrDist, Symbol), } #[derive(Debug, Node)] -pub struct Soft<'a> { - pub nodes: (Keyword<'a>,), +pub struct Soft { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct ConstraintExpressionArrow<'a> { - pub nodes: (Expression<'a>, Symbol<'a>, ConstraintSet<'a>), +pub struct ConstraintExpressionArrow { + pub nodes: (Expression, Symbol, ConstraintSet), } #[derive(Debug, Node)] -pub struct ConstraintExpressionIf<'a> { +pub struct ConstraintExpressionIf { pub nodes: ( - Keyword<'a>, - Paren<'a, Expression<'a>>, - ConstraintSet<'a>, - Option<(Keyword<'a>, ConstraintSet<'a>)>, + Keyword, + Paren< Expression>, + ConstraintSet, + Option<(Keyword, ConstraintSet)>, ), } #[derive(Debug, Node)] -pub struct ConstraintExpressionForeach<'a> { +pub struct ConstraintExpressionForeach { pub nodes: ( - Keyword<'a>, + Keyword, Paren< - 'a, + ( - PsOrHierarchicalArrayIdentifier<'a>, - Bracket<'a, LoopVariables<'a>>, + PsOrHierarchicalArrayIdentifier, + Bracket< LoopVariables>, ), >, - ConstraintSet<'a>, + ConstraintSet, ), } #[derive(Debug, Node)] -pub struct ConstraintExpressionDisable<'a> { - pub nodes: (Keyword<'a>, Keyword<'a>, ConstraintPrimary<'a>, Symbol<'a>), +pub struct ConstraintExpressionDisable { + pub nodes: (Keyword, Keyword, ConstraintPrimary, Symbol), } #[derive(Debug, Node)] -pub struct UniquenessConstraint<'a> { - pub nodes: (Keyword<'a>, Brace<'a, OpenRangeList<'a>>), +pub struct UniquenessConstraint { + pub nodes: (Keyword, Brace< OpenRangeList>), } #[derive(Debug, Node)] -pub enum ConstraintSet<'a> { - ConstraintExpression(Box>), - Brace(ConstraintSetBrace<'a>), +pub enum ConstraintSet { + ConstraintExpression(Box), + Brace(ConstraintSetBrace), } #[derive(Debug, Node)] -pub struct ConstraintSetBrace<'a> { - pub nodes: (Brace<'a, Vec>>,), +pub struct ConstraintSetBrace { + pub nodes: (Brace< Vec>,), } #[derive(Debug, Node)] -pub struct DistList<'a> { - pub nodes: (List, DistItem<'a>>,), +pub struct DistList { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct DistItem<'a> { - pub nodes: (ValueRange<'a>, Option>), +pub struct DistItem { + pub nodes: (ValueRange, Option), } #[derive(Debug, Node)] -pub enum DistWeight<'a> { - Equal(DistWeightEqual<'a>), - Divide(DistWeightDivide<'a>), +pub enum DistWeight { + Equal(DistWeightEqual), + Divide(DistWeightDivide), } #[derive(Debug, Node)] -pub struct DistWeightEqual<'a> { - pub nodes: (Symbol<'a>, Expression<'a>), +pub struct DistWeightEqual { + pub nodes: (Symbol, Expression), } #[derive(Debug, Node)] -pub struct DistWeightDivide<'a> { - pub nodes: (Symbol<'a>, Expression<'a>), +pub struct DistWeightDivide { + pub nodes: (Symbol, Expression), } #[derive(Debug, Node)] -pub struct ConstraintPrototype<'a> { +pub struct ConstraintPrototype { pub nodes: ( - Option>, - Option>, - Keyword<'a>, - ConstraintIdentifier<'a>, - Symbol<'a>, + Option, + Option, + Keyword, + ConstraintIdentifier, + Symbol, ), } #[derive(Debug, Node)] -pub enum ConstraintPrototypeQualifier<'a> { - Extern(Keyword<'a>), - Pure(Keyword<'a>), +pub enum ConstraintPrototypeQualifier { + Extern(Keyword), + Pure(Keyword), } #[derive(Debug, Node)] -pub struct ExternConstraintDeclaration<'a> { +pub struct ExternConstraintDeclaration { pub nodes: ( - Option>, - Keyword<'a>, - ClassScope<'a>, - ConstraintIdentifier<'a>, - ConstraintBlock<'a>, + Option, + Keyword, + ClassScope, + ConstraintIdentifier, + ConstraintBlock, ), } #[derive(Debug, Node)] -pub struct IdentifierList<'a> { - pub nodes: (List, Identifier<'a>>,), +pub struct IdentifierList { + pub nodes: (List,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/source_text/interface_items.rs b/src/parser/source_text/interface_items.rs index 8e8a475..c2ea4d4 100644 --- a/src/parser/source_text/interface_items.rs +++ b/src/parser/source_text/interface_items.rs @@ -9,51 +9,51 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum InterfaceOrGenerateItem<'a> { - Module(InterfaceOrGenerateItemModule<'a>), - Extern(InterfaceOrGenerateItemExtern<'a>), +pub enum InterfaceOrGenerateItem { + Module(InterfaceOrGenerateItemModule), + Extern(InterfaceOrGenerateItemExtern), } #[derive(Debug, Node)] -pub struct InterfaceOrGenerateItemModule<'a> { - pub nodes: (Vec>, ModuleCommonItem<'a>), +pub struct InterfaceOrGenerateItemModule { + pub nodes: (Vec, ModuleCommonItem), } #[derive(Debug, Node)] -pub struct InterfaceOrGenerateItemExtern<'a> { - pub nodes: (Vec>, ExternTfDeclaration<'a>), +pub struct InterfaceOrGenerateItemExtern { + pub nodes: (Vec, ExternTfDeclaration), } #[derive(Debug, Node)] -pub enum ExternTfDeclaration<'a> { - Method(ExternTfDeclarationMethod<'a>), - Task(ExternTfDeclarationTask<'a>), +pub enum ExternTfDeclaration { + Method(ExternTfDeclarationMethod), + Task(ExternTfDeclarationTask), } #[derive(Debug, Node)] -pub struct ExternTfDeclarationMethod<'a> { - pub nodes: (Keyword<'a>, MethodPrototype<'a>, Symbol<'a>), +pub struct ExternTfDeclarationMethod { + pub nodes: (Keyword, MethodPrototype, Symbol), } #[derive(Debug, Node)] -pub struct ExternTfDeclarationTask<'a> { - pub nodes: (Keyword<'a>, Keyword<'a>, TaskPrototype<'a>, Symbol<'a>), +pub struct ExternTfDeclarationTask { + pub nodes: (Keyword, Keyword, TaskPrototype, Symbol), } #[derive(Debug, Node)] -pub enum InterfaceItem<'a> { - PortDeclaration((PortDeclaration<'a>, Symbol<'a>)), - NonPortInterfaceItem(NonPortInterfaceItem<'a>), +pub enum InterfaceItem { + PortDeclaration((PortDeclaration, Symbol)), + NonPortInterfaceItem(NonPortInterfaceItem), } #[derive(Debug, Node)] -pub enum NonPortInterfaceItem<'a> { - GenerateRegion(GenerateRegion<'a>), - InterfaceOrGenerateItem(InterfaceOrGenerateItem<'a>), - ProgramDeclaration(ProgramDeclaration<'a>), - ModportDeclaration(ModportDeclaration<'a>), - InterfaceDeclaration(InterfaceDeclaration<'a>), - TimeunitsDeclaration(TimeunitsDeclaration<'a>), +pub enum NonPortInterfaceItem { + GenerateRegion(GenerateRegion), + InterfaceOrGenerateItem(InterfaceOrGenerateItem), + ProgramDeclaration(ProgramDeclaration), + ModportDeclaration(ModportDeclaration), + InterfaceDeclaration(InterfaceDeclaration), + TimeunitsDeclaration(TimeunitsDeclaration), } // ----------------------------------------------------------------------------- diff --git a/src/parser/source_text/library_source_text.rs b/src/parser/source_text/library_source_text.rs index 932bbd9..63faa19 100644 --- a/src/parser/source_text/library_source_text.rs +++ b/src/parser/source_text/library_source_text.rs @@ -9,37 +9,37 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct LibraryText<'a> { - pub nodes: (Vec>,), +pub struct LibraryText { + pub nodes: (Vec,), } #[derive(Debug, Node)] -pub enum LibraryDescription<'a> { - LibraryDeclaration(LibraryDeclaration<'a>), - IncludeStatement(IncludeStatement<'a>), - ConfigDeclaration(ConfigDeclaration<'a>), - Null(Symbol<'a>), +pub enum LibraryDescription { + LibraryDeclaration(LibraryDeclaration), + IncludeStatement(IncludeStatement), + ConfigDeclaration(ConfigDeclaration), + Null(Symbol), } #[derive(Debug, Node)] -pub struct LibraryDeclaration<'a> { +pub struct LibraryDeclaration { pub nodes: ( - Keyword<'a>, - LibraryIdentifier<'a>, - List, FilePathSpec<'a>>, - Option<(Keyword<'a>, List, FilePathSpec<'a>>)>, - Symbol<'a>, + Keyword, + LibraryIdentifier, + List, + Option<(Keyword, List)>, + Symbol, ), } #[derive(Debug, Node)] -pub struct IncludeStatement<'a> { - pub nodes: (Keyword<'a>, FilePathSpec<'a>, Symbol<'a>), +pub struct IncludeStatement { + pub nodes: (Keyword, FilePathSpec, Symbol), } #[derive(Debug, Node)] -pub struct FilePathSpec<'a> { - pub nodes: (StringLiteral<'a>,), +pub struct FilePathSpec { + pub nodes: (StringLiteral,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/source_text/module_items.rs b/src/parser/source_text/module_items.rs index 2ed6316..1c40105 100644 --- a/src/parser/source_text/module_items.rs +++ b/src/parser/source_text/module_items.rs @@ -9,209 +9,209 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum ElaborationSystemTask<'a> { - Fatal(ElaborationSystemTaskFatal<'a>), - Error(ElaborationSystemTaskError<'a>), - Warning(ElaborationSystemTaskWarning<'a>), - Info(ElaborationSystemTaskInfo<'a>), +pub enum ElaborationSystemTask { + Fatal(ElaborationSystemTaskFatal), + Error(ElaborationSystemTaskError), + Warning(ElaborationSystemTaskWarning), + Info(ElaborationSystemTaskInfo), } #[derive(Debug, Node)] -pub struct ElaborationSystemTaskFatal<'a> { +pub struct ElaborationSystemTaskFatal { pub nodes: ( - Keyword<'a>, - Option, Option<(Symbol<'a>, ListOfArguments<'a>)>)>>, - Symbol<'a>, + Keyword, + Option)>>, + Symbol, ), } #[derive(Debug, Node)] -pub struct ElaborationSystemTaskError<'a> { +pub struct ElaborationSystemTaskError { pub nodes: ( - Keyword<'a>, - Option>>>, - Symbol<'a>, + Keyword, + Option>>, + Symbol, ), } #[derive(Debug, Node)] -pub struct ElaborationSystemTaskWarning<'a> { +pub struct ElaborationSystemTaskWarning { pub nodes: ( - Keyword<'a>, - Option>>>, - Symbol<'a>, + Keyword, + Option>>, + Symbol, ), } #[derive(Debug, Node)] -pub struct ElaborationSystemTaskInfo<'a> { +pub struct ElaborationSystemTaskInfo { pub nodes: ( - Keyword<'a>, - Option>>>, - Symbol<'a>, + Keyword, + Option>>, + Symbol, ), } #[derive(Debug, Node)] -pub enum FinishNumber<'a> { - Zero(Symbol<'a>), - One(Symbol<'a>), - Two(Symbol<'a>), +pub enum FinishNumber { + Zero(Symbol), + One(Symbol), + Two(Symbol), } #[derive(Debug, Node)] -pub enum ModuleCommonItem<'a> { - ModuleOrGenerateItemDeclaration(ModuleOrGenerateItemDeclaration<'a>), - InterfaceInstantiation(InterfaceInstantiation<'a>), - ProgramInstantiation(ProgramInstantiation<'a>), - AssertionItem(AssertionItem<'a>), - BindDirective(BindDirective<'a>), - ContinuousAssign(ContinuousAssign<'a>), - NetAlias(NetAlias<'a>), - InitialConstruct(InitialConstruct<'a>), - FinalConstruct(FinalConstruct<'a>), - AlwaysConstruct(AlwaysConstruct<'a>), - LoopGenerateConstruct(Box>), - ConditionalGenerateConstruct(Box>), - ElaborationSystemTask(ElaborationSystemTask<'a>), +pub enum ModuleCommonItem { + ModuleOrGenerateItemDeclaration(ModuleOrGenerateItemDeclaration), + InterfaceInstantiation(InterfaceInstantiation), + ProgramInstantiation(ProgramInstantiation), + AssertionItem(AssertionItem), + BindDirective(BindDirective), + ContinuousAssign(ContinuousAssign), + NetAlias(NetAlias), + InitialConstruct(InitialConstruct), + FinalConstruct(FinalConstruct), + AlwaysConstruct(AlwaysConstruct), + LoopGenerateConstruct(Box), + ConditionalGenerateConstruct(Box), + ElaborationSystemTask(ElaborationSystemTask), } #[derive(Debug, Node)] -pub enum ModuleItem<'a> { - PortDeclaration((PortDeclaration<'a>, Symbol<'a>)), - NonPortModuleItem(NonPortModuleItem<'a>), +pub enum ModuleItem { + PortDeclaration((PortDeclaration, Symbol)), + NonPortModuleItem(NonPortModuleItem), } #[derive(Debug, Node)] -pub enum ModuleOrGenerateItem<'a> { - Parameter(ModuleOrGenerateItemParameter<'a>), - Gate(ModuleOrGenerateItemGate<'a>), - Udp(ModuleOrGenerateItemUdp<'a>), - Module(ModuleOrGenerateItemModule<'a>), - ModuleItem(Box>), +pub enum ModuleOrGenerateItem { + Parameter(ModuleOrGenerateItemParameter), + Gate(ModuleOrGenerateItemGate), + Udp(ModuleOrGenerateItemUdp), + Module(ModuleOrGenerateItemModule), + ModuleItem(Box), } #[derive(Debug, Node)] -pub struct ModuleOrGenerateItemParameter<'a> { - pub nodes: (Vec>, ParameterOverride<'a>), +pub struct ModuleOrGenerateItemParameter { + pub nodes: (Vec, ParameterOverride), } #[derive(Debug, Node)] -pub struct ModuleOrGenerateItemGate<'a> { - pub nodes: (Vec>, GateInstantiation<'a>), +pub struct ModuleOrGenerateItemGate { + pub nodes: (Vec, GateInstantiation), } #[derive(Debug, Node)] -pub struct ModuleOrGenerateItemUdp<'a> { - pub nodes: (Vec>, UdpInstantiation<'a>), +pub struct ModuleOrGenerateItemUdp { + pub nodes: (Vec, UdpInstantiation), } #[derive(Debug, Node)] -pub struct ModuleOrGenerateItemModule<'a> { - pub nodes: (Vec>, ModuleInstantiation<'a>), +pub struct ModuleOrGenerateItemModule { + pub nodes: (Vec, ModuleInstantiation), } #[derive(Debug, Node)] -pub struct ModuleOrGenerateItemModuleItem<'a> { - pub nodes: (Vec>, ModuleCommonItem<'a>), +pub struct ModuleOrGenerateItemModuleItem { + pub nodes: (Vec, ModuleCommonItem), } #[derive(Debug, Node)] -pub enum ModuleOrGenerateItemDeclaration<'a> { - PackageOrGenerateItemDeclaration(PackageOrGenerateItemDeclaration<'a>), - GenvarDeclaration(GenvarDeclaration<'a>), - ClockingDeclaration(ClockingDeclaration<'a>), - Clocking(ModuleOrGenerateItemDeclarationClocking<'a>), - Disable(ModuleOrGenerateItemDeclarationDisable<'a>), +pub enum ModuleOrGenerateItemDeclaration { + PackageOrGenerateItemDeclaration(PackageOrGenerateItemDeclaration), + GenvarDeclaration(GenvarDeclaration), + ClockingDeclaration(ClockingDeclaration), + Clocking(ModuleOrGenerateItemDeclarationClocking), + Disable(ModuleOrGenerateItemDeclarationDisable), } #[derive(Debug, Node)] -pub struct ModuleOrGenerateItemDeclarationClocking<'a> { - pub nodes: (Keyword<'a>, Keyword<'a>, ClockingIdentifier<'a>, Symbol<'a>), +pub struct ModuleOrGenerateItemDeclarationClocking { + pub nodes: (Keyword, Keyword, ClockingIdentifier, Symbol), } #[derive(Debug, Node)] -pub struct ModuleOrGenerateItemDeclarationDisable<'a> { +pub struct ModuleOrGenerateItemDeclarationDisable { pub nodes: ( - Keyword<'a>, - Keyword<'a>, - Keyword<'a>, - ExpressionOrDist<'a>, - Symbol<'a>, + Keyword, + Keyword, + Keyword, + ExpressionOrDist, + Symbol, ), } #[derive(Debug, Node)] -pub enum NonPortModuleItem<'a> { - GenerateRegion(GenerateRegion<'a>), - ModuleOrGenerateItem(ModuleOrGenerateItem<'a>), - SpecifyBlock(SpecifyBlock<'a>), - Specparam(NonPortModuleItemSpecparam<'a>), - ProgramDeclaration(ProgramDeclaration<'a>), - ModuleDeclaration(ModuleDeclaration<'a>), - InterfaceDeclaration(InterfaceDeclaration<'a>), - TimeunitsDeclaration(TimeunitsDeclaration<'a>), +pub enum NonPortModuleItem { + GenerateRegion(GenerateRegion), + ModuleOrGenerateItem(ModuleOrGenerateItem), + SpecifyBlock(SpecifyBlock), + Specparam(NonPortModuleItemSpecparam), + ProgramDeclaration(ProgramDeclaration), + ModuleDeclaration(ModuleDeclaration), + InterfaceDeclaration(InterfaceDeclaration), + TimeunitsDeclaration(TimeunitsDeclaration), } #[derive(Debug, Node)] -pub struct NonPortModuleItemSpecparam<'a> { - pub nodes: (Vec>, SpecparamDeclaration<'a>), +pub struct NonPortModuleItemSpecparam { + pub nodes: (Vec, SpecparamDeclaration), } #[derive(Debug, Node)] -pub struct ParameterOverride<'a> { - pub nodes: (Keyword<'a>, ListOfDefparamAssignments<'a>, Symbol<'a>), +pub struct ParameterOverride { + pub nodes: (Keyword, ListOfDefparamAssignments, Symbol), } #[derive(Debug, Node)] -pub enum BindDirective<'a> { - Scope(BindDirectiveScope<'a>), - Instance(BindDirectiveInstance<'a>), +pub enum BindDirective { + Scope(BindDirectiveScope), + Instance(BindDirectiveInstance), } #[derive(Debug, Node)] -pub struct BindDirectiveScope<'a> { +pub struct BindDirectiveScope { pub nodes: ( - Keyword<'a>, - BindTargetScope<'a>, - Option<(Symbol<'a>, BindTargetInstanceList<'a>)>, - BindInstantiation<'a>, - Symbol<'a>, + Keyword, + BindTargetScope, + Option<(Symbol, BindTargetInstanceList)>, + BindInstantiation, + Symbol, ), } #[derive(Debug, Node)] -pub struct BindDirectiveInstance<'a> { +pub struct BindDirectiveInstance { pub nodes: ( - Keyword<'a>, - BindTargetInstance<'a>, - BindInstantiation<'a>, - Symbol<'a>, + Keyword, + BindTargetInstance, + BindInstantiation, + Symbol, ), } #[derive(Debug, Node)] -pub enum BindTargetScope<'a> { - ModuleIdentifier(ModuleIdentifier<'a>), - InterfaceIdentifier(InterfaceIdentifier<'a>), +pub enum BindTargetScope { + ModuleIdentifier(ModuleIdentifier), + InterfaceIdentifier(InterfaceIdentifier), } #[derive(Debug, Node)] -pub struct BindTargetInstance<'a> { - pub nodes: (HierarchicalIdentifier<'a>, ConstantBitSelect<'a>), +pub struct BindTargetInstance { + pub nodes: (HierarchicalIdentifier, ConstantBitSelect), } #[derive(Debug, Node)] -pub struct BindTargetInstanceList<'a> { - pub nodes: (List, BindTargetInstance<'a>>,), +pub struct BindTargetInstanceList { + pub nodes: (List,), } #[derive(Debug, Node)] -pub enum BindInstantiation<'a> { - ProgramInstantiation(ProgramInstantiation<'a>), - ModuleInstantiation(ModuleInstantiation<'a>), - InterfaceInstantiation(InterfaceInstantiation<'a>), - CheckerInstantiation(CheckerInstantiation<'a>), +pub enum BindInstantiation { + ProgramInstantiation(ProgramInstantiation), + ModuleInstantiation(ModuleInstantiation), + InterfaceInstantiation(InterfaceInstantiation), + CheckerInstantiation(CheckerInstantiation), } // ----------------------------------------------------------------------------- diff --git a/src/parser/source_text/module_parameters_and_ports.rs b/src/parser/source_text/module_parameters_and_ports.rs index e7cf275..34e6b47 100644 --- a/src/parser/source_text/module_parameters_and_ports.rs +++ b/src/parser/source_text/module_parameters_and_ports.rs @@ -9,210 +9,210 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum ParameterPortList<'a> { - Assignment(ParameterPortListAssignment<'a>), - Declaration(ParameterPortListDeclaration<'a>), - Empty((Symbol<'a>, Symbol<'a>, Symbol<'a>)), +pub enum ParameterPortList { + Assignment(ParameterPortListAssignment), + Declaration(ParameterPortListDeclaration), + Empty((Symbol, Symbol, Symbol)), } #[derive(Debug, Node)] -pub struct ParameterPortListAssignment<'a> { +pub struct ParameterPortListAssignment { pub nodes: ( - Symbol<'a>, + Symbol, Paren< - 'a, + ( - ListOfParamAssignments<'a>, - Vec<(Symbol<'a>, ParameterPortDeclaration<'a>)>, + ListOfParamAssignments, + Vec<(Symbol, ParameterPortDeclaration)>, ), >, ), } #[derive(Debug, Node)] -pub struct ParameterPortListDeclaration<'a> { +pub struct ParameterPortListDeclaration { pub nodes: ( - Symbol<'a>, - Paren<'a, List, ParameterPortDeclaration<'a>>>, + Symbol, + Paren< List>, ), } #[derive(Debug, Node)] -pub enum ParameterPortDeclaration<'a> { - ParameterDeclaration(ParameterDeclaration<'a>), - LocalParameterDeclaration(LocalParameterDeclaration<'a>), - ParamList(ParameterPortDeclarationParamList<'a>), - TypeList(ParameterPortDeclarationTypeList<'a>), +pub enum ParameterPortDeclaration { + ParameterDeclaration(ParameterDeclaration), + LocalParameterDeclaration(LocalParameterDeclaration), + ParamList(ParameterPortDeclarationParamList), + TypeList(ParameterPortDeclarationTypeList), } #[derive(Debug, Node)] -pub struct ParameterPortDeclarationParamList<'a> { - pub nodes: (DataType<'a>, ListOfParamAssignments<'a>), +pub struct ParameterPortDeclarationParamList { + pub nodes: (DataType, ListOfParamAssignments), } #[derive(Debug, Node)] -pub struct ParameterPortDeclarationTypeList<'a> { - pub nodes: (Keyword<'a>, ListOfTypeAssignments<'a>), +pub struct ParameterPortDeclarationTypeList { + pub nodes: (Keyword, ListOfTypeAssignments), } #[derive(Debug, Node)] -pub struct ListOfPorts<'a> { - pub nodes: (Paren<'a, List, Port<'a>>>,), +pub struct ListOfPorts { + pub nodes: (Paren< List>,), } #[derive(Debug, Node)] -pub struct ListOfPortDeclarations<'a> { +pub struct ListOfPortDeclarations { pub nodes: ( - Paren<'a, Option, (Vec>, AnsiPortDeclaration<'a>)>>>, + Paren< Option, AnsiPortDeclaration)>>>, ), } #[derive(Debug, Node)] -pub enum PortDeclaration<'a> { - Inout(PortDeclarationInout<'a>), - Input(PortDeclarationInput<'a>), - Output(PortDeclarationOutput<'a>), - Ref(PortDeclarationRef<'a>), - Interface(PortDeclarationInterface<'a>), +pub enum PortDeclaration { + Inout(PortDeclarationInout), + Input(PortDeclarationInput), + Output(PortDeclarationOutput), + Ref(PortDeclarationRef), + Interface(PortDeclarationInterface), } #[derive(Debug, Node)] -pub struct PortDeclarationInout<'a> { - pub nodes: (Vec>, InoutDeclaration<'a>), +pub struct PortDeclarationInout { + pub nodes: (Vec, InoutDeclaration), } #[derive(Debug, Node)] -pub struct PortDeclarationInput<'a> { - pub nodes: (Vec>, InputDeclaration<'a>), +pub struct PortDeclarationInput { + pub nodes: (Vec, InputDeclaration), } #[derive(Debug, Node)] -pub struct PortDeclarationOutput<'a> { - pub nodes: (Vec>, OutputDeclaration<'a>), +pub struct PortDeclarationOutput { + pub nodes: (Vec, OutputDeclaration), } #[derive(Debug, Node)] -pub struct PortDeclarationRef<'a> { - pub nodes: (Vec>, RefDeclaration<'a>), +pub struct PortDeclarationRef { + pub nodes: (Vec, RefDeclaration), } #[derive(Debug, Node)] -pub struct PortDeclarationInterface<'a> { - pub nodes: (Vec>, InterfacePortDeclaration<'a>), +pub struct PortDeclarationInterface { + pub nodes: (Vec, InterfacePortDeclaration), } #[derive(Debug, Node)] -pub enum Port<'a> { - NonNamed(PortNonNamed<'a>), - Named(PortNamed<'a>), +pub enum Port { + NonNamed(PortNonNamed), + Named(PortNamed), } #[derive(Debug, Node)] -pub struct PortNonNamed<'a> { - pub nodes: (Option>,), +pub struct PortNonNamed { + pub nodes: (Option,), } #[derive(Debug, Node)] -pub struct PortNamed<'a> { +pub struct PortNamed { pub nodes: ( - Symbol<'a>, - PortIdentifier<'a>, - Paren<'a, Option>>, + Symbol, + PortIdentifier, + Paren< Option>, ), } #[derive(Debug, Node)] -pub enum PortExpression<'a> { - PortReference(PortReference<'a>), - Brace(PortExpressionBrace<'a>), +pub enum PortExpression { + PortReference(PortReference), + Brace(PortExpressionBrace), } #[derive(Debug, Node)] -pub struct PortExpressionBrace<'a> { - pub nodes: (Brace<'a, List, PortReference<'a>>>,), +pub struct PortExpressionBrace { + pub nodes: (Brace< List>,), } #[derive(Debug, Node)] -pub struct PortReference<'a> { - pub nodes: (PortIdentifier<'a>, ConstantSelect<'a>), +pub struct PortReference { + pub nodes: (PortIdentifier, ConstantSelect), } #[derive(Debug, Node)] -pub enum PortDirection<'a> { - Input(Keyword<'a>), - Output(Keyword<'a>), - Inout(Keyword<'a>), - Ref(Keyword<'a>), +pub enum PortDirection { + Input(Keyword), + Output(Keyword), + Inout(Keyword), + Ref(Keyword), } #[derive(Debug, Node)] -pub struct NetPortHeader<'a> { - pub nodes: (Option>, NetPortType<'a>), +pub struct NetPortHeader { + pub nodes: (Option, NetPortType), } #[derive(Debug, Node)] -pub struct VariablePortHeader<'a> { - pub nodes: (Option>, VariablePortType<'a>), +pub struct VariablePortHeader { + pub nodes: (Option, VariablePortType), } #[derive(Debug, Node)] -pub enum InterfacePortHeader<'a> { - Identifier(InterfacePortHeaderIdentifier<'a>), - Interface(InterfacePortHeaderInterface<'a>), +pub enum InterfacePortHeader { + Identifier(InterfacePortHeaderIdentifier), + Interface(InterfacePortHeaderInterface), } #[derive(Debug, Node)] -pub struct InterfacePortHeaderIdentifier<'a> { +pub struct InterfacePortHeaderIdentifier { pub nodes: ( - InterfaceIdentifier<'a>, - Option<(Symbol<'a>, ModportIdentifier<'a>)>, + InterfaceIdentifier, + Option<(Symbol, ModportIdentifier)>, ), } #[derive(Debug, Node)] -pub struct InterfacePortHeaderInterface<'a> { - pub nodes: (Keyword<'a>, Option<(Symbol<'a>, ModportIdentifier<'a>)>), +pub struct InterfacePortHeaderInterface { + pub nodes: (Keyword, Option<(Symbol, ModportIdentifier)>), } #[derive(Debug, Node)] -pub enum NetPortHeaderOrInterfacePortHeader<'a> { - NetPortHeader(NetPortHeader<'a>), - InterfacePortHeader(InterfacePortHeader<'a>), +pub enum NetPortHeaderOrInterfacePortHeader { + NetPortHeader(NetPortHeader), + InterfacePortHeader(InterfacePortHeader), } #[derive(Debug, Node)] -pub enum AnsiPortDeclaration<'a> { - Net(AnsiPortDeclarationNet<'a>), - Variable(AnsiPortDeclarationVariable<'a>), - Paren(AnsiPortDeclarationParen<'a>), +pub enum AnsiPortDeclaration { + Net(AnsiPortDeclarationNet), + Variable(AnsiPortDeclarationVariable), + Paren(AnsiPortDeclarationParen), } #[derive(Debug, Node)] -pub struct AnsiPortDeclarationNet<'a> { +pub struct AnsiPortDeclarationNet { pub nodes: ( - Option>, - PortIdentifier<'a>, - Vec>, - Option<(Symbol<'a>, ConstantExpression<'a>)>, + Option, + PortIdentifier, + Vec, + Option<(Symbol, ConstantExpression)>, ), } #[derive(Debug, Node)] -pub struct AnsiPortDeclarationVariable<'a> { +pub struct AnsiPortDeclarationVariable { pub nodes: ( - Option>, - PortIdentifier<'a>, - Vec>, - Option<(Symbol<'a>, ConstantExpression<'a>)>, + Option, + PortIdentifier, + Vec, + Option<(Symbol, ConstantExpression)>, ), } #[derive(Debug, Node)] -pub struct AnsiPortDeclarationParen<'a> { +pub struct AnsiPortDeclarationParen { pub nodes: ( - Option>, - Symbol<'a>, - PortIdentifier<'a>, - Paren<'a, Option>>, + Option, + Symbol, + PortIdentifier, + Paren< Option>, ), } diff --git a/src/parser/source_text/package_items.rs b/src/parser/source_text/package_items.rs index 7c81fe2..0fd104b 100644 --- a/src/parser/source_text/package_items.rs +++ b/src/parser/source_text/package_items.rs @@ -9,49 +9,49 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum PackageItem<'a> { - PackageOrGenerateItemDeclaration(PackageOrGenerateItemDeclaration<'a>), - AnonymousProgram(AnonymousProgram<'a>), - PackageExportDeclaration(PackageExportDeclaration<'a>), - TimeunitsDeclaration(TimeunitsDeclaration<'a>), +pub enum PackageItem { + PackageOrGenerateItemDeclaration(PackageOrGenerateItemDeclaration), + AnonymousProgram(AnonymousProgram), + PackageExportDeclaration(PackageExportDeclaration), + TimeunitsDeclaration(TimeunitsDeclaration), } #[derive(Debug, Node)] -pub enum PackageOrGenerateItemDeclaration<'a> { - NetDeclaration(NetDeclaration<'a>), - DataDeclaration(DataDeclaration<'a>), - TaskDeclaration(TaskDeclaration<'a>), - FunctionDeclaration(FunctionDeclaration<'a>), - CheckerDeclaration(CheckerDeclaration<'a>), - DpiImportExport(DpiImportExport<'a>), - ExternConstraintDeclaration(ExternConstraintDeclaration<'a>), - ClassDeclaration(ClassDeclaration<'a>), - ClassConstructorDeclaration(ClassConstructorDeclaration<'a>), - LocalParameterDeclaration((LocalParameterDeclaration<'a>, Symbol<'a>)), - ParameterDeclaration((ParameterDeclaration<'a>, Symbol<'a>)), - CovergroupDeclaration(CovergroupDeclaration<'a>), - AssertionItemDeclaration(AssertionItemDeclaration<'a>), - Empty(Symbol<'a>), +pub enum PackageOrGenerateItemDeclaration { + NetDeclaration(NetDeclaration), + DataDeclaration(DataDeclaration), + TaskDeclaration(TaskDeclaration), + FunctionDeclaration(FunctionDeclaration), + CheckerDeclaration(CheckerDeclaration), + DpiImportExport(DpiImportExport), + ExternConstraintDeclaration(ExternConstraintDeclaration), + ClassDeclaration(ClassDeclaration), + ClassConstructorDeclaration(ClassConstructorDeclaration), + LocalParameterDeclaration((LocalParameterDeclaration, Symbol)), + ParameterDeclaration((ParameterDeclaration, Symbol)), + CovergroupDeclaration(CovergroupDeclaration), + AssertionItemDeclaration(AssertionItemDeclaration), + Empty(Symbol), } #[derive(Debug, Node)] -pub struct AnonymousProgram<'a> { +pub struct AnonymousProgram { pub nodes: ( - Keyword<'a>, - Symbol<'a>, - Vec>, - Keyword<'a>, + Keyword, + Symbol, + Vec, + Keyword, ), } #[derive(Debug, Node)] -pub enum AnonymousProgramItem<'a> { - TaskDeclaration(TaskDeclaration<'a>), - FunctionDeclaration(FunctionDeclaration<'a>), - ClassDeclaration(ClassDeclaration<'a>), - CovergroupDeclaration(CovergroupDeclaration<'a>), - ClassConstructorDeclaration(ClassConstructorDeclaration<'a>), - Empty(Symbol<'a>), +pub enum AnonymousProgramItem { + TaskDeclaration(TaskDeclaration), + FunctionDeclaration(FunctionDeclaration), + ClassDeclaration(ClassDeclaration), + CovergroupDeclaration(CovergroupDeclaration), + ClassConstructorDeclaration(ClassConstructorDeclaration), + Empty(Symbol), } // ----------------------------------------------------------------------------- diff --git a/src/parser/source_text/program_items.rs b/src/parser/source_text/program_items.rs index 0396bcf..8d3d9aa 100644 --- a/src/parser/source_text/program_items.rs +++ b/src/parser/source_text/program_items.rs @@ -9,56 +9,56 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum ProgramItem<'a> { - PortDeclaration((PortDeclaration<'a>, Symbol<'a>)), - NonPortProgramItem(NonPortProgramItem<'a>), +pub enum ProgramItem { + PortDeclaration((PortDeclaration, Symbol)), + NonPortProgramItem(NonPortProgramItem), } #[derive(Debug, Node)] -pub enum NonPortProgramItem<'a> { - Assign(NonPortProgramItemAssign<'a>), - Module(NonPortProgramItemModule<'a>), - Initial(NonPortProgramItemInitial<'a>), - Final(NonPortProgramItemFinal<'a>), - Assertion(NonPortProgramItemAssertion<'a>), - TimeunitsDeclaration(TimeunitsDeclaration<'a>), - ProgramGenerateItem(ProgramGenerateItem<'a>), +pub enum NonPortProgramItem { + Assign(NonPortProgramItemAssign), + Module(NonPortProgramItemModule), + Initial(NonPortProgramItemInitial), + Final(NonPortProgramItemFinal), + Assertion(NonPortProgramItemAssertion), + TimeunitsDeclaration(TimeunitsDeclaration), + ProgramGenerateItem(ProgramGenerateItem), } #[derive(Debug, Node)] -pub struct NonPortProgramItemAssign<'a> { - pub nodes: (Vec>, ContinuousAssign<'a>), +pub struct NonPortProgramItemAssign { + pub nodes: (Vec, ContinuousAssign), } #[derive(Debug, Node)] -pub struct NonPortProgramItemModule<'a> { +pub struct NonPortProgramItemModule { pub nodes: ( - Vec>, - ModuleOrGenerateItemDeclaration<'a>, + Vec, + ModuleOrGenerateItemDeclaration, ), } #[derive(Debug, Node)] -pub struct NonPortProgramItemInitial<'a> { - pub nodes: (Vec>, InitialConstruct<'a>), +pub struct NonPortProgramItemInitial { + pub nodes: (Vec, InitialConstruct), } #[derive(Debug, Node)] -pub struct NonPortProgramItemFinal<'a> { - pub nodes: (Vec>, FinalConstruct<'a>), +pub struct NonPortProgramItemFinal { + pub nodes: (Vec, FinalConstruct), } #[derive(Debug, Node)] -pub struct NonPortProgramItemAssertion<'a> { - pub nodes: (Vec>, ConcurrentAssertionItem<'a>), +pub struct NonPortProgramItemAssertion { + pub nodes: (Vec, ConcurrentAssertionItem), } #[derive(Debug, Node)] -pub enum ProgramGenerateItem<'a> { - LoopGenerateConstruct(LoopGenerateConstruct<'a>), - ConditionalGenerateConstruct(ConditionalGenerateConstruct<'a>), - GenerateRegion(GenerateRegion<'a>), - ElaborationSystemTask(ElaborationSystemTask<'a>), +pub enum ProgramGenerateItem { + LoopGenerateConstruct(LoopGenerateConstruct), + ConditionalGenerateConstruct(ConditionalGenerateConstruct), + GenerateRegion(GenerateRegion), + ElaborationSystemTask(ElaborationSystemTask), } // ----------------------------------------------------------------------------- diff --git a/src/parser/source_text/system_verilog_source_text.rs b/src/parser/source_text/system_verilog_source_text.rs index a91f51a..2eea592 100644 --- a/src/parser/source_text/system_verilog_source_text.rs +++ b/src/parser/source_text/system_verilog_source_text.rs @@ -9,429 +9,429 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct SourceText<'a> { - pub nodes: (Option>, Vec>), +pub struct SourceText { + pub nodes: (Option, Vec), } #[derive(Debug, Node)] -pub enum Description<'a> { - ModuleDeclaration(ModuleDeclaration<'a>), - UdpDeclaration(UdpDeclaration<'a>), - InterfaceDeclaration(InterfaceDeclaration<'a>), - ProgramDeclaration(ProgramDeclaration<'a>), - PackageDeclaration(PackageDeclaration<'a>), - PackageItem(DescriptionPackageItem<'a>), - BindDirective(DescriptionBindDirective<'a>), - ConfigDeclaration(ConfigDeclaration<'a>), +pub enum Description { + ModuleDeclaration(ModuleDeclaration), + UdpDeclaration(UdpDeclaration), + InterfaceDeclaration(InterfaceDeclaration), + ProgramDeclaration(ProgramDeclaration), + PackageDeclaration(PackageDeclaration), + PackageItem(DescriptionPackageItem), + BindDirective(DescriptionBindDirective), + ConfigDeclaration(ConfigDeclaration), } #[derive(Debug, Node)] -pub struct DescriptionPackageItem<'a> { - pub nodes: (Vec>, PackageItem<'a>), +pub struct DescriptionPackageItem { + pub nodes: (Vec, PackageItem), } #[derive(Debug, Node)] -pub struct DescriptionBindDirective<'a> { - pub nodes: (Vec>, BindDirective<'a>), +pub struct DescriptionBindDirective { + pub nodes: (Vec, BindDirective), } #[derive(Debug, Node)] -pub struct ModuleNonansiHeader<'a> { +pub struct ModuleNonansiHeader { pub nodes: ( - Vec>, - ModuleKeyword<'a>, - Option>, - ModuleIdentifier<'a>, - Vec>, - Option>, - ListOfPorts<'a>, - Symbol<'a>, + Vec, + ModuleKeyword, + Option, + ModuleIdentifier, + Vec, + Option, + ListOfPorts, + Symbol, ), } #[derive(Debug, Node)] -pub struct ModuleAnsiHeader<'a> { +pub struct ModuleAnsiHeader { pub nodes: ( - Vec>, - ModuleKeyword<'a>, - Option>, - ModuleIdentifier<'a>, - Vec>, - Option>, - Option>, - Symbol<'a>, + Vec, + ModuleKeyword, + Option, + ModuleIdentifier, + Vec, + Option, + Option, + Symbol, ), } #[derive(Debug, Node)] -pub enum ModuleDeclaration<'a> { - Nonansi(ModuleDeclarationNonansi<'a>), - Ansi(ModuleDeclarationAnsi<'a>), - Wildcard(ModuleDeclarationWildcard<'a>), - ExternNonansi(ModuleDeclarationExternNonansi<'a>), - ExternAnsi(ModuleDeclarationExternAnsi<'a>), +pub enum ModuleDeclaration { + Nonansi(ModuleDeclarationNonansi), + Ansi(ModuleDeclarationAnsi), + Wildcard(ModuleDeclarationWildcard), + ExternNonansi(ModuleDeclarationExternNonansi), + ExternAnsi(ModuleDeclarationExternAnsi), } #[derive(Debug, Node)] -pub struct ModuleDeclarationNonansi<'a> { +pub struct ModuleDeclarationNonansi { pub nodes: ( - ModuleNonansiHeader<'a>, - Option>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, ModuleIdentifier<'a>)>, + ModuleNonansiHeader, + Option, + Vec, + Keyword, + Option<(Symbol, ModuleIdentifier)>, ), } #[derive(Debug, Node)] -pub struct ModuleDeclarationAnsi<'a> { +pub struct ModuleDeclarationAnsi { pub nodes: ( - ModuleAnsiHeader<'a>, - Option>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, ModuleIdentifier<'a>)>, + ModuleAnsiHeader, + Option, + Vec, + Keyword, + Option<(Symbol, ModuleIdentifier)>, ), } #[derive(Debug, Node)] -pub struct ModuleDeclarationWildcard<'a> { +pub struct ModuleDeclarationWildcard { pub nodes: ( - Vec>, - ModuleKeyword<'a>, - Option>, - ModuleIdentifier<'a>, - Paren<'a, Symbol<'a>>, - Symbol<'a>, - Option>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, ModuleIdentifier<'a>)>, + Vec, + ModuleKeyword, + Option, + ModuleIdentifier, + Paren< Symbol>, + Symbol, + Option, + Vec, + Keyword, + Option<(Symbol, ModuleIdentifier)>, ), } #[derive(Debug, Node)] -pub struct ModuleDeclarationExternNonansi<'a> { - pub nodes: (Keyword<'a>, ModuleNonansiHeader<'a>), +pub struct ModuleDeclarationExternNonansi { + pub nodes: (Keyword, ModuleNonansiHeader), } #[derive(Debug, Node)] -pub struct ModuleDeclarationExternAnsi<'a> { - pub nodes: (Keyword<'a>, ModuleAnsiHeader<'a>), +pub struct ModuleDeclarationExternAnsi { + pub nodes: (Keyword, ModuleAnsiHeader), } #[derive(Debug, Node)] -pub enum ModuleKeyword<'a> { - Module(Keyword<'a>), - Macromodule(Keyword<'a>), +pub enum ModuleKeyword { + Module(Keyword), + Macromodule(Keyword), } #[derive(Debug, Node)] -pub enum InterfaceDeclaration<'a> { - Nonansi(InterfaceDeclarationNonansi<'a>), - Ansi(InterfaceDeclarationAnsi<'a>), - Wildcard(InterfaceDeclarationWildcard<'a>), - ExternNonansi(InterfaceDeclarationExternNonansi<'a>), - ExternAnsi(InterfaceDeclarationExternAnsi<'a>), +pub enum InterfaceDeclaration { + Nonansi(InterfaceDeclarationNonansi), + Ansi(InterfaceDeclarationAnsi), + Wildcard(InterfaceDeclarationWildcard), + ExternNonansi(InterfaceDeclarationExternNonansi), + ExternAnsi(InterfaceDeclarationExternAnsi), } #[derive(Debug, Node)] -pub struct InterfaceDeclarationNonansi<'a> { +pub struct InterfaceDeclarationNonansi { pub nodes: ( - InterfaceNonansiHeader<'a>, - Option>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, InterfaceIdentifier<'a>)>, + InterfaceNonansiHeader, + Option, + Vec, + Keyword, + Option<(Symbol, InterfaceIdentifier)>, ), } #[derive(Debug, Node)] -pub struct InterfaceDeclarationAnsi<'a> { +pub struct InterfaceDeclarationAnsi { pub nodes: ( - InterfaceAnsiHeader<'a>, - Option>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, InterfaceIdentifier<'a>)>, + InterfaceAnsiHeader, + Option, + Vec, + Keyword, + Option<(Symbol, InterfaceIdentifier)>, ), } #[derive(Debug, Node)] -pub struct InterfaceDeclarationWildcard<'a> { +pub struct InterfaceDeclarationWildcard { pub nodes: ( - Vec>, - Keyword<'a>, - Option>, - InterfaceIdentifier<'a>, - Paren<'a, Symbol<'a>>, - Symbol<'a>, - Option>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, InterfaceIdentifier<'a>)>, + Vec, + Keyword, + Option, + InterfaceIdentifier, + Paren< Symbol>, + Symbol, + Option, + Vec, + Keyword, + Option<(Symbol, InterfaceIdentifier)>, ), } #[derive(Debug, Node)] -pub struct InterfaceDeclarationExternNonansi<'a> { - pub nodes: (Keyword<'a>, InterfaceNonansiHeader<'a>), +pub struct InterfaceDeclarationExternNonansi { + pub nodes: (Keyword, InterfaceNonansiHeader), } #[derive(Debug, Node)] -pub struct InterfaceDeclarationExternAnsi<'a> { - pub nodes: (Keyword<'a>, InterfaceAnsiHeader<'a>), +pub struct InterfaceDeclarationExternAnsi { + pub nodes: (Keyword, InterfaceAnsiHeader), } #[derive(Debug, Node)] -pub struct InterfaceNonansiHeader<'a> { +pub struct InterfaceNonansiHeader { pub nodes: ( - Vec>, - Keyword<'a>, - Option>, - InterfaceIdentifier<'a>, - Vec>, - Option>, - ListOfPorts<'a>, - Symbol<'a>, + Vec, + Keyword, + Option, + InterfaceIdentifier, + Vec, + Option, + ListOfPorts, + Symbol, ), } #[derive(Debug, Node)] -pub struct InterfaceAnsiHeader<'a> { +pub struct InterfaceAnsiHeader { pub nodes: ( - Vec>, - Keyword<'a>, - Option>, - InterfaceIdentifier<'a>, - Vec>, - Option>, - Option>, - Symbol<'a>, + Vec, + Keyword, + Option, + InterfaceIdentifier, + Vec, + Option, + Option, + Symbol, ), } #[derive(Debug, Node)] -pub enum ProgramDeclaration<'a> { - Nonansi(ProgramDeclarationNonansi<'a>), - Ansi(ProgramDeclarationAnsi<'a>), - Wildcard(ProgramDeclarationWildcard<'a>), - ExternNonansi(ProgramDeclarationExternNonansi<'a>), - ExternAnsi(ProgramDeclarationExternAnsi<'a>), +pub enum ProgramDeclaration { + Nonansi(ProgramDeclarationNonansi), + Ansi(ProgramDeclarationAnsi), + Wildcard(ProgramDeclarationWildcard), + ExternNonansi(ProgramDeclarationExternNonansi), + ExternAnsi(ProgramDeclarationExternAnsi), } #[derive(Debug, Node)] -pub struct ProgramDeclarationNonansi<'a> { +pub struct ProgramDeclarationNonansi { pub nodes: ( - ProgramNonansiHeader<'a>, - Option>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, ProgramIdentifier<'a>)>, + ProgramNonansiHeader, + Option, + Vec, + Keyword, + Option<(Symbol, ProgramIdentifier)>, ), } #[derive(Debug, Node)] -pub struct ProgramDeclarationAnsi<'a> { +pub struct ProgramDeclarationAnsi { pub nodes: ( - ProgramAnsiHeader<'a>, - Option>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, ProgramIdentifier<'a>)>, + ProgramAnsiHeader, + Option, + Vec, + Keyword, + Option<(Symbol, ProgramIdentifier)>, ), } #[derive(Debug, Node)] -pub struct ProgramDeclarationWildcard<'a> { +pub struct ProgramDeclarationWildcard { pub nodes: ( - Vec>, - Keyword<'a>, - ProgramIdentifier<'a>, - Paren<'a, Symbol<'a>>, - Symbol<'a>, - Option>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, ProgramIdentifier<'a>)>, + Vec, + Keyword, + ProgramIdentifier, + Paren< Symbol>, + Symbol, + Option, + Vec, + Keyword, + Option<(Symbol, ProgramIdentifier)>, ), } #[derive(Debug, Node)] -pub struct ProgramDeclarationExternNonansi<'a> { - pub nodes: (Keyword<'a>, ProgramNonansiHeader<'a>), +pub struct ProgramDeclarationExternNonansi { + pub nodes: (Keyword, ProgramNonansiHeader), } #[derive(Debug, Node)] -pub struct ProgramDeclarationExternAnsi<'a> { - pub nodes: (Keyword<'a>, ProgramAnsiHeader<'a>), +pub struct ProgramDeclarationExternAnsi { + pub nodes: (Keyword, ProgramAnsiHeader), } #[derive(Debug, Node)] -pub struct ProgramNonansiHeader<'a> { +pub struct ProgramNonansiHeader { pub nodes: ( - Vec>, - Keyword<'a>, - Option>, - ProgramIdentifier<'a>, - Vec>, - Option>, - ListOfPorts<'a>, - Symbol<'a>, + Vec, + Keyword, + Option, + ProgramIdentifier, + Vec, + Option, + ListOfPorts, + Symbol, ), } #[derive(Debug, Node)] -pub struct ProgramAnsiHeader<'a> { +pub struct ProgramAnsiHeader { pub nodes: ( - Vec>, - Keyword<'a>, - Option>, - ProgramIdentifier<'a>, - Vec>, - Option>, - Option>, - Symbol<'a>, + Vec, + Keyword, + Option, + ProgramIdentifier, + Vec, + Option, + Option, + Symbol, ), } #[derive(Debug, Node)] -pub struct CheckerDeclaration<'a> { +pub struct CheckerDeclaration { pub nodes: ( - Keyword<'a>, - CheckerIdentifier<'a>, - Option>>>, - Symbol<'a>, - Vec<(Vec>, CheckerOrGenerateItem<'a>)>, - Keyword<'a>, - Option<(Symbol<'a>, CheckerIdentifier<'a>)>, + Keyword, + CheckerIdentifier, + Option>>, + Symbol, + Vec<(Vec, CheckerOrGenerateItem)>, + Keyword, + Option<(Symbol, CheckerIdentifier)>, ), } #[derive(Debug, Node)] -pub struct ClassDeclaration<'a> { +pub struct ClassDeclaration { pub nodes: ( - Option>, - Keyword<'a>, - Option>, - ClassIdentifier<'a>, - Option>, + Option, + Keyword, + Option, + ClassIdentifier, + Option, Option<( - Keyword<'a>, - ClassType<'a>, - Option>>, + Keyword, + ClassType, + Option>, )>, - Option<(Keyword<'a>, List, InterfaceClassType<'a>>)>, - Symbol<'a>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, ClassIdentifier<'a>)>, + Option<(Keyword, List)>, + Symbol, + Vec, + Keyword, + Option<(Symbol, ClassIdentifier)>, ), } #[derive(Debug, Node)] -pub struct Virtual<'a> { - pub nodes: (Keyword<'a>,), +pub struct Virtual { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct InterfaceClassType<'a> { - pub nodes: (PsClassIdentifier<'a>, Option>), +pub struct InterfaceClassType { + pub nodes: (PsClassIdentifier, Option), } #[derive(Debug, Node)] -pub struct InterfaceClassDeclaration<'a> { +pub struct InterfaceClassDeclaration { pub nodes: ( - Keyword<'a>, - Keyword<'a>, - ClassIdentifier<'a>, - Option>, - Option<(Keyword<'a>, List, InterfaceClassType<'a>>)>, - Symbol<'a>, - Vec>, - Keyword<'a>, - Option<(Symbol<'a>, ClassIdentifier<'a>)>, + Keyword, + Keyword, + ClassIdentifier, + Option, + Option<(Keyword, List)>, + Symbol, + Vec, + Keyword, + Option<(Symbol, ClassIdentifier)>, ), } #[derive(Debug, Node)] -pub enum InterfaceClassItem<'a> { - TypeDeclaration(TypeDeclaration<'a>), - Method(InterfaceClassItemMethod<'a>), - LocalParameterDeclaration((LocalParameterDeclaration<'a>, Symbol<'a>)), - ParameterDeclaration((ParameterDeclaration<'a>, Symbol<'a>)), - Null(Symbol<'a>), +pub enum InterfaceClassItem { + TypeDeclaration(TypeDeclaration), + Method(InterfaceClassItemMethod), + LocalParameterDeclaration((LocalParameterDeclaration, Symbol)), + ParameterDeclaration((ParameterDeclaration, Symbol)), + Null(Symbol), } #[derive(Debug, Node)] -pub struct InterfaceClassItemMethod<'a> { - pub nodes: (Vec>, InterfaceClassMethod<'a>), +pub struct InterfaceClassItemMethod { + pub nodes: (Vec, InterfaceClassMethod), } #[derive(Debug, Node)] -pub struct InterfaceClassMethod<'a> { - pub nodes: (Keyword<'a>, Keyword<'a>, MethodPrototype<'a>, Symbol<'a>), +pub struct InterfaceClassMethod { + pub nodes: (Keyword, Keyword, MethodPrototype, Symbol), } #[derive(Debug, Node)] -pub struct PackageDeclaration<'a> { +pub struct PackageDeclaration { pub nodes: ( - Vec>, - Keyword<'a>, - Option>, - PackageIdentifier<'a>, - Symbol<'a>, - Option>, - Vec<(Vec>, PackageItem<'a>)>, - Keyword<'a>, - Option<(Symbol<'a>, PackageIdentifier<'a>)>, + Vec, + Keyword, + Option, + PackageIdentifier, + Symbol, + Option, + Vec<(Vec, PackageItem)>, + Keyword, + Option<(Symbol, PackageIdentifier)>, ), } #[derive(Debug, Node)] -pub enum TimeunitsDeclaration<'a> { - Timeunit(TimeunitsDeclarationTimeunit<'a>), - Timeprecision(TimeunitsDeclarationTimeprecision<'a>), - TimeunitTimeprecision(TimeunitsDeclarationTimeunitTimeprecision<'a>), - TimeprecisionTimeunit(TimeunitsDeclarationTimeprecisionTimeunit<'a>), +pub enum TimeunitsDeclaration { + Timeunit(TimeunitsDeclarationTimeunit), + Timeprecision(TimeunitsDeclarationTimeprecision), + TimeunitTimeprecision(TimeunitsDeclarationTimeunitTimeprecision), + TimeprecisionTimeunit(TimeunitsDeclarationTimeprecisionTimeunit), } #[derive(Debug, Node)] -pub struct TimeunitsDeclarationTimeunit<'a> { +pub struct TimeunitsDeclarationTimeunit { pub nodes: ( - Keyword<'a>, - TimeLiteral<'a>, - Option<(Symbol<'a>, TimeLiteral<'a>)>, - Symbol<'a>, + Keyword, + TimeLiteral, + Option<(Symbol, TimeLiteral)>, + Symbol, ), } #[derive(Debug, Node)] -pub struct TimeunitsDeclarationTimeprecision<'a> { - pub nodes: (Keyword<'a>, TimeLiteral<'a>, Symbol<'a>), +pub struct TimeunitsDeclarationTimeprecision { + pub nodes: (Keyword, TimeLiteral, Symbol), } #[derive(Debug, Node)] -pub struct TimeunitsDeclarationTimeunitTimeprecision<'a> { +pub struct TimeunitsDeclarationTimeunitTimeprecision { pub nodes: ( - Keyword<'a>, - TimeLiteral<'a>, - Symbol<'a>, - Keyword<'a>, - TimeLiteral<'a>, - Symbol<'a>, + Keyword, + TimeLiteral, + Symbol, + Keyword, + TimeLiteral, + Symbol, ), } #[derive(Debug, Node)] -pub struct TimeunitsDeclarationTimeprecisionTimeunit<'a> { +pub struct TimeunitsDeclarationTimeprecisionTimeunit { pub nodes: ( - Keyword<'a>, - TimeLiteral<'a>, - Symbol<'a>, - Keyword<'a>, - TimeLiteral<'a>, - Symbol<'a>, + Keyword, + TimeLiteral, + Symbol, + Keyword, + TimeLiteral, + Symbol, ), } diff --git a/src/parser/specify_section/specify_block_declaration.rs b/src/parser/specify_section/specify_block_declaration.rs index 7c2cab1..36f0601 100644 --- a/src/parser/specify_section/specify_block_declaration.rs +++ b/src/parser/specify_section/specify_block_declaration.rs @@ -8,27 +8,27 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct SpecifyBlock<'a> { - pub nodes: (Keyword<'a>, Vec>, Keyword<'a>), +pub struct SpecifyBlock { + pub nodes: (Keyword, Vec, Keyword), } #[derive(Debug, Node)] -pub enum SpecifyItem<'a> { - SpecparamDeclaration(SpecparamDeclaration<'a>), - PulsestyleDeclaration(PulsestyleDeclaration<'a>), - ShowcancelledDeclaration(ShowcancelledDeclaration<'a>), - PathDeclaration(PathDeclaration<'a>), - SystemTimingCheck(SystemTimingCheck<'a>), +pub enum SpecifyItem { + SpecparamDeclaration(SpecparamDeclaration), + PulsestyleDeclaration(PulsestyleDeclaration), + ShowcancelledDeclaration(ShowcancelledDeclaration), + PathDeclaration(PathDeclaration), + SystemTimingCheck(SystemTimingCheck), } #[derive(Debug, Node)] -pub struct PulsestyleDeclaration<'a> { - pub nodes: (Keyword<'a>, ListOfPathOutputs<'a>, Symbol<'a>), +pub struct PulsestyleDeclaration { + pub nodes: (Keyword, ListOfPathOutputs, Symbol), } #[derive(Debug, Node)] -pub struct ShowcancelledDeclaration<'a> { - pub nodes: (Keyword<'a>, ListOfPathOutputs<'a>, Symbol<'a>), +pub struct ShowcancelledDeclaration { + pub nodes: (Keyword, ListOfPathOutputs, Symbol), } // ----------------------------------------------------------------------------- diff --git a/src/parser/specify_section/specify_block_terminals.rs b/src/parser/specify_section/specify_block_terminals.rs index 9708b81..da66ce3 100644 --- a/src/parser/specify_section/specify_block_terminals.rs +++ b/src/parser/specify_section/specify_block_terminals.rs @@ -7,43 +7,37 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct SpecifyInputTerminalDescriptor<'a> { - pub nodes: ( - InputIdentifier<'a>, - Option>>, - ), +pub struct SpecifyInputTerminalDescriptor { + pub nodes: (InputIdentifier, Option>), } #[derive(Debug, Node)] -pub struct SpecifyOutputTerminalDescriptor<'a> { - pub nodes: ( - OutputIdentifier<'a>, - Option>>, - ), +pub struct SpecifyOutputTerminalDescriptor { + pub nodes: (OutputIdentifier, Option>), } #[derive(Debug, Node)] -pub enum InputIdentifier<'a> { - InputPortIdentifier(InputPortIdentifier<'a>), - InoutPortIdentifier(InoutPortIdentifier<'a>), - Interface(InputIdentifierInterface<'a>), +pub enum InputIdentifier { + InputPortIdentifier(InputPortIdentifier), + InoutPortIdentifier(InoutPortIdentifier), + Interface(InputIdentifierInterface), } #[derive(Debug, Node)] -pub struct InputIdentifierInterface<'a> { - pub nodes: (InterfaceIdentifier<'a>, Symbol<'a>, PortIdentifier<'a>), +pub struct InputIdentifierInterface { + pub nodes: (InterfaceIdentifier, Symbol, PortIdentifier), } #[derive(Debug, Node)] -pub enum OutputIdentifier<'a> { - OutputPortIdentifier(OutputPortIdentifier<'a>), - InoutPortIdentifier(InoutPortIdentifier<'a>), - Interface(OutputIdentifierInterface<'a>), +pub enum OutputIdentifier { + OutputPortIdentifier(OutputPortIdentifier), + InoutPortIdentifier(InoutPortIdentifier), + Interface(OutputIdentifierInterface), } #[derive(Debug, Node)] -pub struct OutputIdentifierInterface<'a> { - pub nodes: (InterfaceIdentifier<'a>, Symbol<'a>, PortIdentifier<'a>), +pub struct OutputIdentifierInterface { + pub nodes: (InterfaceIdentifier, Symbol, PortIdentifier), } // ----------------------------------------------------------------------------- diff --git a/src/parser/specify_section/specify_path_declarations.rs b/src/parser/specify_section/specify_path_declarations.rs index 50a8024..b3043d2 100644 --- a/src/parser/specify_section/specify_path_declarations.rs +++ b/src/parser/specify_section/specify_path_declarations.rs @@ -8,66 +8,60 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum PathDeclaration<'a> { - SimplePathDeclaration((SimplePathDeclaration<'a>, Symbol<'a>)), - EdgeSensitivePathDeclaration((EdgeSensitivePathDeclaration<'a>, Symbol<'a>)), - StateDependentPathDeclaration((StateDependentPathDeclaration<'a>, Symbol<'a>)), +pub enum PathDeclaration { + SimplePathDeclaration((SimplePathDeclaration, Symbol)), + EdgeSensitivePathDeclaration((EdgeSensitivePathDeclaration, Symbol)), + StateDependentPathDeclaration((StateDependentPathDeclaration, Symbol)), } #[derive(Debug, Node)] -pub enum SimplePathDeclaration<'a> { - Parallel(SimplePathDeclarationParallel<'a>), - Full(SimplePathDeclarationFull<'a>), +pub enum SimplePathDeclaration { + Parallel(SimplePathDeclarationParallel), + Full(SimplePathDeclarationFull), } #[derive(Debug, Node)] -pub struct SimplePathDeclarationParallel<'a> { - pub nodes: (ParallelPathDescription<'a>, Symbol<'a>, PathDelayValue<'a>), +pub struct SimplePathDeclarationParallel { + pub nodes: (ParallelPathDescription, Symbol, PathDelayValue), } #[derive(Debug, Node)] -pub struct SimplePathDeclarationFull<'a> { - pub nodes: (FullPathDescription<'a>, Symbol<'a>, PathDelayValue<'a>), +pub struct SimplePathDeclarationFull { + pub nodes: (FullPathDescription, Symbol, PathDelayValue), } #[derive(Debug, Node)] -pub struct ParallelPathDescription<'a> { +pub struct ParallelPathDescription { pub nodes: ( - Paren< - 'a, - ( - SpecifyInputTerminalDescriptor<'a>, - Option>, - Symbol<'a>, - SpecifyOutputTerminalDescriptor<'a>, - ), - >, + Paren<( + SpecifyInputTerminalDescriptor, + Option, + Symbol, + SpecifyOutputTerminalDescriptor, + )>, ), } #[derive(Debug, Node)] -pub struct FullPathDescription<'a> { +pub struct FullPathDescription { pub nodes: ( - Paren< - 'a, - ( - ListOfPathInputs<'a>, - Option>, - Symbol<'a>, - ListOfPathOutputs<'a>, - ), - >, + Paren<( + ListOfPathInputs, + Option, + Symbol, + ListOfPathOutputs, + )>, ), } #[derive(Debug, Node)] -pub struct ListOfPathInputs<'a> { - pub nodes: (List, SpecifyInputTerminalDescriptor<'a>>,), +pub struct ListOfPathInputs { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct ListOfPathOutputs<'a> { - pub nodes: (List, SpecifyOutputTerminalDescriptor<'a>>,), +pub struct ListOfPathOutputs { + pub nodes: (List,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/specify_section/specify_path_delays.rs b/src/parser/specify_section/specify_path_delays.rs index 53cd322..0f59f14 100644 --- a/src/parser/specify_section/specify_path_delays.rs +++ b/src/parser/specify_section/specify_path_delays.rs @@ -8,147 +8,123 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum PathDelayValue<'a> { - ListOfPathDelayExpressions(ListOfPathDelayExpressions<'a>), - Paren(PathDelayValueParen<'a>), +pub enum PathDelayValue { + ListOfPathDelayExpressions(ListOfPathDelayExpressions), + Paren(PathDelayValueParen), } #[derive(Debug, Node)] -pub struct PathDelayValueParen<'a> { - pub nodes: (Paren<'a, ListOfPathDelayExpressions<'a>>,), +pub struct PathDelayValueParen { + pub nodes: (Paren,), } #[derive(Debug, Node)] -pub struct ListOfPathDelayExpressions<'a> { - pub nodes: (List, TPathDelayExpression<'a>>,), +pub struct ListOfPathDelayExpressions { + pub nodes: (List,), } #[derive(Debug, Node)] -pub struct TPathDelayExpression<'a> { - pub nodes: (PathDelayExpression<'a>,), +pub struct TPathDelayExpression { + pub nodes: (PathDelayExpression,), } #[derive(Debug, Node)] -pub struct PathDelayExpression<'a> { - pub nodes: (ConstantMintypmaxExpression<'a>,), +pub struct PathDelayExpression { + pub nodes: (ConstantMintypmaxExpression,), } #[derive(Debug, Node)] -pub enum EdgeSensitivePathDeclaration<'a> { - Parallel(EdgeSensitivePathDeclarationParallel<'a>), - Full(EdgeSensitivePathDeclarationFull<'a>), +pub enum EdgeSensitivePathDeclaration { + Parallel(EdgeSensitivePathDeclarationParallel), + Full(EdgeSensitivePathDeclarationFull), } #[derive(Debug, Node)] -pub struct EdgeSensitivePathDeclarationParallel<'a> { +pub struct EdgeSensitivePathDeclarationParallel { + pub nodes: (ParallelEdgeSensitivePathDescription, Symbol, PathDelayValue), +} + +#[derive(Debug, Node)] +pub struct EdgeSensitivePathDeclarationFull { + pub nodes: (FullEdgeSensitivePathDescription, Symbol, PathDelayValue), +} + +#[derive(Debug, Node)] +pub struct ParallelEdgeSensitivePathDescription { pub nodes: ( - ParallelEdgeSensitivePathDescription<'a>, - Symbol<'a>, - PathDelayValue<'a>, + Paren<( + Option, + SpecifyInputTerminalDescriptor, + Option, + Symbol, + Paren<( + SpecifyOutputTerminalDescriptor, + Option, + Symbol, + DataSourceExpression, + )>, + )>, ), } #[derive(Debug, Node)] -pub struct EdgeSensitivePathDeclarationFull<'a> { +pub struct FullEdgeSensitivePathDescription { pub nodes: ( - FullEdgeSensitivePathDescription<'a>, - Symbol<'a>, - PathDelayValue<'a>, + Paren<( + Option, + ListOfPathInputs, + Option, + Symbol, + Paren<( + ListOfPathOutputs, + Option, + Symbol, + DataSourceExpression, + )>, + )>, ), } #[derive(Debug, Node)] -pub struct ParallelEdgeSensitivePathDescription<'a> { +pub struct DataSourceExpression { + pub nodes: (Expression,), +} + +#[derive(Debug, Node)] +pub enum EdgeIdentifier { + Posedge(Keyword), + Negedge(Keyword), + Edge(Keyword), +} + +#[derive(Debug, Node)] +pub enum StateDependentPathDeclaration { + IfSimple(StateDependentPathDeclarationIfSimple), + IfEdgeSensitive(StateDependentPathDeclarationIfEdgeSensitive), + IfNone(StateDependentPathDeclarationIfNone), +} + +#[derive(Debug, Node)] +pub struct StateDependentPathDeclarationIfSimple { + pub nodes: (Keyword, Paren, SimplePathDeclaration), +} + +#[derive(Debug, Node)] +pub struct StateDependentPathDeclarationIfEdgeSensitive { pub nodes: ( - Paren< - 'a, - ( - Option>, - SpecifyInputTerminalDescriptor<'a>, - Option>, - Symbol<'a>, - Paren< - 'a, - ( - SpecifyOutputTerminalDescriptor<'a>, - Option>, - Symbol<'a>, - DataSourceExpression<'a>, - ), - >, - ), - >, + Keyword, + Paren, + EdgeSensitivePathDeclaration, ), } #[derive(Debug, Node)] -pub struct FullEdgeSensitivePathDescription<'a> { - pub nodes: ( - Paren< - 'a, - ( - Option>, - ListOfPathInputs<'a>, - Option>, - Symbol<'a>, - Paren< - 'a, - ( - ListOfPathOutputs<'a>, - Option>, - Symbol<'a>, - DataSourceExpression<'a>, - ), - >, - ), - >, - ), +pub struct StateDependentPathDeclarationIfNone { + pub nodes: (Keyword, SimplePathDeclaration), } #[derive(Debug, Node)] -pub struct DataSourceExpression<'a> { - pub nodes: (Expression<'a>,), -} - -#[derive(Debug, Node)] -pub enum EdgeIdentifier<'a> { - Posedge(Keyword<'a>), - Negedge(Keyword<'a>), - Edge(Keyword<'a>), -} - -#[derive(Debug, Node)] -pub enum StateDependentPathDeclaration<'a> { - IfSimple(StateDependentPathDeclarationIfSimple<'a>), - IfEdgeSensitive(StateDependentPathDeclarationIfEdgeSensitive<'a>), - IfNone(StateDependentPathDeclarationIfNone<'a>), -} - -#[derive(Debug, Node)] -pub struct StateDependentPathDeclarationIfSimple<'a> { - pub nodes: ( - Keyword<'a>, - Paren<'a, ModulePathExpression<'a>>, - SimplePathDeclaration<'a>, - ), -} - -#[derive(Debug, Node)] -pub struct StateDependentPathDeclarationIfEdgeSensitive<'a> { - pub nodes: ( - Keyword<'a>, - Paren<'a, ModulePathExpression<'a>>, - EdgeSensitivePathDeclaration<'a>, - ), -} - -#[derive(Debug, Node)] -pub struct StateDependentPathDeclarationIfNone<'a> { - pub nodes: (Keyword<'a>, SimplePathDeclaration<'a>), -} - -#[derive(Debug, Node)] -pub struct PolarityOperator<'a> { - pub nodes: (Symbol<'a>,), +pub struct PolarityOperator { + pub nodes: (Symbol,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/specify_section/system_timing_check_command_arguments.rs b/src/parser/specify_section/system_timing_check_command_arguments.rs index 4dac4e6..9364ec9 100644 --- a/src/parser/specify_section/system_timing_check_command_arguments.rs +++ b/src/parser/specify_section/system_timing_check_command_arguments.rs @@ -7,91 +7,85 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct TimecheckCondition<'a> { - pub nodes: (MintypmaxExpression<'a>,), +pub struct TimecheckCondition { + pub nodes: (MintypmaxExpression,), } #[derive(Debug, Node)] -pub struct ControlledReferenceEvent<'a> { - pub nodes: (ControlledTimingCheckEvent<'a>,), +pub struct ControlledReferenceEvent { + pub nodes: (ControlledTimingCheckEvent,), } #[derive(Debug, Node)] -pub struct DataEvent<'a> { - pub nodes: (TimingCheckEvent<'a>,), +pub struct DataEvent { + pub nodes: (TimingCheckEvent,), } #[derive(Debug, Node)] -pub enum DelayedData<'a> { - TerminalIdentifier(TerminalIdentifier<'a>), - WithMintypmax(DelayedDataWithMintypmax<'a>), +pub enum DelayedData { + TerminalIdentifier(TerminalIdentifier), + WithMintypmax(DelayedDataWithMintypmax), } #[derive(Debug, Node)] -pub struct DelayedDataWithMintypmax<'a> { - pub nodes: ( - TerminalIdentifier<'a>, - Bracket<'a, ConstantMintypmaxExpression<'a>>, - ), +pub struct DelayedDataWithMintypmax { + pub nodes: (TerminalIdentifier, Bracket), } #[derive(Debug, Node)] -pub enum DelayedReference<'a> { - TerminalIdentifier(TerminalIdentifier<'a>), - WithMintypmax(DelayedReferenceWithMintypmax<'a>), +pub enum DelayedReference { + TerminalIdentifier(TerminalIdentifier), + WithMintypmax(DelayedReferenceWithMintypmax), } #[derive(Debug, Node)] -pub struct DelayedReferenceWithMintypmax<'a> { - pub nodes: ( - TerminalIdentifier<'a>, - Bracket<'a, ConstantMintypmaxExpression<'a>>, - ), +pub struct DelayedReferenceWithMintypmax { + pub nodes: (TerminalIdentifier, Bracket), } #[derive(Debug, Node)] -pub struct EndEdgeOffset<'a> { - pub nodes: (MintypmaxExpression<'a>,), +pub struct EndEdgeOffset { + pub nodes: (MintypmaxExpression,), } #[derive(Debug, Node)] -pub struct EventBasedFlag<'a> { - pub nodes: (ConstantExpression<'a>,), +pub struct EventBasedFlag { + pub nodes: (ConstantExpression,), } #[derive(Debug, Node)] -pub struct Notifier<'a> { - pub nodes: (VariableIdentifier<'a>,), +pub struct Notifier { + pub nodes: (VariableIdentifier,), } #[derive(Debug, Node)] -pub struct ReferenceEvent<'a> { - pub nodes: (TimingCheckEvent<'a>,), +pub struct ReferenceEvent { + pub nodes: (TimingCheckEvent,), } #[derive(Debug, Node)] -pub struct RemainActiveFlag<'a> { - pub nodes: (ConstantMintypmaxExpression<'a>,), +pub struct RemainActiveFlag { + pub nodes: (ConstantMintypmaxExpression,), } #[derive(Debug, Node)] -pub struct TimestampCondition<'a> { - pub nodes: (MintypmaxExpression<'a>,), +pub struct TimestampCondition { + pub nodes: (MintypmaxExpression,), } #[derive(Debug, Node)] -pub struct StartEdgeOffset<'a> { - pub nodes: (MintypmaxExpression<'a>,), +pub struct StartEdgeOffset { + pub nodes: (MintypmaxExpression,), } #[derive(Debug, Node)] -pub struct Threshold<'a> { - pub nodes: (ConstantExpression<'a>,), +pub struct Threshold { + pub nodes: (ConstantExpression,), } #[derive(Debug, Node)] -pub struct TimingCheckLimit<'a> { - pub nodes: (Expression<'a>,), +pub struct TimingCheckLimit { + pub nodes: (Expression,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/specify_section/system_timing_check_commands.rs b/src/parser/specify_section/system_timing_check_commands.rs index cd7024f..bab6582 100644 --- a/src/parser/specify_section/system_timing_check_commands.rs +++ b/src/parser/specify_section/system_timing_check_commands.rs @@ -8,300 +8,264 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum SystemTimingCheck<'a> { - SetupTimingCheck(SetupTimingCheck<'a>), - HoldTimingCheck(HoldTimingCheck<'a>), - SetupholdTimingCheck(SetupholdTimingCheck<'a>), - RecoveryTimingCheck(RecoveryTimingCheck<'a>), - RemovalTimingCheck(RemovalTimingCheck<'a>), - RecremTimingCheck(RecremTimingCheck<'a>), - SkewTimingCheck(SkewTimingCheck<'a>), - TimeskewTimingCheck(TimeskewTimingCheck<'a>), - FullskewTimingCheck(FullskewTimingCheck<'a>), - PeriodTimingCheck(PeriodTimingCheck<'a>), - WidthTimingCheck(WidthTimingCheck<'a>), - NochargeTimingCheck(NochargeTimingCheck<'a>), +pub enum SystemTimingCheck { + SetupTimingCheck(SetupTimingCheck), + HoldTimingCheck(HoldTimingCheck), + SetupholdTimingCheck(SetupholdTimingCheck), + RecoveryTimingCheck(RecoveryTimingCheck), + RemovalTimingCheck(RemovalTimingCheck), + RecremTimingCheck(RecremTimingCheck), + SkewTimingCheck(SkewTimingCheck), + TimeskewTimingCheck(TimeskewTimingCheck), + FullskewTimingCheck(FullskewTimingCheck), + PeriodTimingCheck(PeriodTimingCheck), + WidthTimingCheck(WidthTimingCheck), + NochargeTimingCheck(NochargeTimingCheck), } #[derive(Debug, Node)] -pub struct SetupTimingCheck<'a> { +pub struct SetupTimingCheck { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - DataEvent<'a>, - Symbol<'a>, - ReferenceEvent<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, - Option<(Symbol<'a>, Option>)>, - ), - >, - Symbol<'a>, + Keyword, + Paren<( + DataEvent, + Symbol, + ReferenceEvent, + Symbol, + TimingCheckLimit, + Option<(Symbol, Option)>, + )>, + Symbol, ), } #[derive(Debug, Node)] -pub struct HoldTimingCheck<'a> { +pub struct HoldTimingCheck { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - ReferenceEvent<'a>, - Symbol<'a>, - DataEvent<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, - Option<(Symbol<'a>, Option>)>, - ), - >, - Symbol<'a>, + Keyword, + Paren<( + ReferenceEvent, + Symbol, + DataEvent, + Symbol, + TimingCheckLimit, + Option<(Symbol, Option)>, + )>, + Symbol, ), } #[derive(Debug, Node)] -pub struct SetupholdTimingCheck<'a> { +pub struct SetupholdTimingCheck { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - ReferenceEvent<'a>, - Symbol<'a>, - DataEvent<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, + Keyword, + Paren<( + ReferenceEvent, + Symbol, + DataEvent, + Symbol, + TimingCheckLimit, + Symbol, + TimingCheckLimit, + Option<( + Symbol, + Option, Option<( - Symbol<'a>, - Option>, + Symbol, + Option, Option<( - Symbol<'a>, - Option>, + Symbol, + Option, Option<( - Symbol<'a>, - Option>, - Option<( - Symbol<'a>, - Option>, - Option<(Symbol<'a>, Option>)>, - )>, + Symbol, + Option, + Option<(Symbol, Option)>, )>, )>, )>, - ), - >, - Symbol<'a>, + )>, + )>, + Symbol, ), } #[derive(Debug, Node)] -pub struct RecoveryTimingCheck<'a> { +pub struct RecoveryTimingCheck { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - ReferenceEvent<'a>, - Symbol<'a>, - DataEvent<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, - Option<(Symbol<'a>, Option>)>, - ), - >, - Symbol<'a>, + Keyword, + Paren<( + ReferenceEvent, + Symbol, + DataEvent, + Symbol, + TimingCheckLimit, + Option<(Symbol, Option)>, + )>, + Symbol, ), } #[derive(Debug, Node)] -pub struct RemovalTimingCheck<'a> { +pub struct RemovalTimingCheck { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - ReferenceEvent<'a>, - Symbol<'a>, - DataEvent<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, - Option<(Symbol<'a>, Option>)>, - ), - >, - Symbol<'a>, + Keyword, + Paren<( + ReferenceEvent, + Symbol, + DataEvent, + Symbol, + TimingCheckLimit, + Option<(Symbol, Option)>, + )>, + Symbol, ), } #[derive(Debug, Node)] -pub struct RecremTimingCheck<'a> { +pub struct RecremTimingCheck { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - ReferenceEvent<'a>, - Symbol<'a>, - DataEvent<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, + Keyword, + Paren<( + ReferenceEvent, + Symbol, + DataEvent, + Symbol, + TimingCheckLimit, + Symbol, + TimingCheckLimit, + Option<( + Symbol, + Option, Option<( - Symbol<'a>, - Option>, + Symbol, + Option, Option<( - Symbol<'a>, - Option>, + Symbol, + Option, Option<( - Symbol<'a>, - Option>, - Option<( - Symbol<'a>, - Option>, - Option<(Symbol<'a>, Option>)>, - )>, + Symbol, + Option, + Option<(Symbol, Option)>, )>, )>, )>, - ), - >, - Symbol<'a>, + )>, + )>, + Symbol, ), } #[derive(Debug, Node)] -pub struct SkewTimingCheck<'a> { +pub struct SkewTimingCheck { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - ReferenceEvent<'a>, - Symbol<'a>, - DataEvent<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, - Option<(Symbol<'a>, Option>)>, - ), - >, - Symbol<'a>, + Keyword, + Paren<( + ReferenceEvent, + Symbol, + DataEvent, + Symbol, + TimingCheckLimit, + Option<(Symbol, Option)>, + )>, + Symbol, ), } #[derive(Debug, Node)] -pub struct TimeskewTimingCheck<'a> { +pub struct TimeskewTimingCheck { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - ReferenceEvent<'a>, - Symbol<'a>, - DataEvent<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, + Keyword, + Paren<( + ReferenceEvent, + Symbol, + DataEvent, + Symbol, + TimingCheckLimit, + Option<( + Symbol, + Option, Option<( - Symbol<'a>, - Option>, - Option<( - Symbol<'a>, - Option>, - Option<(Symbol<'a>, Option>)>, - )>, + Symbol, + Option, + Option<(Symbol, Option)>, )>, - ), - >, - Symbol<'a>, + )>, + )>, + Symbol, ), } #[derive(Debug, Node)] -pub struct FullskewTimingCheck<'a> { +pub struct FullskewTimingCheck { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - ReferenceEvent<'a>, - Symbol<'a>, - DataEvent<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, + Keyword, + Paren<( + ReferenceEvent, + Symbol, + DataEvent, + Symbol, + TimingCheckLimit, + Symbol, + TimingCheckLimit, + Option<( + Symbol, + Option, Option<( - Symbol<'a>, - Option>, - Option<( - Symbol<'a>, - Option>, - Option<(Symbol<'a>, Option>)>, - )>, + Symbol, + Option, + Option<(Symbol, Option)>, )>, - ), - >, - Symbol<'a>, + )>, + )>, + Symbol, ), } #[derive(Debug, Node)] -pub struct PeriodTimingCheck<'a> { +pub struct PeriodTimingCheck { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - ControlledReferenceEvent<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, - Option<(Symbol<'a>, Option>)>, - ), - >, - Symbol<'a>, + Keyword, + Paren<( + ControlledReferenceEvent, + Symbol, + TimingCheckLimit, + Option<(Symbol, Option)>, + )>, + Symbol, ), } #[derive(Debug, Node)] -pub struct WidthTimingCheck<'a> { +pub struct WidthTimingCheck { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - ControlledReferenceEvent<'a>, - Symbol<'a>, - TimingCheckLimit<'a>, - Symbol<'a>, - Threshold<'a>, - Option<(Symbol<'a>, Option>)>, - ), - >, - Symbol<'a>, + Keyword, + Paren<( + ControlledReferenceEvent, + Symbol, + TimingCheckLimit, + Symbol, + Threshold, + Option<(Symbol, Option)>, + )>, + Symbol, ), } #[derive(Debug, Node)] -pub struct NochargeTimingCheck<'a> { +pub struct NochargeTimingCheck { pub nodes: ( - Keyword<'a>, - Paren< - 'a, - ( - ReferenceEvent<'a>, - Symbol<'a>, - DataEvent<'a>, - Symbol<'a>, - StartEdgeOffset<'a>, - Symbol<'a>, - EndEdgeOffset<'a>, - Option<(Symbol<'a>, Option>)>, - ), - >, - Symbol<'a>, + Keyword, + Paren<( + ReferenceEvent, + Symbol, + DataEvent, + Symbol, + StartEdgeOffset, + Symbol, + EndEdgeOffset, + Option<(Symbol, Option)>, + )>, + Symbol, ), } diff --git a/src/parser/specify_section/system_timing_check_event_definitions.rs b/src/parser/specify_section/system_timing_check_event_definitions.rs index 0ca5169..f155987 100644 --- a/src/parser/specify_section/system_timing_check_event_definitions.rs +++ b/src/parser/specify_section/system_timing_check_event_definitions.rs @@ -8,81 +8,78 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct TimingCheckEvent<'a> { +pub struct TimingCheckEvent { pub nodes: ( - Option>, - SpecifyTerminalDescriptor<'a>, - Option<(Symbol<'a>, TimingCheckCondition<'a>)>, + Option, + SpecifyTerminalDescriptor, + Option<(Symbol, TimingCheckCondition)>, ), } #[derive(Debug, Node)] -pub struct ControlledTimingCheckEvent<'a> { +pub struct ControlledTimingCheckEvent { pub nodes: ( - TimingCheckEventControl<'a>, - SpecifyTerminalDescriptor<'a>, - Option<(Symbol<'a>, TimingCheckCondition<'a>)>, + TimingCheckEventControl, + SpecifyTerminalDescriptor, + Option<(Symbol, TimingCheckCondition)>, ), } #[derive(Debug, Node)] -pub enum TimingCheckEventControl<'a> { - Posedge(Keyword<'a>), - Negedge(Keyword<'a>), - Edge(Keyword<'a>), - EdgeControlSpecifier(EdgeControlSpecifier<'a>), +pub enum TimingCheckEventControl { + Posedge(Keyword), + Negedge(Keyword), + Edge(Keyword), + EdgeControlSpecifier(EdgeControlSpecifier), } #[derive(Debug, Node)] -pub enum SpecifyTerminalDescriptor<'a> { - SpecifyInputTerminalDescriptor(SpecifyInputTerminalDescriptor<'a>), - SpecifyOutputTerminalDescriptor(SpecifyOutputTerminalDescriptor<'a>), +pub enum SpecifyTerminalDescriptor { + SpecifyInputTerminalDescriptor(SpecifyInputTerminalDescriptor), + SpecifyOutputTerminalDescriptor(SpecifyOutputTerminalDescriptor), } #[derive(Debug, Node)] -pub struct EdgeControlSpecifier<'a> { - pub nodes: ( - Keyword<'a>, - Bracket<'a, List, EdgeDescriptor<'a>>>, - ), +pub struct EdgeControlSpecifier { + pub nodes: (Keyword, Bracket>), } #[derive(Debug, Node)] -pub struct EdgeDescriptor<'a> { - pub nodes: (Keyword<'a>,), +pub struct EdgeDescriptor { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub enum TimingCheckCondition<'a> { - ScalarTimingCheckCondition(ScalarTimingCheckCondition<'a>), - Paren(TimingCheckConditionParen<'a>), +pub enum TimingCheckCondition { + ScalarTimingCheckCondition(ScalarTimingCheckCondition), + Paren(TimingCheckConditionParen), } #[derive(Debug, Node)] -pub struct TimingCheckConditionParen<'a> { - pub nodes: (Paren<'a, ScalarTimingCheckCondition<'a>>,), +pub struct TimingCheckConditionParen { + pub nodes: (Paren,), } #[derive(Debug, Node)] -pub enum ScalarTimingCheckCondition<'a> { - Expression(Expression<'a>), - Unary(ScalarTimingCheckConditionUnary<'a>), - Binary(ScalarTimingCheckConditionBinary<'a>), +pub enum ScalarTimingCheckCondition { + Expression(Expression), + Unary(ScalarTimingCheckConditionUnary), + Binary(ScalarTimingCheckConditionBinary), } #[derive(Debug, Node)] -pub struct ScalarTimingCheckConditionUnary<'a> { - pub nodes: (Symbol<'a>, Expression<'a>), +pub struct ScalarTimingCheckConditionUnary { + pub nodes: (Symbol, Expression), } #[derive(Debug, Node)] -pub struct ScalarTimingCheckConditionBinary<'a> { - pub nodes: (Expression<'a>, Symbol<'a>, ScalarConstant<'a>), +pub struct ScalarTimingCheckConditionBinary { + pub nodes: (Expression, Symbol, ScalarConstant), } #[derive(Debug, Node)] -pub struct ScalarConstant<'a> { - pub nodes: (Keyword<'a>,), +pub struct ScalarConstant { + pub nodes: (Keyword,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/udp_declaration_and_instantiation/udp_body.rs b/src/parser/udp_declaration_and_instantiation/udp_body.rs index cd3a763..3e21325 100644 --- a/src/parser/udp_declaration_and_instantiation/udp_body.rs +++ b/src/parser/udp_declaration_and_instantiation/udp_body.rs @@ -9,120 +9,110 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub enum UdpBody<'a> { - CombinationalBody(CombinationalBody<'a>), - SequentialBody(SequentialBody<'a>), +pub enum UdpBody { + CombinationalBody(CombinationalBody), + SequentialBody(SequentialBody), } #[derive(Debug, Node)] -pub struct CombinationalBody<'a> { +pub struct CombinationalBody { pub nodes: ( - Keyword<'a>, - CombinationalEntry<'a>, - Vec>, - Keyword<'a>, + Keyword, + CombinationalEntry, + Vec, + Keyword, ), } #[derive(Debug, Node)] -pub struct CombinationalEntry<'a> { - pub nodes: (LevelInputList<'a>, Symbol<'a>, OutputSymbol<'a>, Symbol<'a>), +pub struct CombinationalEntry { + pub nodes: (LevelInputList, Symbol, OutputSymbol, Symbol), } #[derive(Debug, Node)] -pub struct SequentialBody<'a> { +pub struct SequentialBody { pub nodes: ( - Option>, - Keyword<'a>, - SequentialEntry<'a>, - Vec>, - Keyword<'a>, + Option, + Keyword, + SequentialEntry, + Vec, + Keyword, ), } #[derive(Debug, Node)] -pub struct UdpInitialStatement<'a> { +pub struct UdpInitialStatement { + pub nodes: (Keyword, OutputPortIdentifier, Symbol, InitVal, Symbol), +} + +#[derive(Debug, Node)] +pub struct InitVal { + pub nodes: (Keyword,), +} + +#[derive(Debug, Node)] +pub struct SequentialEntry { pub nodes: ( - Keyword<'a>, - OutputPortIdentifier<'a>, - Symbol<'a>, - InitVal<'a>, - Symbol<'a>, + SeqInputList, + Symbol, + CurrentState, + Symbol, + NextState, + Symbol, ), } #[derive(Debug, Node)] -pub struct InitVal<'a> { - pub nodes: (Keyword<'a>,), +pub enum SeqInputList { + LevelInputList(LevelInputList), + EdgeInputList(EdgeInputList), } #[derive(Debug, Node)] -pub struct SequentialEntry<'a> { - pub nodes: ( - SeqInputList<'a>, - Symbol<'a>, - CurrentState<'a>, - Symbol<'a>, - NextState<'a>, - Symbol<'a>, - ), +pub struct LevelInputList { + pub nodes: (LevelSymbol, Vec), } #[derive(Debug, Node)] -pub enum SeqInputList<'a> { - LevelInputList(LevelInputList<'a>), - EdgeInputList(EdgeInputList<'a>), +pub struct EdgeInputList { + pub nodes: (Vec, EdgeIndicator, Vec), } #[derive(Debug, Node)] -pub struct LevelInputList<'a> { - pub nodes: (LevelSymbol<'a>, Vec>), +pub enum EdgeIndicator { + Paren(EdgeIndicatorParen), + EdgeSymbol(EdgeSymbol), } #[derive(Debug, Node)] -pub struct EdgeInputList<'a> { - pub nodes: ( - Vec>, - EdgeIndicator<'a>, - Vec>, - ), +pub struct EdgeIndicatorParen { + pub nodes: (Paren<(LevelSymbol, LevelSymbol)>,), } #[derive(Debug, Node)] -pub enum EdgeIndicator<'a> { - Paren(EdgeIndicatorParen<'a>), - EdgeSymbol(EdgeSymbol<'a>), +pub struct CurrentState { + pub nodes: (LevelSymbol,), } #[derive(Debug, Node)] -pub struct EdgeIndicatorParen<'a> { - pub nodes: (Paren<'a, (LevelSymbol<'a>, LevelSymbol<'a>)>,), +pub enum NextState { + OutputSymbol(OutputSymbol), + Minus(Symbol), } #[derive(Debug, Node)] -pub struct CurrentState<'a> { - pub nodes: (LevelSymbol<'a>,), +pub struct OutputSymbol { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub enum NextState<'a> { - OutputSymbol(OutputSymbol<'a>), - Minus(Symbol<'a>), +pub struct LevelSymbol { + pub nodes: (Keyword,), } #[derive(Debug, Node)] -pub struct OutputSymbol<'a> { - pub nodes: (Keyword<'a>,), -} - -#[derive(Debug, Node)] -pub struct LevelSymbol<'a> { - pub nodes: (Keyword<'a>,), -} - -#[derive(Debug, Node)] -pub struct EdgeSymbol<'a> { - pub nodes: (Keyword<'a>,), +pub struct EdgeSymbol { + pub nodes: (Keyword,), } // ----------------------------------------------------------------------------- diff --git a/src/parser/udp_declaration_and_instantiation/udp_declaration.rs b/src/parser/udp_declaration_and_instantiation/udp_declaration.rs index 3538fda..a7f5c9e 100644 --- a/src/parser/udp_declaration_and_instantiation/udp_declaration.rs +++ b/src/parser/udp_declaration_and_instantiation/udp_declaration.rs @@ -9,80 +9,80 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct UdpNonansiDeclaration<'a> { +pub struct UdpNonansiDeclaration { pub nodes: ( - Vec>, - Keyword<'a>, - UdpIdentifier<'a>, - Paren<'a, UdpPortList<'a>>, - Symbol<'a>, + Vec, + Keyword, + UdpIdentifier, + Paren, + Symbol, ), } #[derive(Debug, Node)] -pub struct UdpAnsiDeclaration<'a> { +pub struct UdpAnsiDeclaration { pub nodes: ( - Vec>, - Keyword<'a>, - UdpIdentifier<'a>, - Paren<'a, UdpDeclarationPortList<'a>>, - Symbol<'a>, + Vec, + Keyword, + UdpIdentifier, + Paren, + Symbol, ), } #[derive(Debug, Node)] -pub enum UdpDeclaration<'a> { - Nonansi(UdpDeclarationNonansi<'a>), - Ansi(UdpDeclarationAnsi<'a>), - ExternNonansi(UdpDeclarationExternNonansi<'a>), - ExternAnsi(UdpDeclarationExternAnsi<'a>), - Wildcard(UdpDeclarationWildcard<'a>), +pub enum UdpDeclaration { + Nonansi(UdpDeclarationNonansi), + Ansi(UdpDeclarationAnsi), + ExternNonansi(UdpDeclarationExternNonansi), + ExternAnsi(UdpDeclarationExternAnsi), + Wildcard(UdpDeclarationWildcard), } #[derive(Debug, Node)] -pub struct UdpDeclarationNonansi<'a> { +pub struct UdpDeclarationNonansi { pub nodes: ( - UdpNonansiDeclaration<'a>, - UdpPortDeclaration<'a>, - Vec>, - UdpBody<'a>, - Keyword<'a>, - Option<(Symbol<'a>, UdpIdentifier<'a>)>, + UdpNonansiDeclaration, + UdpPortDeclaration, + Vec, + UdpBody, + Keyword, + Option<(Symbol, UdpIdentifier)>, ), } #[derive(Debug, Node)] -pub struct UdpDeclarationAnsi<'a> { +pub struct UdpDeclarationAnsi { pub nodes: ( - UdpAnsiDeclaration<'a>, - UdpBody<'a>, - Keyword<'a>, - Option<(Symbol<'a>, UdpIdentifier<'a>)>, + UdpAnsiDeclaration, + UdpBody, + Keyword, + Option<(Symbol, UdpIdentifier)>, ), } #[derive(Debug, Node)] -pub struct UdpDeclarationExternNonansi<'a> { - pub nodes: (Keyword<'a>, UdpNonansiDeclaration<'a>), +pub struct UdpDeclarationExternNonansi { + pub nodes: (Keyword, UdpNonansiDeclaration), } #[derive(Debug, Node)] -pub struct UdpDeclarationExternAnsi<'a> { - pub nodes: (Keyword<'a>, UdpAnsiDeclaration<'a>), +pub struct UdpDeclarationExternAnsi { + pub nodes: (Keyword, UdpAnsiDeclaration), } #[derive(Debug, Node)] -pub struct UdpDeclarationWildcard<'a> { +pub struct UdpDeclarationWildcard { pub nodes: ( - Vec>, - Keyword<'a>, - UdpIdentifier<'a>, - Paren<'a, Symbol<'a>>, - Symbol<'a>, - Vec>, - UdpBody<'a>, - Keyword<'a>, - Option<(Symbol<'a>, UdpIdentifier<'a>)>, + Vec, + Keyword, + UdpIdentifier, + Paren, + Symbol, + Vec, + UdpBody, + Keyword, + Option<(Symbol, UdpIdentifier)>, ), } diff --git a/src/parser/udp_declaration_and_instantiation/udp_instantiation.rs b/src/parser/udp_declaration_and_instantiation/udp_instantiation.rs index 41950e4..37003c9 100644 --- a/src/parser/udp_declaration_and_instantiation/udp_instantiation.rs +++ b/src/parser/udp_declaration_and_instantiation/udp_instantiation.rs @@ -8,29 +8,26 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct UdpInstantiation<'a> { +pub struct UdpInstantiation { pub nodes: ( - UdpIdentifier<'a>, - Option>, - Option>, - List, UdpInstance<'a>>, - Symbol<'a>, + UdpIdentifier, + Option, + Option, + List, + Symbol, ), } #[derive(Debug, Node)] -pub struct UdpInstance<'a> { +pub struct UdpInstance { pub nodes: ( - Option>, - Paren< - 'a, - ( - OutputTerminal<'a>, - Symbol<'a>, - InputTerminal<'a>, - Vec<(Symbol<'a>, InputTerminal<'a>)>, - ), - >, + Option, + Paren<( + OutputTerminal, + Symbol, + InputTerminal, + Vec<(Symbol, InputTerminal)>, + )>, ), } diff --git a/src/parser/udp_declaration_and_instantiation/udp_ports.rs b/src/parser/udp_declaration_and_instantiation/udp_ports.rs index fdb466c..5c84615 100644 --- a/src/parser/udp_declaration_and_instantiation/udp_ports.rs +++ b/src/parser/udp_declaration_and_instantiation/udp_ports.rs @@ -9,67 +9,67 @@ use nom::IResult; // ----------------------------------------------------------------------------- #[derive(Debug, Node)] -pub struct UdpPortList<'a> { +pub struct UdpPortList { pub nodes: ( - OutputPortIdentifier<'a>, - Symbol<'a>, - List, InputPortIdentifier<'a>>, + OutputPortIdentifier, + Symbol, + List, ), } #[derive(Debug, Node)] -pub struct UdpDeclarationPortList<'a> { +pub struct UdpDeclarationPortList { pub nodes: ( - UdpOutputDeclaration<'a>, - Symbol<'a>, - List, UdpInputDeclaration<'a>>, + UdpOutputDeclaration, + Symbol, + List, ), } #[derive(Debug, Node)] -pub enum UdpPortDeclaration<'a> { - UdpOutputDeclaration((UdpOutputDeclaration<'a>, Symbol<'a>)), - UdpInputDeclaration((UdpInputDeclaration<'a>, Symbol<'a>)), - UdpRegDeclaration((UdpRegDeclaration<'a>, Symbol<'a>)), +pub enum UdpPortDeclaration { + UdpOutputDeclaration((UdpOutputDeclaration, Symbol)), + UdpInputDeclaration((UdpInputDeclaration, Symbol)), + UdpRegDeclaration((UdpRegDeclaration, Symbol)), } #[derive(Debug, Node)] -pub enum UdpOutputDeclaration<'a> { - Nonreg(UdpOutputDeclarationNonreg<'a>), - Reg(UdpOutputDeclarationReg<'a>), +pub enum UdpOutputDeclaration { + Nonreg(UdpOutputDeclarationNonreg), + Reg(UdpOutputDeclarationReg), } #[derive(Debug, Node)] -pub struct UdpOutputDeclarationNonreg<'a> { - pub nodes: (Vec>, Keyword<'a>, PortIdentifier<'a>), +pub struct UdpOutputDeclarationNonreg { + pub nodes: (Vec, Keyword, PortIdentifier), } #[derive(Debug, Node)] -pub struct UdpOutputDeclarationReg<'a> { +pub struct UdpOutputDeclarationReg { pub nodes: ( - Vec>, - Keyword<'a>, - Keyword<'a>, - PortIdentifier<'a>, - Option<(Symbol<'a>, ConstantExpression<'a>)>, + Vec, + Keyword, + Keyword, + PortIdentifier, + Option<(Symbol, ConstantExpression)>, ), } #[derive(Debug, Node)] -pub struct UdpInputDeclaration<'a> { +pub struct UdpInputDeclaration { pub nodes: ( - Vec>, - Keyword<'a>, - ListOfUdpPortIdentifiers<'a>, + Vec, + Keyword, + ListOfUdpPortIdentifiers, ), } #[derive(Debug, Node)] -pub struct UdpRegDeclaration<'a> { +pub struct UdpRegDeclaration { pub nodes: ( - Vec>, - Keyword<'a>, - VariableIdentifier<'a>, + Vec, + Keyword, + VariableIdentifier, ), } diff --git a/src/parser/utils.rs b/src/parser/utils.rs index 1d18d23..2b5cb3b 100644 --- a/src/parser/utils.rs +++ b/src/parser/utils.rs @@ -262,39 +262,39 @@ const KEYWORDS: &[&str] = &[ ]; #[derive(Debug, Node)] -pub struct Symbol<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct Symbol { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub struct Keyword<'a> { - pub nodes: (Span<'a>, Vec>), +pub struct Keyword { + pub nodes: (Locate, Vec), } #[derive(Debug, Node)] -pub enum WhiteSpace<'a> { - Space(Span<'a>), - Comment(Comment<'a>), +pub enum WhiteSpace { + Space(Locate), + Comment(Comment), } #[derive(Debug)] -pub struct Paren<'a, T: 'a> { - pub nodes: (Symbol<'a>, T, Symbol<'a>), +pub struct Paren { + pub nodes: (Symbol, T, Symbol), } #[derive(Debug)] -pub struct Brace<'a, T: 'a> { - pub nodes: (Symbol<'a>, T, Symbol<'a>), +pub struct Brace { + pub nodes: (Symbol, T, Symbol), } #[derive(Debug)] -pub struct Bracket<'a, T: 'a> { - pub nodes: (Symbol<'a>, T, Symbol<'a>), +pub struct Bracket { + pub nodes: (Symbol, T, Symbol), } #[derive(Debug)] -pub struct ApostropheBrace<'a, T: 'a> { - pub nodes: (Symbol<'a>, T, Symbol<'a>), +pub struct ApostropheBrace { + pub nodes: (Symbol, T, Symbol), } #[derive(Debug)] @@ -304,7 +304,7 @@ pub struct List { // ----------------------------------------------------------------------------- -pub fn ws<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult, (O, Vec>)> +pub fn ws<'a, O, F>(f: F) -> impl Fn(Span<'a>) -> IResult, (O, Vec)> where F: Fn(Span<'a>) -> IResult, O>, { @@ -315,22 +315,28 @@ where } } -pub fn symbol<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, Symbol<'a>> { +pub fn symbol<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, Symbol> { move |s: Span<'a>| { #[cfg(feature = "trace")] let s = trace(s, &format!("symbol(\"{}\")", t)); - let (s, x) = map(ws(tag(t.clone())), |x| Symbol { nodes: x })(s)?; + let (s, x) = map(ws(map(tag(t.clone()), |x: Span| x.into())), |x| Symbol { + nodes: x, + })(s)?; Ok((clear_recursive_flags(s), x)) } } -pub fn keyword<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, Keyword<'a>> { +pub fn keyword<'a>(t: &'a str) -> impl Fn(Span<'a>) -> IResult, Keyword> { move |s: Span<'a>| { #[cfg(feature = "trace")] let s = trace(s, &format!("keyword(\"{}\")", t)); - let (s, x) = map(ws(terminated(tag(t.clone()), peek(none_of(AZ09_)))), |x| { - Keyword { nodes: x } - })(s)?; + let (s, x) = map( + ws(terminated( + map(tag(t.clone()), |x: Span| x.into()), + peek(none_of(AZ09_)), + )), + |x| Keyword { nodes: x }, + )(s)?; Ok((clear_recursive_flags(s), x)) } } @@ -467,7 +473,7 @@ where #[parser] pub fn white_space(s: Span) -> IResult { alt(( - map(multispace1, |x| WhiteSpace::Space(x)), + map(multispace1, |x: Span| WhiteSpace::Space(x.into())), map(comment, |x| WhiteSpace::Comment(x)), ))(s) } diff --git a/sv-parser-macro/src/lib.rs b/sv-parser-macro/src/lib.rs index ea884df..0308203 100644 --- a/sv-parser-macro/src/lib.rs +++ b/sv-parser-macro/src/lib.rs @@ -52,24 +52,24 @@ fn impl_node(ast: &DeriveInput) -> TokenStream { }; let gen = quote! { - impl<'a> Node<'a> for #name<'a> { + impl<'a> Node<'a> for #name { fn next(&'a self) -> AnyNodes<'a> { #next } } - impl<'a> From<&'a #name<'a>> for AnyNodes<'a> { - fn from(x: &'a #name<'a>) -> Self { + impl<'a> From<&'a #name> for AnyNodes<'a> { + fn from(x: &'a #name) -> Self { vec![AnyNode::#name(x)].into() } } - impl<'a> IntoIterator for &'a #name<'a> { + impl<'a> IntoIterator for &'a #name { type Item = AnyNode<'a>; type IntoIter = Iter<'a>; fn into_iter(self) -> Self::IntoIter { - let nodes: AnyNodes<'a> = self.into(); + let nodes: AnyNodes = self.into(); Iter { next: nodes } } }