Apply derive(Node) to all

This commit is contained in:
dalance 2019-07-12 18:33:41 +09:00
parent 8354be14a1
commit d839a4a47b
53 changed files with 1160 additions and 1066 deletions

View File

@ -115,6 +115,26 @@ where
}
}
impl<'a, T: 'a, U: 'a, V: 'a, W: 'a, S: 'a> From<&'a (T, U, V, W, S)> for AnyNodes<'a>
where
&'a T: Into<AnyNodes<'a>>,
&'a U: Into<AnyNodes<'a>>,
&'a V: Into<AnyNodes<'a>>,
&'a W: Into<AnyNodes<'a>>,
&'a S: Into<AnyNodes<'a>>,
{
fn from(x: &'a (T, U, V, W, S)) -> Self {
let mut ret = Vec::new();
let (t, u, v, w, s) = x;
ret.append(&mut t.into().0);
ret.append(&mut u.into().0);
ret.append(&mut v.into().0);
ret.append(&mut w.into().0);
ret.append(&mut s.into().0);
ret.into()
}
}
impl<'a, T> From<&'a Paren<'a, T>> for AnyNodes<'a>
where
&'a T: Into<AnyNodes<'a>>,
@ -193,3 +213,15 @@ where
ret.into()
}
}
impl<'a, T: 'a> From<&'a Box<T>> for AnyNodes<'a>
where
&'a T: Into<AnyNodes<'a>>,
{
fn from(x: &'a Box<T>) -> Self {
let mut ret = Vec::new();
let mut x: AnyNodes<'a> = x.into();
ret.append(&mut x.0);
ret.into()
}
}

View File

@ -7,13 +7,13 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum AssertionItem<'a> {
Concurrent(ConcurrentAssertionItem<'a>),
Immediate(DeferredImmediateAssetionItem<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DeferredImmediateAssetionItem<'a> {
pub nodes: (
Option<(BlockIdentifier<'a>, Symbol<'a>)>,
@ -21,49 +21,49 @@ pub struct DeferredImmediateAssetionItem<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ProceduralAssertionStatement<'a> {
Concurrent(ConcurrentAssertionStatement<'a>),
Immediate(ImmediateAssetionStatement<'a>),
Checker(CheckerInstantiation<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ImmediateAssetionStatement<'a> {
Simple(SimpleImmediateAssertionStatement<'a>),
Deferred(DeferredImmediateAssertionStatement<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum SimpleImmediateAssertionStatement<'a> {
Assert(SimpleImmediateAssertStatement<'a>),
Assume(SimpleImmediateAssumeStatement<'a>),
Cover(SimpleImmediateCoverStatement<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SimpleImmediateAssertStatement<'a> {
pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, ActionBlock<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SimpleImmediateAssumeStatement<'a> {
pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, ActionBlock<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SimpleImmediateCoverStatement<'a> {
pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum DeferredImmediateAssertionStatement<'a> {
Assert(DeferredImmediateAssertStatement<'a>),
Assume(DeferredImmediateAssumeStatement<'a>),
Cover(DeferredImmediateCoverStatement<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DeferredImmediateAssertStatement<'a> {
pub nodes: (
Symbol<'a>,
@ -73,7 +73,7 @@ pub struct DeferredImmediateAssertStatement<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DeferredImmediateAssumeStatement<'a> {
pub nodes: (
Symbol<'a>,
@ -83,7 +83,7 @@ pub struct DeferredImmediateAssumeStatement<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DeferredImmediateCoverStatement<'a> {
pub nodes: (
Symbol<'a>,

View File

@ -8,14 +8,14 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CaseStatement<'a> {
Normal(CaseStatementNormal<'a>),
Matches(CaseStatementMatches<'a>),
Inside(CaseStatementInside<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CaseStatementNormal<'a> {
pub nodes: (
Option<UniquePriority<'a>>,
@ -27,7 +27,7 @@ pub struct CaseStatementNormal<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CaseStatementMatches<'a> {
pub nodes: (
Option<UniquePriority<'a>>,
@ -40,7 +40,7 @@ pub struct CaseStatementMatches<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CaseStatementInside<'a> {
pub nodes: (
Option<UniquePriority<'a>>,
@ -60,18 +60,18 @@ pub enum CaseKeyword<'a> {
Casex(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CaseExpression<'a> {
pub nodes: (Expression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CaseItem<'a> {
NonDefault(CaseItemNondefault<'a>),
Default(CaseItemDefault<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CaseItemNondefault<'a> {
pub nodes: (
List<Symbol<'a>, CaseItemExpression<'a>>,
@ -80,18 +80,18 @@ pub struct CaseItemNondefault<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CaseItemDefault<'a> {
pub nodes: (Symbol<'a>, Option<Symbol<'a>>, StatementOrNull<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CasePatternItem<'a> {
NonDefault(CasePatternItemNondefault<'a>),
Default(CaseItemDefault<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CasePatternItemNondefault<'a> {
pub nodes: (
Pattern<'a>,
@ -101,23 +101,23 @@ pub struct CasePatternItemNondefault<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CaseInsideItem<'a> {
NonDefault(CaseInsideItemNondefault<'a>),
Default(CaseItemDefault<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CaseInsideItemNondefault<'a> {
pub nodes: (OpenRangeList<'a>, Symbol<'a>, StatementOrNull<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CaseItemExpression<'a> {
pub nodes: (Expression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RandcaseStatement<'a> {
pub nodes: (
Symbol<'a>,
@ -127,17 +127,17 @@ pub struct RandcaseStatement<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RandcaseItem<'a> {
pub nodes: (Expression<'a>, Symbol<'a>, StatementOrNull<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct OpenRangeList<'a> {
pub nodes: (List<Symbol<'a>, OpenValueRange<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct OpenValueRange<'a> {
pub nodes: (ValueRange<'a>,),
}

View File

@ -8,13 +8,13 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ClockingDeclaration<'a> {
Local(ClockingDeclarationLocal<'a>),
Global(ClockingDeclarationGlobal<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClockingDeclarationLocal<'a> {
pub nodes: (
Option<Default<'a>>,
@ -33,7 +33,7 @@ pub struct Default<'a> {
pub nodes: (Symbol<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClockingDeclarationGlobal<'a> {
pub nodes: (
Symbol<'a>,
@ -46,7 +46,7 @@ pub struct ClockingDeclarationGlobal<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ClockingEvent<'a> {
Identifier(ClockingEventIdentifier<'a>),
Expression(ClockingEventExpression<'a>),
@ -57,24 +57,24 @@ pub struct ClockingEventIdentifier<'a> {
pub nodes: (Symbol<'a>, Identifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClockingEventExpression<'a> {
pub nodes: (Symbol<'a>, Paren<'a, EventExpression<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ClockingItem<'a> {
Default(ClockingItemDefault<'a>),
Direction(ClockingItemDirection<'a>),
Assertion(ClockingItemAssertion<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClockingItemDefault<'a> {
pub nodes: (Symbol<'a>, DefaultSkew<'a>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClockingItemDirection<'a> {
pub nodes: (
ClockingDirection<'a>,
@ -83,34 +83,34 @@ pub struct ClockingItemDirection<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClockingItemAssertion<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, AssertionItemDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum DefaultSkew<'a> {
Input(DefaultSkewInput<'a>),
Output(DefaultSkewOutput<'a>),
InputOutput(DefaultSkewInputOutput<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DefaultSkewInput<'a> {
pub nodes: (Symbol<'a>, ClockingSkew<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DefaultSkewOutput<'a> {
pub nodes: (Symbol<'a>, ClockingSkew<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DefaultSkewInputOutput<'a> {
pub nodes: (Symbol<'a>, ClockingSkew<'a>, Symbol<'a>, ClockingSkew<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ClockingDirection<'a> {
Input(ClockingDirectionInput<'a>),
Output(ClockingDirectionOutput<'a>),
@ -118,17 +118,17 @@ pub enum ClockingDirection<'a> {
Inout(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClockingDirectionInput<'a> {
pub nodes: (Symbol<'a>, Option<ClockingSkew<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClockingDirectionOutput<'a> {
pub nodes: (Symbol<'a>, Option<ClockingSkew<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClockingDirectionInputOutput<'a> {
pub nodes: (
Symbol<'a>,
@ -138,28 +138,28 @@ pub struct ClockingDirectionInputOutput<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfClockingDeclAssign<'a> {
pub nodes: (List<Symbol<'a>, ClockingDeclAssign<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClockingDeclAssign<'a> {
pub nodes: (SignalIdentifier<'a>, Option<(Symbol<'a>, Expression<'a>)>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ClockingSkew<'a> {
Edge(ClockingSkewEdge<'a>),
DelayControl(DelayControl<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClockingSkewEdge<'a> {
pub nodes: (EdgeIdentifier<'a>, Option<DelayControl<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClockingDrive<'a> {
pub nodes: (
ClockvarExpression<'a>,
@ -169,7 +169,7 @@ pub struct ClockingDrive<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CycleDelay<'a> {
Integral(CycleDelayIntegral<'a>),
Identifier(CycleDelayIdentifier<'a>),
@ -186,17 +186,17 @@ pub struct CycleDelayIdentifier<'a> {
pub nodes: (Symbol<'a>, Identifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CycleDelayExpression<'a> {
pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct Clockvar<'a> {
pub nodes: (HierarchicalIdentifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClockvarExpression<'a> {
pub nodes: (Clockvar<'a>, Select<'a>),
}

View File

@ -8,7 +8,7 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConditionalStatement<'a> {
pub nodes: (
Option<UniquePriority<'a>>,
@ -32,18 +32,18 @@ pub enum UniquePriority<'a> {
Priority(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CondPredicate<'a> {
pub nodes: (List<Symbol<'a>, ExpressionOrCondPattern<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ExpressionOrCondPattern<'a> {
Expression(Expression<'a>),
CondPattern(CondPattern<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CondPattern<'a> {
pub nodes: (Expression<'a>, Symbol<'a>, Pattern<'a>),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -5,13 +6,13 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ContinuousAssign<'a> {
Net(ContinuousAssignNet<'a>),
Variable(ContinuousAssignVariable<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ContinuousAssignNet<'a> {
pub nodes: (
Symbol<'a>,
@ -22,7 +23,7 @@ pub struct ContinuousAssignNet<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ContinuousAssignVariable<'a> {
pub nodes: (
Symbol<'a>,
@ -32,17 +33,17 @@ pub struct ContinuousAssignVariable<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfNetAssignments<'a> {
pub nodes: (List<Symbol<'a>, NetAssignment<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfVariableAssignments<'a> {
pub nodes: (List<Symbol<'a>, VariableAssignment<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NetAlias<'a> {
pub nodes: (
Symbol<'a>,
@ -53,7 +54,7 @@ pub struct NetAlias<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NetAssignment<'a> {
pub nodes: (NetLvalue<'a>, Symbol<'a>, Expression<'a>),
}

View File

@ -7,7 +7,7 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum LoopStatement<'a> {
Forever(LoopStatementForever<'a>),
Repeat(LoopStatementRepeat<'a>),
@ -17,22 +17,22 @@ pub enum LoopStatement<'a> {
Foreach(LoopStatementForeach<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LoopStatementForever<'a> {
pub nodes: (Symbol<'a>, StatementOrNull<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LoopStatementRepeat<'a> {
pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LoopStatementWhile<'a> {
pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LoopStatementFor<'a> {
pub nodes: (
Symbol<'a>,
@ -50,7 +50,7 @@ pub struct LoopStatementFor<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LoopStatementDoWhile<'a> {
pub nodes: (
Symbol<'a>,
@ -61,7 +61,7 @@ pub struct LoopStatementDoWhile<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LoopStatementForeach<'a> {
pub nodes: (
Symbol<'a>,
@ -76,18 +76,18 @@ pub struct LoopStatementForeach<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ForInitialization<'a> {
ListOfVariableAssignments(ListOfVariableAssignments<'a>),
Declaration(ForInitializationDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ForInitializationDeclaration<'a> {
pub nodes: (List<Symbol<'a>, ForVariableDeclaration<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ForVariableDeclaration<'a> {
pub nodes: (
Option<Var<'a>>,
@ -101,19 +101,19 @@ pub struct Var<'a> {
pub nodes: (Symbol<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ForStep<'a> {
pub nodes: (List<Symbol<'a>, ForStepAssignment<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ForStepAssignment<'a> {
OperatorAssignment(OperatorAssignment<'a>),
IncOrDecExpression(IncOrDecExpression<'a>),
FunctionSubroutineCall(FunctionSubroutineCall<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LoopVariables<'a> {
pub nodes: (List<Symbol<'a>, Option<IndexVariableIdentifier<'a>>>,),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -7,18 +8,18 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ActionBlock<'a> {
StatementOrNull(StatementOrNull<'a>),
Else(ActionBlockElse<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ActionBlockElse<'a> {
pub nodes: (Option<Statement<'a>>, Symbol<'a>, StatementOrNull<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SeqBlock<'a> {
pub nodes: (
Symbol<'a>,
@ -30,7 +31,7 @@ pub struct SeqBlock<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ParBlock<'a> {
pub nodes: (
Symbol<'a>,
@ -42,7 +43,7 @@ pub struct ParBlock<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum JoinKeyword<'a> {
Join(Symbol<'a>),
JoinAny(Symbol<'a>),

View File

@ -7,7 +7,7 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum Pattern<'a> {
Variable(Box<PatternVariable<'a>>),
Asterisk(Symbol<'a>),
@ -22,23 +22,23 @@ pub struct PatternVariable<'a> {
pub nodes: (Symbol<'a>, VariableIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PatternTagged<'a> {
pub nodes: (Symbol<'a>, MemberIdentifier<'a>, Option<Pattern<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PatternList<'a> {
pub nodes: (ApostropheBrace<'a, List<Symbol<'a>, Pattern<'a>>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PatternIdentifierList<'a> {
pub nodes:
(ApostropheBrace<'a, List<Symbol<'a>, (MemberIdentifier<'a>, Symbol<'a>, Pattern<'a>)>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum AssignmentPattern<'a> {
List(AssignmentPatternList<'a>),
Structure(AssignmentPatternStructure<'a>),
@ -46,12 +46,12 @@ pub enum AssignmentPattern<'a> {
Repeat(AssignmentPatternRepeat<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AssignmentPatternList<'a> {
pub nodes: (ApostropheBrace<'a, List<Symbol<'a>, Expression<'a>>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AssignmentPatternStructure<'a> {
pub nodes: (
ApostropheBrace<
@ -61,14 +61,14 @@ pub struct AssignmentPatternStructure<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AssignmentPatternArray<'a> {
pub nodes: (
ApostropheBrace<'a, List<Symbol<'a>, (ArrayPatternKey<'a>, Symbol<'a>, Expression<'a>)>>,
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AssignmentPatternRepeat<'a> {
pub nodes: (
ApostropheBrace<
@ -81,25 +81,25 @@ pub struct AssignmentPatternRepeat<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum StructurePatternKey<'a> {
MemberIdentifier(MemberIdentifier<'a>),
AssignmentPatternKey(AssignmentPatternKey<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ArrayPatternKey<'a> {
ConstantExpression(ConstantExpression<'a>),
AssignmentPatternKey(AssignmentPatternKey<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum AssignmentPatternKey<'a> {
SimpleType(SimpleType<'a>),
Default(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AssignmentPatternExpression<'a> {
pub nodes: (
Option<AssignmentPatternExpressionType<'a>>,
@ -107,25 +107,25 @@ pub struct AssignmentPatternExpression<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum AssignmentPatternExpressionType<'a> {
PsTypeIdentifier(PsTypeIdentifier<'a>),
PsParameterIdentifier(PsParameterIdentifier<'a>),
IntegerAtomType(IntegerAtomType),
IntegerAtomType(IntegerAtomType<'a>),
TypeReference(TypeReference<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantAssignmentPatternExpression<'a> {
pub nodes: (AssignmentPatternExpression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AssignmentPatternNetLvalue<'a> {
pub nodes: (ApostropheBrace<'a, List<Symbol<'a>, NetLvalue<'a>>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AssignmentPatternVariableLvalue<'a> {
pub nodes: (ApostropheBrace<'a, List<Symbol<'a>, VariableLvalue<'a>>>,),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -5,17 +6,17 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InitialConstruct<'a> {
pub nodes: (Symbol<'a>, StatementOrNull<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AlwaysConstruct<'a> {
pub nodes: (AlwaysKeyword<'a>, Statement<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum AlwaysKeyword<'a> {
Always(Symbol<'a>),
AlwaysComb(Symbol<'a>),
@ -23,12 +24,12 @@ pub enum AlwaysKeyword<'a> {
AlwaysFf(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct FinalConstruct<'a> {
pub nodes: (Symbol<'a>, FunctionStatement<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum BlockingAssignment<'a> {
Variable(BlockingAssignmentVariable<'a>),
NonrangeVariable(BlockingAssignmentNonrangeVariable<'a>),
@ -36,7 +37,7 @@ pub enum BlockingAssignment<'a> {
OperatorAssignment(OperatorAssignment<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BlockingAssignmentVariable<'a> {
pub nodes: (
VariableLvalue<'a>,
@ -46,12 +47,12 @@ pub struct BlockingAssignmentVariable<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BlockingAssignmentNonrangeVariable<'a> {
pub nodes: (NonrangeVariableLvalue<'a>, Symbol<'a>, DynamicArrayNew<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BlockingAssignmentHierarchicalVariable<'a> {
pub nodes: (
Option<ImplicitClassHandleOrClassScopeOrPackageScope<'a>>,
@ -62,17 +63,17 @@ pub struct BlockingAssignmentHierarchicalVariable<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct OperatorAssignment<'a> {
pub nodes: (VariableLvalue<'a>, AssignmentOperator<'a>, Expression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AssignmentOperator<'a> {
pub nodes: (Symbol<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NonblockingAssignment<'a> {
pub nodes: (
VariableLvalue<'a>,
@ -82,7 +83,7 @@ pub struct NonblockingAssignment<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ProceduralContinuousAssignment<'a> {
Assign(ProceduralContinuousAssignmentAssign<'a>),
Deassign(ProceduralContinuousAssignmentDeassign<'a>),
@ -92,37 +93,37 @@ pub enum ProceduralContinuousAssignment<'a> {
ReleaseNet(ProceduralContinuousAssignmentReleaseNet<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProceduralContinuousAssignmentAssign<'a> {
pub nodes: (Symbol<'a>, VariableAssignment<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProceduralContinuousAssignmentDeassign<'a> {
pub nodes: (Symbol<'a>, VariableLvalue<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProceduralContinuousAssignmentForceVariable<'a> {
pub nodes: (Symbol<'a>, VariableAssignment<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProceduralContinuousAssignmentForceNet<'a> {
pub nodes: (Symbol<'a>, NetAssignment<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProceduralContinuousAssignmentReleaseVariable<'a> {
pub nodes: (Symbol<'a>, VariableLvalue<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProceduralContinuousAssignmentReleaseNet<'a> {
pub nodes: (Symbol<'a>, NetLvalue<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct VariableAssignment<'a> {
pub nodes: (VariableLvalue<'a>, Symbol<'a>, Expression<'a>),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -7,7 +8,7 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RandsequenceStatement<'a> {
pub nodes: (
Symbol<'a>,
@ -18,7 +19,7 @@ pub struct RandsequenceStatement<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct Production<'a> {
pub nodes: (
Option<DataTypeOrVoid<'a>>,
@ -30,7 +31,7 @@ pub struct Production<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RsRule<'a> {
pub nodes: (
RsProductionList<'a>,
@ -38,18 +39,18 @@ pub struct RsRule<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum RsProductionList<'a> {
Prod(RsProductionListProd<'a>),
Join(RsProductionListJoin<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RsProductionListProd<'a> {
pub nodes: (RsProd<'a>, Vec<RsProd<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RsProductionListJoin<'a> {
pub nodes: (
Symbol<'a>,
@ -61,24 +62,24 @@ pub struct RsProductionListJoin<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum WeightSpecification<'a> {
IntegralNumber(IntegralNumber<'a>),
PsIdentifier(PsIdentifier<'a>),
Expression(WeightSpecificationExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct WeightSpecificationExpression<'a> {
pub nodes: (Paren<'a, Expression<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RsCodeBlock<'a> {
pub nodes: (Brace<'a, (Vec<DataDeclaration<'a>>, Vec<StatementOrNull<'a>>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum RsProd<'a> {
ProductionItem(ProductionItem<'a>),
RsCodeBlock(RsCodeBlock<'a>),
@ -87,7 +88,7 @@ pub enum RsProd<'a> {
RsCase(RsCase<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProductionItem<'a> {
pub nodes: (
ProductionIdentifier<'a>,
@ -95,7 +96,7 @@ pub struct ProductionItem<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RsIfElse<'a> {
pub nodes: (
Symbol<'a>,
@ -105,12 +106,12 @@ pub struct RsIfElse<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RsRepeat<'a> {
pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, ProductionItem<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RsCase<'a> {
pub nodes: (
Symbol<'a>,
@ -121,13 +122,13 @@ pub struct RsCase<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum RsCaseItem<'a> {
NonDefault(RsCaseItemNondefault<'a>),
Default(RsCaseItemDefault<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RsCaseItemNondefault<'a> {
pub nodes: (
List<Symbol<'a>, CaseItemExpression<'a>>,
@ -137,7 +138,7 @@ pub struct RsCaseItemNondefault<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RsCaseItemDefault<'a> {
pub nodes: (
Symbol<'a>,

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -7,18 +8,18 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum StatementOrNull<'a> {
Statement(Statement<'a>),
Attribute(StatementOrNullAttribute<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct StatementOrNullAttribute<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct Statement<'a> {
pub nodes: (
Option<(BlockIdentifier<'a>, Symbol<'a>)>,
@ -27,7 +28,7 @@ pub struct Statement<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum StatementItem<'a> {
BlockingAssignment(Box<(BlockingAssignment<'a>, Symbol<'a>)>),
NonblockingAssignment(Box<(NonblockingAssignment<'a>, Symbol<'a>)>),
@ -51,23 +52,23 @@ pub enum StatementItem<'a> {
ExpectPropertyStatement(Box<ExpectPropertyStatement<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct FunctionStatement<'a> {
pub nodes: (Statement<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum FunctionStatementOrNull<'a> {
Statement(FunctionStatement<'a>),
Attribute(FunctionStatementOrNullAttribute<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct FunctionStatementOrNullAttribute<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct VariableIdentifierList<'a> {
pub nodes: (List<Symbol<'a>, VariableIdentifier<'a>>,),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -6,13 +7,13 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum SubroutineCallStatement<'a> {
SubroutineCall((SubroutineCall<'a>, Symbol<'a>)),
Function(SubroutineCallStatementFunction<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SubroutineCallStatementFunction<'a> {
pub nodes: (
Symbol<'a>,

View File

@ -7,24 +7,24 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProceduralTimingControlStatement<'a> {
pub nodes: (ProceduralTimingControl<'a>, StatementOrNull<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum DelayOrEventControl<'a> {
Delay(DelayControl<'a>),
Event(EventControl<'a>),
Repeat(DelayOrEventControlRepeat<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DelayOrEventControlRepeat<'a> {
pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, EventControl<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum DelayControl<'a> {
Delay(DelayControlDelay<'a>),
Mintypmax(DelayControlMintypmax<'a>),
@ -35,12 +35,12 @@ pub struct DelayControlDelay<'a> {
pub nodes: (Symbol<'a>, DelayValue<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DelayControlMintypmax<'a> {
pub nodes: (Symbol<'a>, Paren<'a, MintypmaxExpression<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum EventControl<'a> {
EventIdentifier(EventControlEventIdentifier<'a>),
EventExpression(EventControlEventExpression<'a>),
@ -49,12 +49,12 @@ pub enum EventControl<'a> {
SequenceIdentifier(EventControlSequenceIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EventControlEventIdentifier<'a> {
pub nodes: (Symbol<'a>, HierarchicalEventIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EventControlEventExpression<'a> {
pub nodes: (Symbol<'a>, Paren<'a, EventExpression<'a>>),
}
@ -69,12 +69,12 @@ pub struct EventControlParenAsterisk<'a> {
pub nodes: (Symbol<'a>, Paren<'a, Symbol<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EventControlSequenceIdentifier<'a> {
pub nodes: (Symbol<'a>, PsOrHierarchicalSequenceIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum EventExpression<'a> {
Expression(Box<EventExpressionExpression<'a>>),
Sequence(Box<EventExpressionSequence<'a>>),
@ -83,7 +83,7 @@ pub enum EventExpression<'a> {
Paren(Box<EventExpressionParen<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EventExpressionExpression<'a> {
pub nodes: (
Option<EdgeIdentifier<'a>>,
@ -92,41 +92,41 @@ pub struct EventExpressionExpression<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EventExpressionSequence<'a> {
pub nodes: (SequenceInstance<'a>, Option<(Symbol<'a>, Expression<'a>)>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EventExpressionOr<'a> {
pub nodes: (EventExpression<'a>, Symbol<'a>, EventExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EventExpressionComma<'a> {
pub nodes: (EventExpression<'a>, Symbol<'a>, EventExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EventExpressionParen<'a> {
pub nodes: (Paren<'a, EventExpression<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ProceduralTimingControl<'a> {
DelayControl(DelayControl<'a>),
EventControl(EventControl<'a>),
CycleDelay(CycleDelay<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum JumpStatement<'a> {
Return(JumpStatementReturn<'a>),
Break(JumpStatementBreak<'a>),
Continue(JumpStatementContinue<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct JumpStatementReturn<'a> {
pub nodes: (Symbol<'a>, Option<Expression<'a>>, Symbol<'a>),
}
@ -141,14 +141,14 @@ pub struct JumpStatementContinue<'a> {
pub nodes: (Symbol<'a>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum WaitStatement<'a> {
Wait(WaitStatementWait<'a>),
Fork(WaitStatementFork<'a>),
Order(WaitStatementOrder<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct WaitStatementWait<'a> {
pub nodes: (Symbol<'a>, Paren<'a, Expression<'a>>, StatementOrNull<'a>),
}
@ -158,7 +158,7 @@ pub struct WaitStatementFork<'a> {
pub nodes: (Symbol<'a>, Symbol<'a>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct WaitStatementOrder<'a> {
pub nodes: (
Symbol<'a>,
@ -167,18 +167,18 @@ pub struct WaitStatementOrder<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum EventTrigger<'a> {
Named(EventTriggerNamed<'a>),
Nonblocking(EventTriggerNonblocking<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EventTriggerNamed<'a> {
pub nodes: (Symbol<'a>, HierarchicalEventIdentifier<'a>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EventTriggerNonblocking<'a> {
pub nodes: (
Symbol<'a>,
@ -188,19 +188,19 @@ pub struct EventTriggerNonblocking<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum DisableStatement<'a> {
Task(DisableStatementTask<'a>),
Block(DisableStatementBlock<'a>),
Fork(DisableStatementFork<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DisableStatementTask<'a> {
pub nodes: (Symbol<'a>, HierarchicalTaskIdentifier<'a>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DisableStatementBlock<'a> {
pub nodes: (Symbol<'a>, HierarchicalBlockIdentifier<'a>, Symbol<'a>),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,18 +7,18 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConcurrentAssertionItem<'a> {
Statement(ConcurrentAssertionItemStatement<'a>),
CheckerInstantiation(CheckerInstantiation<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConcurrentAssertionItemStatement<'a> {
pub nodes: (Identifier<'a>, ConcurrentAssertionStatement<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConcurrentAssertionStatement<'a> {
AssertProperty(AssertPropertyStatement<'a>),
AssumeProperty(AssumePropertyStatement<'a>),
@ -26,27 +27,27 @@ pub enum ConcurrentAssertionStatement<'a> {
RestrictProperty(RestrictPropertyStatement<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AssertPropertyStatement<'a> {
pub nodes: (PropertySpec<'a>, ActionBlock<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AssumePropertyStatement<'a> {
pub nodes: (PropertySpec<'a>, ActionBlock<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CoverPropertyStatement<'a> {
pub nodes: (PropertySpec<'a>, StatementOrNull<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ExpectPropertyStatement<'a> {
pub nodes: (PropertySpec<'a>, ActionBlock<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CoverSequenceStatement<'a> {
pub nodes: (
Option<ClockingEvent<'a>>,
@ -56,23 +57,23 @@ pub struct CoverSequenceStatement<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RestrictPropertyStatement<'a> {
pub nodes: (PropertySpec<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyInstance<'a> {
pub nodes: (Identifier<'a>, Option<PropertyListOfArguments<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PropertyListOfArguments<'a> {
Ordered(PropertyListOfArgumentsOrdered<'a>),
Named(PropertyListOfArgumentsNamed<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyListOfArgumentsOrdered<'a> {
pub nodes: (
Vec<PropertyActualArg<'a>>,
@ -80,25 +81,25 @@ pub struct PropertyListOfArgumentsOrdered<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyListOfArgumentsNamed<'a> {
pub nodes: (Vec<(Identifier<'a>, Option<PropertyActualArg<'a>>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PropertyActualArg<'a> {
PropertyExpr(PropertyExpr<'a>),
SequenceActualArg(SequenceActualArg<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum AssertionItemDeclaration<'a> {
PropertyDeclaration(PropertyDeclaration<'a>),
SequenceDeclaration(SequenceDeclaration<'a>),
LetDeclaration(LetDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyDeclaration<'a> {
pub nodes: (
Identifier<'a>,
@ -108,16 +109,16 @@ pub struct PropertyDeclaration<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyPortList<'a> {
pub nodes: (Vec<PropertyPortItem<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyPortItem<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
Option<PropertyLvarPortDirection>,
Option<PropertyLvarPortDirection<'a>>,
PropertyFormalType<'a>,
Identifier<'a>,
Vec<VariableDimension<'a>>,
@ -125,18 +126,18 @@ pub struct PropertyPortItem<'a> {
),
}
#[derive(Debug)]
pub enum PropertyLvarPortDirection {
Input,
#[derive(Debug, Node)]
pub enum PropertyLvarPortDirection<'a> {
Input(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PropertyFormalType<'a> {
SequenceFormalType(SequenceFormalType<'a>),
Property,
Property(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertySpec<'a> {
pub nodes: (
Option<ClockingEvent<'a>>,
@ -145,7 +146,7 @@ pub struct PropertySpec<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PropertyExpr<'a> {
SequenceExpr(SequenceExpr<'a>),
Strong(PropertyExprStrong<'a>),
@ -180,47 +181,47 @@ pub enum PropertyExpr<'a> {
ClockingEvent(Box<PropertyExprClockingEvent<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprStrong<'a> {
pub nodes: (SequenceExpr<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprWeak<'a> {
pub nodes: (SequenceExpr<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprParen<'a> {
pub nodes: (PropertyExpr<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprNot<'a> {
pub nodes: (PropertyExpr<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprOr<'a> {
pub nodes: (PropertyExpr<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprAnd<'a> {
pub nodes: (PropertyExpr<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprImplicationOverlapped<'a> {
pub nodes: (SequenceExpr<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprImplicationNonoverlapped<'a> {
pub nodes: (SequenceExpr<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprIf<'a> {
pub nodes: (
ExpressionOrDist<'a>,
@ -229,123 +230,123 @@ pub struct PropertyExprIf<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprCase<'a> {
pub nodes: (ExpressionOrDist<'a>, Vec<PropertyCaseItem<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprFollowedByOverlapped<'a> {
pub nodes: (SequenceExpr<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprFollowedByNonoverlapped<'a> {
pub nodes: (SequenceExpr<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprNexttime<'a> {
pub nodes: (Option<ConstantExpression<'a>>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprSNexttime<'a> {
pub nodes: (Option<ConstantExpression<'a>>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprAlways<'a> {
pub nodes: (Option<CycleDelayConstRangeExpression<'a>>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprSAlways<'a> {
pub nodes: (Option<CycleDelayConstRangeExpression<'a>>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprEventually<'a> {
pub nodes: (ConstantRange<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprSEventually<'a> {
pub nodes: (Option<CycleDelayConstRangeExpression<'a>>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprUntil<'a> {
pub nodes: (PropertyExpr<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprSUntil<'a> {
pub nodes: (PropertyExpr<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprUntilWith<'a> {
pub nodes: (PropertyExpr<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprSUntilWith<'a> {
pub nodes: (PropertyExpr<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprImplies<'a> {
pub nodes: (PropertyExpr<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprIff<'a> {
pub nodes: (PropertyExpr<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprAcceptOn<'a> {
pub nodes: (ExpressionOrDist<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprRejectOn<'a> {
pub nodes: (ExpressionOrDist<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprSyncAcceptOn<'a> {
pub nodes: (ExpressionOrDist<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprSyncRejectOn<'a> {
pub nodes: (ExpressionOrDist<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyExprClockingEvent<'a> {
pub nodes: (ClockingEvent<'a>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PropertyCaseItem<'a> {
Nondefault(PropertyCaseItemNondefault<'a>),
Default(PropertyCaseItemDefault<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyCaseItemNondefault<'a> {
pub nodes: (Vec<ExpressionOrDist<'a>>, PropertyExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PropertyCaseItemDefault<'a> {
pub nodes: (PropertyExpr<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceDeclaration<'a> {
pub nodes: (
Identifier<'a>,
@ -356,16 +357,16 @@ pub struct SequenceDeclaration<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequencePortList<'a> {
pub nodes: (Vec<SequencePortItem<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequencePortItem<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
Option<SequenceLvarPortDirection>,
Option<SequenceLvarPortDirection<'a>>,
SequenceFormalType<'a>,
Identifier<'a>,
Vec<VariableDimension<'a>>,
@ -373,21 +374,21 @@ pub struct SequencePortItem<'a> {
),
}
#[derive(Debug)]
pub enum SequenceLvarPortDirection {
Input,
Inout,
Output,
#[derive(Debug, Node)]
pub enum SequenceLvarPortDirection<'a> {
Input(Symbol<'a>),
Inout(Symbol<'a>),
Output(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum SequenceFormalType<'a> {
DataTypeOrImplicit(DataTypeOrImplicit<'a>),
Sequence,
Untyped,
Sequence(Symbol<'a>),
Untyped(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum SequenceExpr<'a> {
CycleDelayExpr(SequenceExprCycleDelayExpr<'a>),
ExprCycleDelayExpr(Box<SequenceExprExprCycleDelayExpr<'a>>),
@ -403,12 +404,12 @@ pub enum SequenceExpr<'a> {
ClockingEvent(Box<SequenceExprClockingEvent<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceExprCycleDelayExpr<'a> {
pub nodes: (Vec<(CycleDelayRange<'a>, SequenceExpr<'a>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceExprExprCycleDelayExpr<'a> {
pub nodes: (
SequenceExpr<'a>,
@ -416,17 +417,17 @@ pub struct SequenceExprExprCycleDelayExpr<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceExprExpression<'a> {
pub nodes: (ExpressionOrDist<'a>, Option<BooleanAbbrev<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceExprInstance<'a> {
pub nodes: (SequenceInstance<'a>, Option<SequenceAbbrev<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceExprParen<'a> {
pub nodes: (
SequenceExpr<'a>,
@ -435,73 +436,73 @@ pub struct SequenceExprParen<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceExprAnd<'a> {
pub nodes: (SequenceExpr<'a>, SequenceExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceExprIntersect<'a> {
pub nodes: (SequenceExpr<'a>, SequenceExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceExprOr<'a> {
pub nodes: (SequenceExpr<'a>, SequenceExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceExprFirstMatch<'a> {
pub nodes: (SequenceExpr<'a>, Vec<SequenceMatchItem<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceExprThroughout<'a> {
pub nodes: (ExpressionOrDist<'a>, SequenceExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceExprWithin<'a> {
pub nodes: (SequenceExpr<'a>, SequenceExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceExprClockingEvent<'a> {
pub nodes: (ClockingEvent<'a>, SequenceExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CycleDelayRange<'a> {
ConstantPrimary(ConstantPrimary<'a>),
CycleDelayConstRangeExpression(CycleDelayConstRangeExpression<'a>),
Asterisk,
Plus,
Asterisk(Symbol<'a>),
Plus(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceMethodCall<'a> {
pub nodes: (SequenceInstance<'a>, Identifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum SequenceMatchItem<'a> {
OperatorAssignment(OperatorAssignment<'a>),
IncOrDecExpression(IncOrDecExpression<'a>),
SubroutineCall(SubroutineCall<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceInstance<'a> {
pub nodes: (Identifier<'a>, Option<SequenceListOfArguments<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum SequenceListOfArguments<'a> {
Ordered(SequenceListOfArgumentsOrdered<'a>),
Named(SequenceListOfArgumentsNamed<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceListOfArgumentsOrdered<'a> {
pub nodes: (
Vec<SequenceActualArg<'a>>,
@ -509,74 +510,74 @@ pub struct SequenceListOfArgumentsOrdered<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceListOfArgumentsNamed<'a> {
pub nodes: (Vec<(Identifier<'a>, Option<SequenceActualArg<'a>>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum SequenceActualArg<'a> {
EventExpression(EventExpression<'a>),
SequenceExpr(SequenceExpr<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum BooleanAbbrev<'a> {
ConsecutiveRepetition(ConsecutiveRepetition<'a>),
NonConsecutiveRepetition(NonConsecutiveRepetition<'a>),
GotoRepetition(GotoRepetition<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SequenceAbbrev<'a> {
pub nodes: (ConsecutiveRepetition<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConsecutiveRepetition<'a> {
ConstOrRangeExpression(ConstOrRangeExpression<'a>),
Asterisk,
Plus,
Asterisk(Symbol<'a>),
Plus(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NonConsecutiveRepetition<'a> {
pub nodes: (ConstOrRangeExpression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct GotoRepetition<'a> {
pub nodes: (ConstOrRangeExpression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConstOrRangeExpression<'a> {
ConstantExpression(ConstantExpression<'a>),
CycleDelayConstRangeExpression(CycleDelayConstRangeExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CycleDelayConstRangeExpression<'a> {
Binary(CycleDelayConstRangeExpressionBinary<'a>),
Dollar(CycleDelayConstRangeExpressionDollar<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CycleDelayConstRangeExpressionBinary<'a> {
pub nodes: (ConstantExpression<'a>, ConstantExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CycleDelayConstRangeExpressionDollar<'a> {
pub nodes: (ConstantExpression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ExpressionOrDist<'a> {
pub nodes: (Expression<'a>, Option<DistList<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AssertionVariableDeclaration<'a> {
pub nodes: (VarDataType<'a>, ListOfVariableDeclAssignments<'a>),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::multi::*;
@ -5,7 +6,7 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum BlockItemDeclaration<'a> {
Data(BlockItemDeclarationData<'a>),
LocalParameter(BlockItemDeclarationLocalParameter<'a>),
@ -13,12 +14,12 @@ pub enum BlockItemDeclaration<'a> {
Let(BlockItemDeclarationLet<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BlockItemDeclarationData<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, DataDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BlockItemDeclarationLocalParameter<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -27,7 +28,7 @@ pub struct BlockItemDeclarationLocalParameter<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BlockItemDeclarationParameter<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -36,7 +37,7 @@ pub struct BlockItemDeclarationParameter<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BlockItemDeclarationLet<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, LetDeclaration<'a>),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,7 +7,7 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CovergroupDeclaration<'a> {
pub nodes: (
Identifier<'a>,
@ -17,91 +18,91 @@ pub struct CovergroupDeclaration<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CoverageSpecOrOption<'a> {
Spec(CoverageSpecOrOptionSpec<'a>),
Option(CoverageSpecOrOptionOption<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CoverageSpecOrOptionSpec<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, CoverageSpec<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CoverageSpecOrOptionOption<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, CoverageOption<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CoverageOption<'a> {
Option(CoverageOptionOption<'a>),
TypeOption(CoverageOptionTypeOption<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CoverageOptionOption<'a> {
pub nodes: (Identifier<'a>, Expression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CoverageOptionTypeOption<'a> {
pub nodes: (Identifier<'a>, ConstantExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CoverageSpec<'a> {
CoverPoint(CoverPoint<'a>),
CoverCross(CoverCross<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CoverageEvent<'a> {
ClockingEvent(ClockingEvent<'a>),
Sample(CoverageEventSample<'a>),
At(CoverageEventAt<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CoverageEventSample<'a> {
pub nodes: (Option<TfPortList<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CoverageEventAt<'a> {
pub nodes: (BlockEventExpression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum BlockEventExpression<'a> {
Or(Box<BlockEventExpressionOr<'a>>),
Begin(BlockEventExpressionBegin<'a>),
End(BlockEventExpressionEnd<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BlockEventExpressionOr<'a> {
pub nodes: (BlockEventExpression<'a>, BlockEventExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BlockEventExpressionBegin<'a> {
pub nodes: (HierarchicalBtfIdentifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BlockEventExpressionEnd<'a> {
pub nodes: (HierarchicalBtfIdentifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum HierarchicalBtfIdentifier<'a> {
Tf(Identifier<'a>),
Block(Identifier<'a>),
Method(HierarchicalBtfIdentifierMethod<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct HierarchicalBtfIdentifierMethod<'a> {
pub nodes: (
Option<HierarchicalIdentifierOrClassScope<'a>>,
@ -109,13 +110,13 @@ pub struct HierarchicalBtfIdentifierMethod<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum HierarchicalIdentifierOrClassScope<'a> {
HierarchicalIdentifier(HierarchicalIdentifier<'a>),
ClassScope(ClassScope<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CoverPoint<'a> {
pub nodes: (
Option<(Option<DataTypeOrImplicit<'a>>, Identifier<'a>)>,
@ -125,18 +126,18 @@ pub struct CoverPoint<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum BinsOrEmpty<'a> {
NonEmpty(BinsOrEmptyNonEmpty<'a>),
Empty,
Empty(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BinsOrEmptyNonEmpty<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, Vec<BinsOrOptions<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum BinsOrOptions<'a> {
Option(CoverageOption<'a>),
Covergroup(BinsOrOptionsCovergroup<'a>),
@ -147,11 +148,11 @@ pub enum BinsOrOptions<'a> {
DefaultSequence(BinsOrOptionsDefaultSequence<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BinsOrOptionsCovergroup<'a> {
pub nodes: (
Option<Wildcard>,
BinsKeyword,
Option<Wildcard<'a>>,
BinsKeyword<'a>,
Identifier<'a>,
Option<CovergroupExpression<'a>>,
CovergroupRangeList<'a>,
@ -160,14 +161,16 @@ pub struct BinsOrOptionsCovergroup<'a> {
),
}
#[derive(Debug)]
pub struct Wildcard {}
#[derive(Debug, Node)]
pub struct Wildcard<'a> {
pub nodes: (Symbol<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BinsOrOptionsCoverPoint<'a> {
pub nodes: (
Option<Wildcard>,
BinsKeyword,
Option<Wildcard<'a>>,
BinsKeyword<'a>,
Identifier<'a>,
Option<CovergroupExpression<'a>>,
Identifier<'a>,
@ -176,11 +179,11 @@ pub struct BinsOrOptionsCoverPoint<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BinsOrOptionsSetCovergroup<'a> {
pub nodes: (
Option<Wildcard>,
BinsKeyword,
Option<Wildcard<'a>>,
BinsKeyword<'a>,
Identifier<'a>,
Option<CovergroupExpression<'a>>,
SetCovergroupExpression<'a>,
@ -188,50 +191,50 @@ pub struct BinsOrOptionsSetCovergroup<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BinsOrOptionsTransList<'a> {
pub nodes: (
Option<Wildcard>,
BinsKeyword,
Option<Wildcard<'a>>,
BinsKeyword<'a>,
Identifier<'a>,
TransList<'a>,
Option<Expression<'a>>,
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BinsOrOptionsDefault<'a> {
pub nodes: (
BinsKeyword,
BinsKeyword<'a>,
Identifier<'a>,
Option<CovergroupExpression<'a>>,
Option<Expression<'a>>,
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BinsOrOptionsDefaultSequence<'a> {
pub nodes: (BinsKeyword, Identifier<'a>, Option<Expression<'a>>),
pub nodes: (BinsKeyword<'a>, Identifier<'a>, Option<Expression<'a>>),
}
#[derive(Debug)]
pub enum BinsKeyword {
Bins,
IllegalBins,
IgnoreBins,
#[derive(Debug, Node)]
pub enum BinsKeyword<'a> {
Bins(Symbol<'a>),
IllegalBins(Symbol<'a>),
IgnoreBins(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TransList<'a> {
pub nodes: (Vec<TransSet<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TransSet<'a> {
pub nodes: (TransRangeList<'a>, Vec<TransRangeList<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum TransRangeList<'a> {
Single(TransItem<'a>),
Asterisk(TransRangeListAsterisk<'a>),
@ -239,38 +242,38 @@ pub enum TransRangeList<'a> {
Equal(TransRangeListEqual<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TransRangeListAsterisk<'a> {
pub nodes: (TransItem<'a>, RepeatRange<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TransRangeListRight<'a> {
pub nodes: (TransItem<'a>, RepeatRange<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TransRangeListEqual<'a> {
pub nodes: (TransItem<'a>, RepeatRange<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TransItem<'a> {
pub nodes: (CovergroupRangeList<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum RepeatRange<'a> {
Single(CovergroupExpression<'a>),
Binary(RepeatRangeBinary<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RepeatRangeBinary<'a> {
pub nodes: (CovergroupExpression<'a>, CovergroupExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CoverCross<'a> {
pub nodes: (
Option<Identifier<'a>>,
@ -280,61 +283,61 @@ pub struct CoverCross<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfCrossItems<'a> {
pub nodes: (CrossItem<'a>, CrossItem<'a>, Option<CrossItem<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CrossItem<'a> {
CoverPointIdentifier(Identifier<'a>),
VariableIdentifier(Identifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CrossBody<'a> {
NonEmpty(CrossBodyNonEmpty<'a>),
Empty,
Empty(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CrossBodyNonEmpty<'a> {
pub nodes: (Vec<CrossBodyItem<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CrossBodyItem<'a> {
FunctionDeclaration(FunctionDeclaration<'a>),
BinsSelectionOrOption(BinsSelectionOrOption<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum BinsSelectionOrOption<'a> {
Coverage(BinsSelectionOrOptionCoverage<'a>),
Bins(BinsSelectionOrOptionBins<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BinsSelectionOrOptionCoverage<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, CoverageOption<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BinsSelectionOrOptionBins<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, BinsSelection<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BinsSelection<'a> {
pub nodes: (
BinsKeyword,
BinsKeyword<'a>,
Identifier<'a>,
SelectExpression<'a>,
Option<Expression<'a>>,
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum SelectExpression<'a> {
SelectCondition(SelectCondition<'a>),
Not(SelectExpressionNot<'a>),
@ -346,27 +349,27 @@ pub enum SelectExpression<'a> {
CrossSet(SelectExpressionCrossSet<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SelectExpressionNot<'a> {
pub nodes: (SelectCondition<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SelectExpressionAnd<'a> {
pub nodes: (SelectExpression<'a>, SelectExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SelectExpressionOr<'a> {
pub nodes: (SelectExpression<'a>, SelectExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SelectExpressionParen<'a> {
pub nodes: (SelectExpression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SelectExpressionWith<'a> {
pub nodes: (
SelectExpression<'a>,
@ -375,7 +378,7 @@ pub struct SelectExpressionWith<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SelectExpressionCrossSet<'a> {
pub nodes: (
CrossSetExpression<'a>,
@ -383,59 +386,59 @@ pub struct SelectExpressionCrossSet<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SelectCondition<'a> {
pub nodes: (BinsExpression<'a>, Option<CovergroupRangeList<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum BinsExpression<'a> {
VariableIdentifier(Identifier<'a>),
CoverPoint(BinsExpressionCoverPoint<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BinsExpressionCoverPoint<'a> {
pub nodes: (Identifier<'a>, Option<Identifier<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CovergroupRangeList<'a> {
pub nodes: (Vec<CovergroupValueRange<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CovergroupValueRange<'a> {
Single(CovergroupExpression<'a>),
Binary(CovergroupValueRangeBinary<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CovergroupValueRangeBinary<'a> {
pub nodes: (CovergroupExpression<'a>, CovergroupExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct WithCovergroupExpression<'a> {
pub nodes: (CovergroupExpression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SetCovergroupExpression<'a> {
pub nodes: (CovergroupExpression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct IntegerCovergroupExpression<'a> {
pub nodes: (CovergroupExpression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CrossSetExpression<'a> {
pub nodes: (CovergroupExpression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CovergroupExpression<'a> {
pub nodes: (Expression<'a>,),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,17 +7,17 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DefparamAssignment<'a> {
pub nodes: (HierarchicalIdentifier<'a>, ConstantMintypmaxExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NetDeclAssignment<'a> {
pub nodes: (Identifier<'a>, Vec<UnpackedDimension<'a>>, Expression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ParamAssignment<'a> {
pub nodes: (
Identifier<'a>,
@ -25,23 +26,23 @@ pub struct ParamAssignment<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum SpecparamAssignment<'a> {
Mintypmax(SpecparamAssignmentMintypmax<'a>),
PulseControl(PulseControlSpecparam<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SpecparamAssignmentMintypmax<'a> {
pub nodes: (Identifier<'a>, ConstantMintypmaxExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TypeAssignment<'a> {
pub nodes: (Identifier<'a>, Option<DataType<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PulseControlSpecparam<'a> {
pub nodes: (
Option<(
@ -53,29 +54,29 @@ pub struct PulseControlSpecparam<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ErrorLimitValue<'a> {
pub nodes: (LimitValue<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RejectLimitValue<'a> {
pub nodes: (LimitValue<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LimitValue<'a> {
pub nodes: (ConstantMintypmaxExpression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum VariableDeclAssignment<'a> {
Variable(VariableDeclAssignmentVariable<'a>),
DynamicArray(VariableDeclAssignmentDynamicArray<'a>),
Class(VariableDeclAssignmentClass<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct VariableDeclAssignmentVariable<'a> {
pub nodes: (
Identifier<'a>,
@ -84,33 +85,33 @@ pub struct VariableDeclAssignmentVariable<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct VariableDeclAssignmentDynamicArray<'a> {
pub nodes: (
Identifier<'a>,
UnsizedDimension,
UnsizedDimension<'a>,
Vec<VariableDimension<'a>>,
Option<DynamicArrayNew<'a>>,
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct VariableDeclAssignmentClass<'a> {
pub nodes: (Identifier<'a>, Option<ClassNew<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ClassNew<'a> {
Argument(ClassNewArgument<'a>),
Expression(Expression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassNewArgument<'a> {
pub nodes: (Option<ClassScope<'a>>, Option<ListOfArguments<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DynamicArrayNew<'a> {
pub nodes: (Expression<'a>, Option<Expression<'a>>),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,47 +7,47 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfDefparamAssignments<'a> {
pub nodes: (Vec<DefparamAssignment<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfGenvarIdentifiers<'a> {
pub nodes: (Vec<Identifier<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfInterfaceIdentifiers<'a> {
pub nodes: (Vec<(Identifier<'a>, Vec<UnpackedDimension<'a>>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfNetDeclAssignments<'a> {
pub nodes: (Vec<NetDeclAssignment<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfParamAssignments<'a> {
pub nodes: (Vec<ParamAssignment<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfPortIdentifiers<'a> {
pub nodes: (Vec<(Identifier<'a>, Vec<UnpackedDimension<'a>>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfUdpPortIdentifiers<'a> {
pub nodes: (Vec<Identifier<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfSpecparamAssignments<'a> {
pub nodes: (Vec<SpecparamAssignment<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfTfVariableIdentifiers<'a> {
pub nodes: (
Vec<(
@ -57,22 +58,22 @@ pub struct ListOfTfVariableIdentifiers<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfTypeAssignments<'a> {
pub nodes: (Vec<TypeAssignment<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfVariableDeclAssignments<'a> {
pub nodes: (Vec<VariableDeclAssignment<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfVariableIdentifiers<'a> {
pub nodes: (Vec<(Identifier<'a>, Vec<VariableDimension<'a>>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfVariablePortIdentifiers<'a> {
pub nodes: (
Vec<(

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,40 +7,40 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum UnpackedDimension<'a> {
Range(ConstantRange<'a>),
Expression(ConstantExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PackedDimension<'a> {
Range(ConstantRange<'a>),
Unsized(UnsizedDimension),
Unsized(UnsizedDimension<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum AssociativeDimension<'a> {
DataType(DataType<'a>),
Asterisk,
Asterisk(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum VariableDimension<'a> {
Unsized(UnsizedDimension),
Unsized(UnsizedDimension<'a>),
Unpacked(UnpackedDimension<'a>),
Associative(AssociativeDimension<'a>),
Queue(QueueDimension<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct QueueDimension<'a> {
pub nodes: (Option<ConstantExpression<'a>>,),
}
#[derive(Debug)]
pub struct UnsizedDimension {
pub nodes: (),
#[derive(Debug, Node)]
pub struct UnsizedDimension<'a> {
pub nodes: (Symbol<'a>,),
}
// -----------------------------------------------------------------------------

View File

@ -7,7 +7,7 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum Delay3<'a> {
Single(Delay3Single<'a>),
Mintypmax(Delay3Mintypmax<'a>),
@ -18,7 +18,7 @@ pub struct Delay3Single<'a> {
pub nodes: (Symbol<'a>, DelayValue<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct Delay3Mintypmax<'a> {
pub nodes: (
Symbol<'a>,
@ -36,7 +36,7 @@ pub struct Delay3Mintypmax<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum Delay2<'a> {
Single(Delay2Single<'a>),
Mintypmax(Delay2Mintypmax<'a>),
@ -47,7 +47,7 @@ pub struct Delay2Single<'a> {
pub nodes: (Symbol<'a>, DelayValue<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct Delay2Mintypmax<'a> {
pub nodes: (
Symbol<'a>,

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,24 +7,24 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum FunctionDataTypeOrImplicit<'a> {
DataType(DataTypeOrVoid<'a>),
Implicit(ImplicitDataType<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct FunctionDeclaration<'a> {
pub nodes: (Option<Lifetime<'a>>, FunctionBodyDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum FunctionBodyDeclaration<'a> {
WithoutPort(FunctionBodyDeclarationWithoutPort<'a>),
WithPort(FunctionBodyDeclarationWithPort<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct FunctionBodyDeclarationWithoutPort<'a> {
pub nodes: (
FunctionDataTypeOrImplicit<'a>,
@ -35,7 +36,7 @@ pub struct FunctionBodyDeclarationWithoutPort<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct FunctionBodyDeclarationWithPort<'a> {
pub nodes: (
FunctionDataTypeOrImplicit<'a>,
@ -48,12 +49,12 @@ pub struct FunctionBodyDeclarationWithPort<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct FunctionPrototype<'a> {
pub nodes: (DataTypeOrVoid<'a>, Identifier<'a>, Option<TfPortList<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum DpiImportExport<'a> {
ImportFunction(DpiImportExportImportFunction<'a>),
ImportTask(DpiImportExportImportTask<'a>),
@ -61,59 +62,59 @@ pub enum DpiImportExport<'a> {
ExportTask(DpiImportExportExportTask<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DpiImportExportImportFunction<'a> {
pub nodes: (
DpiSpecString,
Option<DpiFunctionImportProperty>,
DpiSpecString<'a>,
Option<DpiFunctionImportProperty<'a>>,
Option<Identifier<'a>>,
DpiFunctionProto<'a>,
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DpiImportExportImportTask<'a> {
pub nodes: (
DpiSpecString,
Option<DpiTaskImportProperty>,
DpiSpecString<'a>,
Option<DpiTaskImportProperty<'a>>,
Option<Identifier<'a>>,
DpiTaskProto<'a>,
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DpiImportExportExportFunction<'a> {
pub nodes: (DpiSpecString, Option<Identifier<'a>>, Identifier<'a>),
pub nodes: (DpiSpecString<'a>, Option<Identifier<'a>>, Identifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DpiImportExportExportTask<'a> {
pub nodes: (DpiSpecString, Option<Identifier<'a>>, Identifier<'a>),
pub nodes: (DpiSpecString<'a>, Option<Identifier<'a>>, Identifier<'a>),
}
#[derive(Debug)]
pub enum DpiSpecString {
DpiC,
Dpi,
#[derive(Debug, Node)]
pub enum DpiSpecString<'a> {
DpiC(Symbol<'a>),
Dpi(Symbol<'a>),
}
#[derive(Debug)]
pub enum DpiFunctionImportProperty {
Context,
Pure,
#[derive(Debug, Node)]
pub enum DpiFunctionImportProperty<'a> {
Context(Symbol<'a>),
Pure(Symbol<'a>),
}
#[derive(Debug)]
pub enum DpiTaskImportProperty {
Context,
#[derive(Debug, Node)]
pub enum DpiTaskImportProperty<'a> {
Context(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DpiFunctionProto<'a> {
pub nodes: (FunctionPrototype<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DpiTaskProto<'a> {
pub nodes: (TaskPrototype<'a>,),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,24 +7,24 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModportDeclaration<'a> {
pub nodes: (Vec<ModportItem<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModportItem<'a> {
pub nodes: (Identifier<'a>, Vec<ModportPortsDeclaraton<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ModportPortsDeclaraton<'a> {
Simple(ModportPortsDeclaratonSimple<'a>),
Tf(ModportPortsDeclaratonTf<'a>),
Clocing(ModportPortsDeclaratonClocking<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModportPortsDeclaratonSimple<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -31,57 +32,57 @@ pub struct ModportPortsDeclaratonSimple<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModportPortsDeclaratonTf<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, ModportTfPortsDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModportPortsDeclaratonClocking<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, ModportClockingDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModportClockingDeclaration<'a> {
pub nodes: (Identifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModportSimplePortsDeclaration<'a> {
pub nodes: (PortDirection, Vec<ModportSimplePort<'a>>),
pub nodes: (PortDirection<'a>, Vec<ModportSimplePort<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ModportSimplePort<'a> {
Ordered(ModportSimplePortOrdered<'a>),
Named(ModportSimplePortNamed<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModportSimplePortOrdered<'a> {
pub nodes: (Identifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModportSimplePortNamed<'a> {
pub nodes: (Identifier<'a>, Option<Expression<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModportTfPortsDeclaration<'a> {
pub nodes: (ImportExport, Vec<ModportTfPort<'a>>),
pub nodes: (ImportExport<'a>, Vec<ModportTfPort<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ModportTfPort<'a> {
Prototype(MethodPrototype<'a>),
Identifier(Identifier<'a>),
}
#[derive(Debug)]
pub enum ImportExport {
Import,
Export,
#[derive(Debug, Node)]
pub enum ImportExport<'a> {
Import(Symbol<'a>),
Export(Symbol<'a>),
}
// -----------------------------------------------------------------------------

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,22 +7,22 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LetDeclaration<'a> {
pub nodes: (LetIdentifier<'a>, Option<LetPortList<'a>>, Expression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LetIdentifier<'a> {
pub nodes: (Identifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LetPortList<'a> {
pub nodes: (Vec<LetPortItem<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LetPortItem<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -32,13 +33,13 @@ pub struct LetPortItem<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum LetFormalType<'a> {
DataTypeOrImplicit(DataTypeOrImplicit<'a>),
Untyped,
Untyped(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LetExpression<'a> {
pub nodes: (
Option<PackageScope<'a>>,
@ -47,13 +48,13 @@ pub struct LetExpression<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum LetListOfArguments<'a> {
Ordered(LetListOfArgumentsOrdered<'a>),
Named(LetListOfArgumentsNamed<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LetListOfArgumentsOrdered<'a> {
pub nodes: (
Vec<LetActualArg<'a>>,
@ -61,12 +62,12 @@ pub struct LetListOfArgumentsOrdered<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LetListOfArgumentsNamed<'a> {
pub nodes: (Vec<(Identifier<'a>, LetActualArg<'a>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LetActualArg<'a> {
pub nodes: (Expression<'a>,),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -5,13 +6,13 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum LocalParameterDeclaration<'a> {
Param(LocalParameterDeclarationParam<'a>),
Type(LocalParameterDeclarationType<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LocalParameterDeclarationParam<'a> {
pub nodes: (
Symbol<'a>,
@ -20,18 +21,18 @@ pub struct LocalParameterDeclarationParam<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LocalParameterDeclarationType<'a> {
pub nodes: (Symbol<'a>, Symbol<'a>, ListOfTypeAssignments<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ParameterDeclaration<'a> {
Param(ParameterDeclarationParam<'a>),
Type(ParameterDeclarationType<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ParameterDeclarationParam<'a> {
pub nodes: (
Symbol<'a>,
@ -40,12 +41,12 @@ pub struct ParameterDeclarationParam<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ParameterDeclarationType<'a> {
pub nodes: (Symbol<'a>, Symbol<'a>, ListOfTypeAssignments<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SpecparamDeclaration<'a> {
pub nodes: (
Symbol<'a>,

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,55 +7,61 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CastingType<'a> {
SimpleType(Box<SimpleType<'a>>),
ConstantPrimary(Box<ConstantPrimary<'a>>),
Signing(Box<Signing>),
String,
Const,
Signing(Box<Signing<'a>>),
String(Symbol<'a>),
Const(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum DataType<'a> {
Vector(DataTypeVector<'a>),
Atom(DataTypeAtom),
NonIntegerType(NonIntegerType),
Atom(DataTypeAtom<'a>),
NonIntegerType(NonIntegerType<'a>),
Union(DataTypeUnion<'a>),
Enum(DataTypeEnum<'a>),
String,
Chandle,
String(Symbol<'a>),
Chandle(Symbol<'a>),
Virtual(DataTypeVirtual<'a>),
Type(DataTypeType<'a>),
ClassType(ClassType<'a>),
Event,
Event(Symbol<'a>),
PsCovergroupIdentifier(PsCovergroupIdentifier<'a>),
TypeReference(Box<TypeReference<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DataTypeVector<'a> {
pub nodes: (IntegerVectorType, Option<Signing>, Vec<PackedDimension<'a>>),
pub nodes: (
IntegerVectorType<'a>,
Option<Signing<'a>>,
Vec<PackedDimension<'a>>,
),
}
#[derive(Debug)]
pub struct DataTypeAtom {
pub nodes: (IntegerAtomType, Option<Signing>),
#[derive(Debug, Node)]
pub struct DataTypeAtom<'a> {
pub nodes: (IntegerAtomType<'a>, Option<Signing<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DataTypeUnion<'a> {
pub nodes: (
StructUnion,
Option<(Packed, Option<Signing>)>,
StructUnion<'a>,
Option<(Packed<'a>, Option<Signing<'a>>)>,
Vec<StructUnionMember<'a>>,
),
}
#[derive(Debug)]
pub struct Packed {}
#[derive(Debug, Node)]
pub struct Packed<'a> {
pub nodes: (Symbol<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DataTypeEnum<'a> {
pub nodes: (
Option<EnumBaseType<'a>>,
@ -63,20 +70,22 @@ pub struct DataTypeEnum<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DataTypeVirtual<'a> {
pub nodes: (
Option<Interface>,
Option<Interface<'a>>,
InterfaceIdentifier<'a>,
Option<ParameterValueAssignment<'a>>,
Option<ModportIdentifier<'a>>,
),
}
#[derive(Debug)]
pub struct Interface {}
#[derive(Debug, Node)]
pub struct Interface<'a> {
pub nodes: (Symbol<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DataTypeType<'a> {
pub nodes: (
Option<PackageScopeOrClassScope<'a>>,
@ -85,44 +94,44 @@ pub struct DataTypeType<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum DataTypeOrImplicit<'a> {
DataType(DataType<'a>),
ImplicitDataType(ImplicitDataType<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ImplicitDataType<'a> {
pub nodes: (Option<Signing>, Vec<PackedDimension<'a>>),
pub nodes: (Option<Signing<'a>>, Vec<PackedDimension<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum EnumBaseType<'a> {
Atom(EnumBaseTypeAtom),
Atom(EnumBaseTypeAtom<'a>),
Vector(EnumBaseTypeVector<'a>),
Type(EnumBaseTypeType<'a>),
}
#[derive(Debug)]
pub struct EnumBaseTypeAtom {
pub nodes: (IntegerAtomType, Option<Signing>),
#[derive(Debug, Node)]
pub struct EnumBaseTypeAtom<'a> {
pub nodes: (IntegerAtomType<'a>, Option<Signing<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EnumBaseTypeVector<'a> {
pub nodes: (
IntegerVectorType,
Option<Signing>,
IntegerVectorType<'a>,
Option<Signing<'a>>,
Option<PackedDimension<'a>>,
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EnumBaseTypeType<'a> {
pub nodes: (Identifier<'a>, Option<PackedDimension<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EnumNameDeclaration<'a> {
pub nodes: (
Identifier<'a>,
@ -131,12 +140,12 @@ pub struct EnumNameDeclaration<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassScope<'a> {
pub nodes: (ClassType<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassType<'a> {
pub nodes: (
Identifier<'a>,
@ -145,37 +154,37 @@ pub struct ClassType<'a> {
),
}
#[derive(Debug)]
pub enum IntegerType {
Vector(IntegerVectorType),
Atom(IntegerAtomType),
#[derive(Debug, Node)]
pub enum IntegerType<'a> {
Vector(IntegerVectorType<'a>),
Atom(IntegerAtomType<'a>),
}
#[derive(Debug)]
pub enum IntegerAtomType {
Byte,
Shortint,
Int,
Longint,
Integer,
Time,
#[derive(Debug, Node)]
pub enum IntegerAtomType<'a> {
Byte(Symbol<'a>),
Shortint(Symbol<'a>),
Int(Symbol<'a>),
Longint(Symbol<'a>),
Integer(Symbol<'a>),
Time(Symbol<'a>),
}
#[derive(Debug)]
pub enum IntegerVectorType {
Bit,
Logic,
Reg,
#[derive(Debug, Node)]
pub enum IntegerVectorType<'a> {
Bit(Symbol<'a>),
Logic(Symbol<'a>),
Reg(Symbol<'a>),
}
#[derive(Debug)]
pub enum NonIntegerType {
Shortreal,
Real,
Realtime,
#[derive(Debug, Node)]
pub enum NonIntegerType<'a> {
Shortreal(Symbol<'a>),
Real(Symbol<'a>),
Realtime(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum NetType<'a> {
Supply0(Symbol<'a>),
Supply1(Symbol<'a>),
@ -191,67 +200,67 @@ pub enum NetType<'a> {
Wor(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum NetPortType<'a> {
DataType(NetPortTypeDataType<'a>),
NetType(Identifier<'a>),
Interconnect(ImplicitDataType<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NetPortTypeDataType<'a> {
pub nodes: (Option<NetType<'a>>, DataTypeOrImplicit<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct VariablePortType<'a> {
pub nodes: (VarDataType<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum VarDataType<'a> {
DataType(DataType<'a>),
DataTypeOrImplicit(DataTypeOrImplicit<'a>),
}
#[derive(Debug)]
pub enum Signing {
Signed,
Unsigned,
#[derive(Debug, Node)]
pub enum Signing<'a> {
Signed(Symbol<'a>),
Unsigned(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum SimpleType<'a> {
IntegerType(IntegerType),
NonNonIntegerType(IntegerType),
IntegerType(IntegerType<'a>),
NonNonIntegerType(IntegerType<'a>),
TypeIdentifier(Identifier<'a>),
ParameterIdentifier(Identifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct StructUnionMember<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
Option<RandomQualifier>,
Option<RandomQualifier<'a>>,
DataTypeOrVoid<'a>,
ListOfVariableDeclAssignments<'a>,
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum DataTypeOrVoid<'a> {
DataType(DataType<'a>),
Void,
Void(Symbol<'a>),
}
#[derive(Debug)]
pub enum StructUnion {
Struct,
Union,
UnionTagged,
#[derive(Debug, Node)]
pub enum StructUnion<'a> {
Struct(Symbol<'a>),
Union(Symbol<'a>),
UnionTagged(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum TypeReference<'a> {
Expression(Expression<'a>),
DataType(DataType<'a>),

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -6,23 +7,23 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InoutDeclaration<'a> {
pub nodes: (Symbol<'a>, NetPortType<'a>, ListOfPortIdentifiers<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum InputDeclaration<'a> {
Net(InputDeclarationNet<'a>),
Variable(InputDeclarationVariable<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InputDeclarationNet<'a> {
pub nodes: (Symbol<'a>, NetPortType<'a>, ListOfPortIdentifiers<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InputDeclarationVariable<'a> {
pub nodes: (
Symbol<'a>,
@ -31,18 +32,18 @@ pub struct InputDeclarationVariable<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum OutputDeclaration<'a> {
Net(OutputDeclarationNet<'a>),
Variable(OutputDeclarationVariable<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct OutputDeclarationNet<'a> {
pub nodes: (Symbol<'a>, NetPortType<'a>, ListOfPortIdentifiers<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct OutputDeclarationVariable<'a> {
pub nodes: (
Symbol<'a>,
@ -51,7 +52,7 @@ pub struct OutputDeclarationVariable<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfacePortDeclaration<'a> {
pub nodes: (
InterfaceIdentifier<'a>,
@ -60,7 +61,7 @@ pub struct InterfacePortDeclaration<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RefDeclaration<'a> {
pub nodes: (
Symbol<'a>,

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,18 +7,18 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TaskDeclaration<'a> {
pub nodes: (Option<Lifetime<'a>>, TaskBodyDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum TaskBodyDeclaration<'a> {
WithoutPort(TaskBodyDeclarationWithoutPort<'a>),
WithPort(TaskBodyDeclarationWithPort<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TaskBodyDeclarationWithoutPort<'a> {
pub nodes: (
Option<InterfaceIdentifierOrClassScope<'a>>,
@ -28,7 +29,7 @@ pub struct TaskBodyDeclarationWithoutPort<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TaskBodyDeclarationWithPort<'a> {
pub nodes: (
Option<InterfaceIdentifierOrClassScope<'a>>,
@ -40,28 +41,28 @@ pub struct TaskBodyDeclarationWithPort<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum InterfaceIdentifierOrClassScope<'a> {
InterfaceIdentifier(InterfaceIdentifier<'a>),
ClassScope(ClassScope<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum TfItemDeclaration<'a> {
Block(BlockItemDeclaration<'a>),
Port(TfPortDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TfPortList<'a> {
pub nodes: (Vec<TfPortItem<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TfPortItem<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
Option<TfPortDirection>,
Option<TfPortDirection<'a>>,
Option<Var<'a>>,
DataTypeOrImplicit<'a>,
Option<(
@ -72,24 +73,24 @@ pub struct TfPortItem<'a> {
),
}
#[derive(Debug)]
pub enum TfPortDirection {
PortDirection(PortDirection),
ConstRef,
#[derive(Debug, Node)]
pub enum TfPortDirection<'a> {
PortDirection(PortDirection<'a>),
ConstRef(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TfPortDeclaration<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
TfPortDirection,
TfPortDirection<'a>,
Option<Var<'a>>,
DataTypeOrImplicit<'a>,
ListOfTfVariableIdentifiers<'a>,
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TaskPrototype<'a> {
pub nodes: (Identifier<'a>, Option<TfPortList<'a>>),
}

View File

@ -8,7 +8,7 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum DataDeclaration<'a> {
Variable(DataDeclarationVariable<'a>),
TypeDeclaration(TypeDeclaration<'a>),
@ -16,7 +16,7 @@ pub enum DataDeclaration<'a> {
NetTypeDeclaration(NetTypeDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DataDeclarationVariable<'a> {
pub nodes: (
Option<Const<'a>>,
@ -33,7 +33,7 @@ pub struct Const<'a> {
pub nodes: (Symbol<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PackageImportDeclaration<'a> {
pub nodes: (
Symbol<'a>,
@ -78,19 +78,19 @@ pub struct PackageExportDeclarationItem<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct GenvarDeclaration<'a> {
pub nodes: (Symbol<'a>, ListOfGenvarIdentifiers<'a>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum NetDeclaration<'a> {
NetType(NetDeclarationNetType<'a>),
NetTypeIdentifier(NetDeclarationNetTypeIdentifier<'a>),
Interconnect(NetDeclarationInterconnect<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NetDeclarationNetType<'a> {
pub nodes: (
NetType<'a>,
@ -103,7 +103,7 @@ pub struct NetDeclarationNetType<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum Strength<'a> {
Drive(DriveStrength<'a>),
Charge(ChargeStrength<'a>),
@ -115,7 +115,7 @@ pub enum VectorScalar<'a> {
Scalared(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NetDeclarationNetTypeIdentifier<'a> {
pub nodes: (
NetTypeIdentifier<'a>,
@ -125,7 +125,7 @@ pub struct NetDeclarationNetTypeIdentifier<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NetDeclarationInterconnect<'a> {
pub nodes: (
Symbol<'a>,
@ -138,14 +138,14 @@ pub struct NetDeclarationInterconnect<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum TypeDeclaration<'a> {
DataType(TypeDeclarationDataType<'a>),
Interface(TypeDeclarationInterface<'a>),
Reserved(TypeDeclarationReserved<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TypeDeclarationDataType<'a> {
pub nodes: (
Symbol<'a>,
@ -156,7 +156,7 @@ pub struct TypeDeclarationDataType<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TypeDeclarationInterface<'a> {
pub nodes: (
Symbol<'a>,
@ -169,7 +169,7 @@ pub struct TypeDeclarationInterface<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TypeDeclarationReserved<'a> {
pub nodes: (
Symbol<'a>,
@ -188,13 +188,13 @@ pub enum TypeDeclarationKeyword<'a> {
InterfaceClass((Symbol<'a>, Symbol<'a>)),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum NetTypeDeclaration<'a> {
DataType(NetTypeDeclarationDataType<'a>),
NetType(NetTypeDeclarationNetType<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NetTypeDeclarationDataType<'a> {
pub nodes: (
Symbol<'a>,
@ -209,7 +209,7 @@ pub struct NetTypeDeclarationDataType<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NetTypeDeclarationNetType<'a> {
pub nodes: (
Symbol<'a>,

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -6,37 +7,37 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct Concatenation<'a> {
pub nodes: (Brace<'a, List<Symbol<'a>, Expression<'a>>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantConcatenation<'a> {
pub nodes: (Brace<'a, List<Symbol<'a>, ConstantExpression<'a>>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantMultipleConcatenation<'a> {
pub nodes: (Brace<'a, (ConstantExpression<'a>, ConstantConcatenation<'a>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModulePathConcatenation<'a> {
pub nodes: (Brace<'a, List<Symbol<'a>, ModulePathExpression<'a>>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModulePathMultipleConcatenation<'a> {
pub nodes: (Brace<'a, (ConstantExpression<'a>, ModulePathConcatenation<'a>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct MultipleConcatenation<'a> {
pub nodes: (Brace<'a, (Expression<'a>, Concatenation<'a>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct StreamingConcatenation<'a> {
pub nodes: (
Brace<
@ -50,23 +51,23 @@ pub struct StreamingConcatenation<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct StreamOperator<'a> {
pub nodes: (Symbol<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum SliceSize<'a> {
SimpleType(SimpleType<'a>),
ConstantExpression(ConstantExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct StreamConcatenation<'a> {
pub nodes: (Brace<'a, List<Symbol<'a>, StreamExpression<'a>>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct StreamExpression<'a> {
pub nodes: (
Expression<'a>,
@ -74,7 +75,7 @@ pub struct StreamExpression<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ArrayRangeExpression<'a> {
Expression(Expression<'a>),
Colon(ArrayRangeExpressionColon<'a>),
@ -82,22 +83,22 @@ pub enum ArrayRangeExpression<'a> {
MinusColon(ArrayRangeExpressionMinusColon<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ArrayRangeExpressionColon<'a> {
pub nodes: (Expression<'a>, Symbol<'a>, Expression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ArrayRangeExpressionPlusColon<'a> {
pub nodes: (Expression<'a>, Symbol<'a>, Expression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ArrayRangeExpressionMinusColon<'a> {
pub nodes: (Expression<'a>, Symbol<'a>, Expression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct EmptyUnpackedArrayConcatenation<'a> {
pub nodes: (Symbol<'a>, Symbol<'a>),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -5,24 +6,24 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum NetLvalue<'a> {
Identifier(NetLvalueIdentifier<'a>),
Lvalue(Box<NetLvalueLvalue<'a>>),
Pattern(Box<NetLvaluePattern<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NetLvalueIdentifier<'a> {
pub nodes: (PsOrHierarchicalNetIdentifier<'a>, ConstantSelect<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NetLvalueLvalue<'a> {
pub nodes: (Brace<'a, List<Symbol<'a>, NetLvalue<'a>>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NetLvaluePattern<'a> {
pub nodes: (
Option<AssignmentPatternExpressionType<'a>>,
@ -30,7 +31,7 @@ pub struct NetLvaluePattern<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum VariableLvalue<'a> {
Identifier(VariableLvalueIdentifier<'a>),
Lvalue(Box<VariableLvalueLvalue<'a>>),
@ -38,7 +39,7 @@ pub enum VariableLvalue<'a> {
StreamingConcatenation(StreamingConcatenation<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct VariableLvalueIdentifier<'a> {
pub nodes: (
Option<ImplicitClassHandleOrPackageScope<'a>>,
@ -47,12 +48,12 @@ pub struct VariableLvalueIdentifier<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct VariableLvalueLvalue<'a> {
pub nodes: (Brace<'a, List<Symbol<'a>, VariableLvalue<'a>>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct VariableLvaluePattern<'a> {
pub nodes: (
Option<AssignmentPatternExpressionType<'a>>,
@ -60,7 +61,7 @@ pub struct VariableLvaluePattern<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NonrangeVariableLvalue<'a> {
pub nodes: (
Option<ImplicitClassHandleOrPackageScope<'a>>,

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -6,13 +7,13 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum IncOrDecExpression<'a> {
Prefix(IncOrDecExpressionPrefix<'a>),
Suffix(IncOrDecExpressionSuffix<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct IncOrDecExpressionPrefix<'a> {
pub nodes: (
IncOrDecOperator<'a>,
@ -21,7 +22,7 @@ pub struct IncOrDecExpressionPrefix<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct IncOrDecExpressionSuffix<'a> {
pub nodes: (
VariableLvalue<'a>,
@ -30,7 +31,7 @@ pub struct IncOrDecExpressionSuffix<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConditionalExpression<'a> {
pub nodes: (
CondPredicate<'a>,
@ -42,7 +43,7 @@ pub struct ConditionalExpression<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConstantExpression<'a> {
ConstantPrimary(Box<ConstantPrimary<'a>>),
Unary(Box<ConstantExpressionUnary<'a>>),
@ -50,7 +51,7 @@ pub enum ConstantExpression<'a> {
Ternary(Box<ConstantExpressionTernary<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantExpressionUnary<'a> {
pub nodes: (
UnaryOperator<'a>,
@ -59,7 +60,7 @@ pub struct ConstantExpressionUnary<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantExpressionBinary<'a> {
pub nodes: (
ConstantExpression<'a>,
@ -69,7 +70,7 @@ pub struct ConstantExpressionBinary<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantExpressionTernary<'a> {
pub nodes: (
ConstantExpression<'a>,
@ -81,13 +82,13 @@ pub struct ConstantExpressionTernary<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConstantMintypmaxExpression<'a> {
Unary(ConstantExpression<'a>),
Ternary(ConstantMintypmaxExpressionTernary<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantMintypmaxExpressionTernary<'a> {
pub nodes: (
ConstantExpression<'a>,
@ -98,43 +99,43 @@ pub struct ConstantMintypmaxExpressionTernary<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConstantParamExpression<'a> {
ConstantMintypmaxExpression(ConstantMintypmaxExpression<'a>),
DataType(DataType<'a>),
Dollar(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ParamExpression<'a> {
MintypmaxExpression(MintypmaxExpression<'a>),
DataType(Box<DataType<'a>>),
Dollar(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConstantRangeExpression<'a> {
ConstantExpression(ConstantExpression<'a>),
ConstantPartSelectRange(ConstantPartSelectRange<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConstantPartSelectRange<'a> {
ConstantRange(ConstantRange<'a>),
ConstantIndexedRange(ConstantIndexedRange<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantRange<'a> {
pub nodes: (ConstantExpression<'a>, Symbol<'a>, ConstantExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantIndexedRange<'a> {
pub nodes: (ConstantExpression<'a>, Symbol<'a>, ConstantExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum Expression<'a> {
Primary(Box<Primary<'a>>),
Unary(Box<ExpressionUnary<'a>>),
@ -146,17 +147,17 @@ pub enum Expression<'a> {
TaggedUnionExpression(Box<TaggedUnionExpression<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ExpressionUnary<'a> {
pub nodes: (UnaryOperator<'a>, Vec<AttributeInstance<'a>>, Primary<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ExpressionOperatorAssignment<'a> {
pub nodes: (Paren<'a, OperatorAssignment<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ExpressionBinary<'a> {
pub nodes: (
Expression<'a>,
@ -166,34 +167,34 @@ pub struct ExpressionBinary<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TaggedUnionExpression<'a> {
pub nodes: (Symbol<'a>, MemberIdentifier<'a>, Option<Expression<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InsideExpression<'a> {
pub nodes: (Expression<'a>, Symbol<'a>, Brace<'a, OpenRangeList<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ValueRange<'a> {
Expression(Expression<'a>),
Binary(ValueRangeBinary<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ValueRangeBinary<'a> {
pub nodes: (Bracket<'a, (Expression<'a>, Symbol<'a>, Expression<'a>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum MintypmaxExpression<'a> {
Expression(Expression<'a>),
Ternary(MintypmaxExpressionTernary<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct MintypmaxExpressionTernary<'a> {
pub nodes: (
Expression<'a>,
@ -204,7 +205,7 @@ pub struct MintypmaxExpressionTernary<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModulePathConditionalExpression<'a> {
pub nodes: (
ModulePathExpression<'a>,
@ -216,7 +217,7 @@ pub struct ModulePathConditionalExpression<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ModulePathExpression<'a> {
ModulePathPrimary(Box<ModulePathPrimary<'a>>),
Unary(Box<ModulePathExpressionUnary<'a>>),
@ -224,7 +225,7 @@ pub enum ModulePathExpression<'a> {
ModulePathConditionalExpression(Box<ModulePathConditionalExpression<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModulePathExpressionUnary<'a> {
pub nodes: (
UnaryModulePathOperator<'a>,
@ -233,7 +234,7 @@ pub struct ModulePathExpressionUnary<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModulePathExpressionBinary<'a> {
pub nodes: (
ModulePathExpression<'a>,
@ -243,13 +244,13 @@ pub struct ModulePathExpressionBinary<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ModulePathMintypmaxExpression<'a> {
ModulePathExpression(ModulePathExpression<'a>),
Ternary(ModulePathMintypmaxExpressionTernary<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModulePathMintypmaxExpressionTernary<'a> {
pub nodes: (
ModulePathExpression<'a>,
@ -260,18 +261,18 @@ pub struct ModulePathMintypmaxExpressionTernary<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PartSelectRange<'a> {
ConstantRange(ConstantRange<'a>),
IndexedRange(IndexedRange<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct IndexedRange<'a> {
pub nodes: (Expression<'a>, Symbol<'a>, ConstantExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct GenvarExpression<'a> {
pub nodes: (ConstantExpression<'a>,),
}

View File

@ -7,7 +7,7 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConstantPrimary<'a> {
PrimaryLiteral(PrimaryLiteral<'a>),
PsParameter(ConstantPrimaryPsParameter<'a>),
@ -26,12 +26,12 @@ pub enum ConstantPrimary<'a> {
Null(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantPrimaryPsParameter<'a> {
pub nodes: (PsParameterIdentifier<'a>, ConstantSelect<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantPrimarySpecparam<'a> {
pub nodes: (
SpecparamIdentifier<'a>,
@ -39,17 +39,17 @@ pub struct ConstantPrimarySpecparam<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantPrimaryFormalPort<'a> {
pub nodes: (FormalPortIdentifier<'a>, ConstantSelect<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantPrimaryEnum<'a> {
pub nodes: (PackageScopeOrClassScope<'a>, EnumIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantPrimaryConcatenation<'a> {
pub nodes: (
ConstantConcatenation<'a>,
@ -57,7 +57,7 @@ pub struct ConstantPrimaryConcatenation<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantPrimaryMultipleConcatenation<'a> {
pub nodes: (
ConstantMultipleConcatenation<'a>,
@ -65,12 +65,12 @@ pub struct ConstantPrimaryMultipleConcatenation<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantPrimaryMintypmaxExpression<'a> {
pub nodes: (Paren<'a, ConstantMintypmaxExpression<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ModulePathPrimary<'a> {
Number(Number<'a>),
Identifier(Identifier<'a>),
@ -80,12 +80,12 @@ pub enum ModulePathPrimary<'a> {
Mintypmax(ModulePathPrimaryMintypmax<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModulePathPrimaryMintypmax<'a> {
pub nodes: (Paren<'a, ModulePathMintypmaxExpression<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum Primary<'a> {
PrimaryLiteral(PrimaryLiteral<'a>),
Hierarchical(PrimaryHierarchical<'a>),
@ -104,7 +104,7 @@ pub enum Primary<'a> {
Null(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PrimaryHierarchical<'a> {
pub nodes: (
Option<ClassQualifierOrPackageScope<'a>>,
@ -113,12 +113,12 @@ pub struct PrimaryHierarchical<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PrimaryConcatenation<'a> {
pub nodes: (Concatenation<'a>, Option<Bracket<'a, RangeExpression<'a>>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PrimaryMultipleConcatenation<'a> {
pub nodes: (
MultipleConcatenation<'a>,
@ -126,18 +126,18 @@ pub struct PrimaryMultipleConcatenation<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PrimaryMintypmaxExpression<'a> {
pub nodes: (Paren<'a, MintypmaxExpression<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ClassQualifierOrPackageScope<'a> {
ClassQualifier(ClassQualifier<'a>),
PackageScope(PackageScope<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassQualifier<'a> {
pub nodes: (
Option<Local<'a>>,
@ -145,13 +145,13 @@ pub struct ClassQualifier<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum RangeExpression<'a> {
Expression(Expression<'a>),
PartSelectRange(PartSelectRange<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PrimaryLiteral<'a> {
Number(Number<'a>),
TimeLiteral(TimeLiteral<'a>),
@ -192,12 +192,12 @@ pub enum ImplicitClassHandle<'a> {
ThisSuper((Symbol<'a>, Symbol<'a>, Symbol<'a>)),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BitSelect<'a> {
nodes: (Vec<Bracket<'a, Expression<'a>>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct Select<'a> {
pub nodes: (
Option<(
@ -210,7 +210,7 @@ pub struct Select<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NonrangeSelect<'a> {
pub nodes: (
Option<(
@ -222,12 +222,12 @@ pub struct NonrangeSelect<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantBitSelect<'a> {
nodes: (Vec<Bracket<'a, ConstantExpression<'a>>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantSelect<'a> {
pub nodes: (
Option<(
@ -240,7 +240,7 @@ pub struct ConstantSelect<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantCast<'a> {
pub nodes: (
CastingType<'a>,
@ -249,12 +249,12 @@ pub struct ConstantCast<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantLetExpression<'a> {
pub nodes: (LetExpression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct Cast<'a> {
pub nodes: (CastingType<'a>, Symbol<'a>, Paren<'a, Expression<'a>>),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -7,12 +8,12 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstantFunctionCall<'a> {
pub nodes: (FunctionSubroutineCall<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TfCall<'a> {
pub nodes: (
PsOrHierarchicalTfIdentifier<'a>,
@ -21,14 +22,14 @@ pub struct TfCall<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum SystemTfCall<'a> {
ArgOptionl(SystemTfCallArgOptional<'a>),
ArgDataType(SystemTfCallArgDataType<'a>),
ArgExpression(SystemTfCallArgExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SystemTfCallArgOptional<'a> {
pub nodes: (
SystemTfIdentifier<'a>,
@ -36,7 +37,7 @@ pub struct SystemTfCallArgOptional<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SystemTfCallArgDataType<'a> {
pub nodes: (
SystemTfIdentifier<'a>,
@ -44,7 +45,7 @@ pub struct SystemTfCallArgDataType<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SystemTfCallArgExpression<'a> {
pub nodes: (
SystemTfIdentifier<'a>,
@ -58,7 +59,7 @@ pub struct SystemTfCallArgExpression<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum SubroutineCall<'a> {
TfCall(Box<TfCall<'a>>),
SystemTfCall(Box<SystemTfCall<'a>>),
@ -66,23 +67,23 @@ pub enum SubroutineCall<'a> {
Randomize(Box<SubroutineCallRandomize<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SubroutineCallRandomize<'a> {
pub nodes: (Option<(Symbol<'a>, Symbol<'a>)>, RandomizeCall<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct FunctionSubroutineCall<'a> {
pub nodes: (SubroutineCall<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ListOfArguments<'a> {
Ordered(ListOfArgumentsOrdered<'a>),
Named(ListOfArgumentsNamed<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfArgumentsOrdered<'a> {
pub nodes: (
List<Symbol<'a>, Option<Expression<'a>>>,
@ -95,7 +96,7 @@ pub struct ListOfArgumentsOrdered<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfArgumentsNamed<'a> {
pub nodes: (
Symbol<'a>,
@ -110,18 +111,18 @@ pub struct ListOfArgumentsNamed<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct MethodCall<'a> {
pub nodes: (MethodCallRoot<'a>, Symbol<'a>, MethodCallBody<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum MethodCallBody<'a> {
User(MethodCallBodyUser<'a>),
BuiltInMethodCall(BuiltInMethodCall<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct MethodCallBodyUser<'a> {
pub nodes: (
MethodIdentifier<'a>,
@ -130,13 +131,13 @@ pub struct MethodCallBodyUser<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum BuiltInMethodCall<'a> {
ArrayManipulationCall(ArrayManipulationCall<'a>),
RandomizeCall(RandomizeCall<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ArrayManipulationCall<'a> {
pub nodes: (
ArrayMethodName<'a>,
@ -146,7 +147,7 @@ pub struct ArrayManipulationCall<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct RandomizeCall<'a> {
pub nodes: (
Symbol<'a>,
@ -160,19 +161,19 @@ pub struct RandomizeCall<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum VariableIdentifierListOrNull<'a> {
VariableIdentifierList(VariableIdentifierList<'a>),
Null(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum MethodCallRoot<'a> {
Primary(Primary<'a>),
ImplicitClassHandle(ImplicitClassHandle<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ArrayMethodName<'a> {
MethodIdentifier(MethodIdentifier<'a>),
Unique(Symbol<'a>),

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::combinator::*;
use nom::sequence::*;
@ -5,12 +6,12 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AttributeInstance<'a> {
pub nodes: (Symbol<'a>, List<Symbol<'a>, AttrSpec<'a>>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AttrSpec<'a> {
pub nodes: (Identifier<'a>, Option<(Symbol<'a>, ConstantExpression<'a>)>),
}

View File

@ -133,22 +133,22 @@ pub struct GenvarIdentifier<'a> {
pub nodes: (Identifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct HierarchicalArrayIdentifier<'a> {
pub nodes: (HierarchicalIdentifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct HierarchicalBlockIdentifier<'a> {
pub nodes: (HierarchicalIdentifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct HierarchicalEventIdentifier<'a> {
pub nodes: (HierarchicalIdentifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct HierarchicalIdentifier<'a> {
pub nodes: (
Option<Root<'a>>,
@ -162,37 +162,37 @@ pub struct Root<'a> {
pub nodes: (Symbol<'a>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct HierarchicalNetIdentifier<'a> {
pub nodes: (HierarchicalIdentifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct HierarchicalParameterIdentifier<'a> {
pub nodes: (HierarchicalIdentifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct HierarchicalPropertyIdentifier<'a> {
pub nodes: (HierarchicalIdentifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct HierarchicalSequenceIdentifier<'a> {
pub nodes: (HierarchicalIdentifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct HierarchicalTaskIdentifier<'a> {
pub nodes: (HierarchicalIdentifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct HierarchicalTfIdentifier<'a> {
pub nodes: (HierarchicalIdentifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct HierarchicalVariableIdentifier<'a> {
pub nodes: (HierarchicalIdentifier<'a>,),
}
@ -339,7 +339,7 @@ pub struct PsIdentifier<'a> {
pub nodes: (Option<PackageScope<'a>>, Identifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PsOrHierarchicalArrayIdentifier<'a> {
pub nodes: (
Option<ImplicitClassHandleOrClassScopeOrPackageScope<'a>>,
@ -347,7 +347,7 @@ pub struct PsOrHierarchicalArrayIdentifier<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PsOrHierarchicalNetIdentifier<'a> {
PackageScope(PsOrHierarchicalNetIdentifierPackageScope<'a>),
HierarchicalNetIdentifier(HierarchicalNetIdentifier<'a>),
@ -358,66 +358,66 @@ pub struct PsOrHierarchicalNetIdentifierPackageScope<'a> {
pub nodes: (Option<PackageScope<'a>>, NetIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PsOrHierarchicalNetIdentifierHierarchical<'a> {
pub nodes: (HierarchicalNetIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PsOrHierarchicalPropertyIdentifier<'a> {
PackageScope(PsOrHierarchicalPropertyIdentifierPackageScope<'a>),
HierarchicalPropertyIdentifier(HierarchicalPropertyIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PsOrHierarchicalPropertyIdentifierPackageScope<'a> {
pub nodes: (Option<PackageScope<'a>>, PropertyIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PsOrHierarchicalPropertyIdentifierHierarchical<'a> {
pub nodes: (HierarchicalPropertyIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PsOrHierarchicalSequenceIdentifier<'a> {
PackageScope(PsOrHierarchicalSequenceIdentifierPackageScope<'a>),
HierarchicalSequenceIdentifier(HierarchicalSequenceIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PsOrHierarchicalSequenceIdentifierPackageScope<'a> {
pub nodes: (Option<PackageScope<'a>>, SequenceIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PsOrHierarchicalSequenceIdentifierHierarchical<'a> {
pub nodes: (HierarchicalSequenceIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PsOrHierarchicalTfIdentifier<'a> {
PackageScope(PsOrHierarchicalTfIdentifierPackageScope<'a>),
HierarchicalTfIdentifier(HierarchicalTfIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PsOrHierarchicalTfIdentifierPackageScope<'a> {
pub nodes: (Option<PackageScope<'a>>, TfIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PsOrHierarchicalTfIdentifierHierarchical<'a> {
pub nodes: (HierarchicalTfIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PsParameterIdentifier<'a> {
Scope(PsParameterIdentifierScope<'a>),
Generate(PsParameterIdentifierGenerate<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PsParameterIdentifierScope<'a> {
pub nodes: (
Option<PackageScopeOrClassScope<'a>>,
@ -425,7 +425,7 @@ pub struct PsParameterIdentifierScope<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PsParameterIdentifierGenerate<'a> {
pub nodes: (
Vec<(
@ -437,7 +437,7 @@ pub struct PsParameterIdentifierGenerate<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PsTypeIdentifier<'a> {
pub nodes: (
Option<LocalOrPackageScopeOrClassScope<'a>>,
@ -445,7 +445,7 @@ pub struct PsTypeIdentifier<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum LocalOrPackageScopeOrClassScope<'a> {
Local(Local<'a>),
PackageScope(PackageScope<'a>),
@ -517,26 +517,26 @@ pub struct VariableIdentifier<'a> {
pub nodes: (Identifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ImplicitClassHandleOrClassScopeOrPackageScope<'a> {
ImplicitClassHandle((ImplicitClassHandle<'a>, Symbol<'a>)),
ClassScope(ClassScope<'a>),
PackageScope(PackageScope<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ImplicitClassHandleOrPackageScope<'a> {
ImplicitClassHandle((ImplicitClassHandle<'a>, Symbol<'a>)),
PackageScope(PackageScope<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ImplicitClassHandleOrClassScope<'a> {
ImplicitClassHandle((ImplicitClassHandle<'a>, Symbol<'a>)),
ClassScope(ClassScope<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PackageScopeOrClassScope<'a> {
PackageScope(PackageScope<'a>),
ClassScope(ClassScope<'a>),

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -6,7 +7,7 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CheckerInstantiation<'a> {
pub nodes: (
PsCheckerIdentifier<'a>,
@ -16,34 +17,34 @@ pub struct CheckerInstantiation<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ListOfCheckerPortConnections<'a> {
Ordered(ListOfCheckerPortConnectionsOrdered<'a>),
Named(ListOfCheckerPortConnectionsNamed<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfCheckerPortConnectionsOrdered<'a> {
pub nodes: (List<Symbol<'a>, OrderedCheckerPortConnection<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfCheckerPortConnectionsNamed<'a> {
pub nodes: (List<Symbol<'a>, NamedCheckerPortConnection<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct OrderedCheckerPortConnection<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, Option<PropertyActualArg<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum NamedCheckerPortConnection<'a> {
Identifier(NamedCheckerPortConnectionIdentifier<'a>),
Asterisk(NamedCheckerPortConnectionAsterisk<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NamedCheckerPortConnectionIdentifier<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -53,7 +54,7 @@ pub struct NamedCheckerPortConnectionIdentifier<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NamedCheckerPortConnectionAsterisk<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, Symbol<'a>),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -7,12 +8,12 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct GenerateRegion<'a> {
pub nodes: (Symbol<'a>, Vec<GenerateItem<'a>>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LoopGenerateConstruct<'a> {
pub nodes: (
Symbol<'a>,
@ -30,7 +31,7 @@ pub struct LoopGenerateConstruct<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct GenvarInitialization<'a> {
pub nodes: (
Option<Genvar<'a>>,
@ -40,19 +41,19 @@ pub struct GenvarInitialization<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct Genvar<'a> {
pub nodes: (Symbol<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum GenvarIteration<'a> {
Assignment(GenvarIterationAssignment<'a>),
Prefix(GenvarIterationPrefix<'a>),
Suffix(GenvarIterationSuffix<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct GenvarIterationAssignment<'a> {
pub nodes: (
GenvarIdentifier<'a>,
@ -61,23 +62,23 @@ pub struct GenvarIterationAssignment<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct GenvarIterationPrefix<'a> {
pub nodes: (IncOrDecOperator<'a>, GenvarIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct GenvarIterationSuffix<'a> {
pub nodes: (GenvarIdentifier<'a>, IncOrDecOperator<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConditionalGenerateConstruct<'a> {
If(IfGenerateConstruct<'a>),
Case(CaseGenerateConstruct<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct IfGenerateConstruct<'a> {
pub nodes: (
Symbol<'a>,
@ -87,7 +88,7 @@ pub struct IfGenerateConstruct<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CaseGenerateConstruct<'a> {
pub nodes: (
Symbol<'a>,
@ -97,13 +98,13 @@ pub struct CaseGenerateConstruct<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CaseGenerateItem<'a> {
Nondefault(CaseGenerateItemNondefault<'a>),
Default(CaseGenerateItemDefault<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CaseGenerateItemNondefault<'a> {
pub nodes: (
List<Symbol<'a>, ConstantExpression<'a>>,
@ -112,18 +113,18 @@ pub struct CaseGenerateItemNondefault<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CaseGenerateItemDefault<'a> {
pub nodes: (Symbol<'a>, Option<Symbol<'a>>, GenerateBlock<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum GenerateBlock<'a> {
GenerateItem(GenerateItem<'a>),
Multiple(GenerateBlockMultiple<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct GenerateBlockMultiple<'a> {
pub nodes: (
Option<(GenerateBlockIdentifier<'a>, Symbol<'a>)>,
@ -135,7 +136,7 @@ pub struct GenerateBlockMultiple<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum GenerateItem<'a> {
ModuleOrGenerateItem(ModuleOrGenerateItem<'a>),
InterfaceOrGenerateItem(InterfaceOrGenerateItem<'a>),

View File

@ -1,10 +1,11 @@
use crate::ast::*;
use crate::parser::*;
use nom::combinator::*;
use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceInstantiation<'a> {
pub nodes: (
InterfaceIdentifier<'a>,

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -6,7 +7,7 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleInstantiation<'a> {
pub nodes: (
ModuleIdentifier<'a>,
@ -16,7 +17,7 @@ pub struct ModuleInstantiation<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ParameterValueAssignment<'a> {
pub nodes: (
Symbol<'a>,
@ -24,28 +25,28 @@ pub struct ParameterValueAssignment<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ListOfParameterAssignments<'a> {
Ordered(ListOfParameterAssignmentsOrdered<'a>),
Named(ListOfParameterAssignmentsNamed<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfParameterAssignmentsOrdered<'a> {
pub nodes: (List<Symbol<'a>, OrderedParameterAssignment<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfParameterAssignmentsNamed<'a> {
pub nodes: (List<Symbol<'a>, NamedParameterAssignment<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct OrderedParameterAssignment<'a> {
pub nodes: (ParamExpression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NamedParameterAssignment<'a> {
pub nodes: (
Symbol<'a>,
@ -54,7 +55,7 @@ pub struct NamedParameterAssignment<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct HierarchicalInstance<'a> {
pub nodes: (
NameOfInstance<'a>,
@ -62,39 +63,39 @@ pub struct HierarchicalInstance<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NameOfInstance<'a> {
pub nodes: (InstanceIdentifier<'a>, Vec<UnpackedDimension<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ListOfPortConnections<'a> {
Ordered(ListOfPortConnectionsOrdered<'a>),
Named(ListOfPortConnectionsNamed<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfPortConnectionsOrdered<'a> {
pub nodes: (List<Symbol<'a>, OrderedPortConnection<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfPortConnectionsNamed<'a> {
pub nodes: (List<Symbol<'a>, NamedPortConnection<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct OrderedPortConnection<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, Option<Expression<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum NamedPortConnection<'a> {
Identifier(NamedPortConnectionIdentifier<'a>),
Asterisk(NamedPortConnectionAsterisk<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NamedPortConnectionIdentifier<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -104,7 +105,7 @@ pub struct NamedPortConnectionIdentifier<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NamedPortConnectionAsterisk<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, Symbol<'a>),
}

View File

@ -1,10 +1,11 @@
use crate::ast::*;
use crate::parser::*;
use nom::combinator::*;
use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProgramInstantiation<'a> {
pub nodes: (
ProgramIdentifier<'a>,

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,16 +7,16 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CheckerPortList<'a> {
pub nodes: (Vec<CheckerPortItem<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CheckerPortItem<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
Option<CheckerPortDirection>,
Option<CheckerPortDirection<'a>>,
PropertyFormalType<'a>,
FormalPortIdentifier<'a>,
Vec<VariableDimension<'a>>,
@ -23,13 +24,13 @@ pub struct CheckerPortItem<'a> {
),
}
#[derive(Debug)]
pub enum CheckerPortDirection {
Input,
Output,
#[derive(Debug, Node)]
pub enum CheckerPortDirection<'a> {
Input(Symbol<'a>),
Output(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CheckerOrGenerateItem<'a> {
CheckerOrGenerateItemDeclaration(CheckerOrGenerateItemDeclaration<'a>),
InitialConstruct(InitialConstruct<'a>),
@ -40,7 +41,7 @@ pub enum CheckerOrGenerateItem<'a> {
CheckerGenerateItem(CheckerGenerateItem<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CheckerOrGenerateItemDeclaration<'a> {
Data(CheckerOrGenerateItemDeclarationData<'a>),
FunctionDeclaration(FunctionDeclaration<'a>),
@ -51,28 +52,30 @@ pub enum CheckerOrGenerateItemDeclaration<'a> {
ClockingDeclaration(ClockingDeclaration<'a>),
Clocking(CheckerOrGenerateItemDeclarationClocking<'a>),
Expression(CheckerOrGenerateItemDeclarationExpression<'a>),
Empty,
Empty(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CheckerOrGenerateItemDeclarationData<'a> {
pub nodes: (Option<Rand>, DataDeclaration<'a>),
pub nodes: (Option<Rand<'a>>, DataDeclaration<'a>),
}
#[derive(Debug)]
pub struct Rand {}
#[derive(Debug, Node)]
pub struct Rand<'a> {
pub nodes: (Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CheckerOrGenerateItemDeclarationClocking<'a> {
pub nodes: (ClockingIdentifier<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CheckerOrGenerateItemDeclarationExpression<'a> {
pub nodes: (ExpressionOrDist<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum CheckerGenerateItem<'a> {
LoopGenerateConstruct(Box<LoopGenerateConstruct<'a>>),
ConditionalGenerateConstruct(Box<ConditionalGenerateConstruct<'a>>),

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,7 +7,7 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ClassItem<'a> {
Property(ClassItemProperty<'a>),
Method(ClassItemMethod<'a>),
@ -15,56 +16,56 @@ pub enum ClassItem<'a> {
Covergroup(ClassItemCovergroup<'a>),
LocalParameterDeclaration(LocalParameterDeclaration<'a>),
ParameterDeclaration(ParameterDeclaration<'a>),
Empty,
Empty(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassItemProperty<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, ClassProperty<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassItemMethod<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, ClassMethod<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassItemConstraint<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, ClassConstraint<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassItemDeclaration<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, ClassDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassItemCovergroup<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, CovergroupDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ClassProperty<'a> {
NonConst(ClassPropertyNonConst<'a>),
Const(ClassPropertyConst<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassPropertyNonConst<'a> {
pub nodes: (Vec<PropertyQualifier>, DataDeclaration<'a>),
pub nodes: (Vec<PropertyQualifier<'a>>, DataDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassPropertyConst<'a> {
pub nodes: (
Vec<ClassItemQualifier>,
Vec<ClassItemQualifier<'a>>,
DataType<'a>,
ConstIdentifier<'a>,
Option<ConstantExpression<'a>>,
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ClassMethod<'a> {
Task(ClassMethodTask<'a>),
Function(ClassMethodFunction<'a>),
@ -74,80 +75,80 @@ pub enum ClassMethod<'a> {
ExternConstructor(ClassMethodExternConstructor<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassMethodTask<'a> {
pub nodes: (Vec<MethodQualifier>, TaskDeclaration<'a>),
pub nodes: (Vec<MethodQualifier<'a>>, TaskDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassMethodFunction<'a> {
pub nodes: (Vec<MethodQualifier>, FunctionDeclaration<'a>),
pub nodes: (Vec<MethodQualifier<'a>>, FunctionDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassMethodPureVirtual<'a> {
pub nodes: (Vec<ClassItemQualifier>, MethodPrototype<'a>),
pub nodes: (Vec<ClassItemQualifier<'a>>, MethodPrototype<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassMethodExternMethod<'a> {
pub nodes: (Vec<MethodQualifier>, MethodPrototype<'a>),
pub nodes: (Vec<MethodQualifier<'a>>, MethodPrototype<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassMethodConstructor<'a> {
pub nodes: (Vec<MethodQualifier>, ClassConstructorPrototype<'a>),
pub nodes: (Vec<MethodQualifier<'a>>, ClassConstructorPrototype<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassMethodExternConstructor<'a> {
pub nodes: (Vec<MethodQualifier>, ClassConstructorPrototype<'a>),
pub nodes: (Vec<MethodQualifier<'a>>, ClassConstructorPrototype<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassConstructorPrototype<'a> {
pub nodes: (Option<TfPortList<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ClassConstraint<'a> {
ConstraintPrototype(ConstraintPrototype<'a>),
ConstraintDeclaration(ConstraintDeclaration<'a>),
}
#[derive(Debug)]
pub enum ClassItemQualifier {
Static,
Protected,
Local,
#[derive(Debug, Node)]
pub enum ClassItemQualifier<'a> {
Static(Symbol<'a>),
Protected(Symbol<'a>),
Local(Symbol<'a>),
}
#[derive(Debug)]
pub enum PropertyQualifier {
RandomQualifier(RandomQualifier),
ClassItemQualifier(ClassItemQualifier),
#[derive(Debug, Node)]
pub enum PropertyQualifier<'a> {
RandomQualifier(RandomQualifier<'a>),
ClassItemQualifier(ClassItemQualifier<'a>),
}
#[derive(Debug)]
pub enum RandomQualifier {
Rand,
Randc,
#[derive(Debug, Node)]
pub enum RandomQualifier<'a> {
Rand(Symbol<'a>),
Randc(Symbol<'a>),
}
#[derive(Debug)]
pub enum MethodQualifier {
Virtual,
PureVirtual,
ClassItemQualifier(ClassItemQualifier),
#[derive(Debug, Node)]
pub enum MethodQualifier<'a> {
Virtual(Symbol<'a>),
PureVirtual(Symbol<'a>),
ClassItemQualifier(ClassItemQualifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum MethodPrototype<'a> {
TaskPrototype(TaskPrototype<'a>),
FunctionPrototype(FunctionPrototype<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassConstructorDeclaration<'a> {
pub nodes: (
Option<ClassScope<'a>>,
@ -155,12 +156,14 @@ pub struct ClassConstructorDeclaration<'a> {
Vec<BlockItemDeclaration<'a>>,
Option<Option<ListOfArguments<'a>>>,
Vec<FunctionStatementOrNull<'a>>,
Option<New>,
Option<New<'a>>,
),
}
#[derive(Debug)]
pub struct New {}
#[derive(Debug, Node)]
pub struct New<'a> {
pub nodes: (Symbol<'a>,),
}
// -----------------------------------------------------------------------------

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,7 +7,7 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConfigDeclaration<'a> {
pub nodes: (
ConfigIdentifier<'a>,
@ -17,12 +18,12 @@ pub struct ConfigDeclaration<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DesignStatement<'a> {
pub nodes: (Vec<(Option<LibraryIdentifier<'a>>, CellIdentifier<'a>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConfigRuleStatement<'a> {
Default(ConfigRuleStatementDefault<'a>),
InstLib(ConfigRuleStatementInstLib<'a>),
@ -31,87 +32,91 @@ pub enum ConfigRuleStatement<'a> {
CellUse(ConfigRuleStatementCellUse<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConfigRuleStatementDefault<'a> {
pub nodes: (DefaultClause, LiblistClause<'a>),
pub nodes: (DefaultClause<'a>, LiblistClause<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConfigRuleStatementInstLib<'a> {
pub nodes: (InstClause<'a>, LiblistClause<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConfigRuleStatementInstUse<'a> {
pub nodes: (InstClause<'a>, UseClause<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConfigRuleStatementCellLib<'a> {
pub nodes: (CellClause<'a>, LiblistClause<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConfigRuleStatementCellUse<'a> {
pub nodes: (CellClause<'a>, UseClause<'a>),
}
#[derive(Debug)]
pub struct DefaultClause {}
#[derive(Debug, Node)]
pub struct DefaultClause<'a> {
pub nodes: (Symbol<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InstClause<'a> {
pub nodes: (InstName<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InstName<'a> {
pub nodes: (TopmoduleIdentifier<'a>, Vec<InstanceIdentifier<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CellClause<'a> {
pub nodes: (Option<LibraryIdentifier<'a>>, CellIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LiblistClause<'a> {
pub nodes: (Vec<LibraryIdentifier<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum UseClause<'a> {
Cell(UseClauseCell<'a>),
Named(UseClauseNamed<'a>),
CellNamed(UseClauseCellNamed<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct UseClauseCell<'a> {
pub nodes: (
Option<LibraryIdentifier<'a>>,
CellIdentifier<'a>,
Option<Config>,
Option<Config<'a>>,
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct UseClauseNamed<'a> {
pub nodes: (Vec<NamedParameterAssignment<'a>>, Option<Config>),
pub nodes: (Vec<NamedParameterAssignment<'a>>, Option<Config<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct UseClauseCellNamed<'a> {
pub nodes: (
Option<LibraryIdentifier<'a>>,
CellIdentifier<'a>,
Vec<NamedParameterAssignment<'a>>,
Option<Config>,
Option<Config<'a>>,
),
}
#[derive(Debug)]
pub struct Config {}
#[derive(Debug, Node)]
pub struct Config<'a> {
pub nodes: (Symbol<'a>,),
}
// -----------------------------------------------------------------------------

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,40 +7,42 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstraintDeclaration<'a> {
pub nodes: (
Option<Static>,
Option<Static<'a>>,
ConstraintIdentifier<'a>,
ConstraintBlock<'a>,
),
}
#[derive(Debug)]
pub struct Static {}
#[derive(Debug, Node)]
pub struct Static<'a> {
pub nodes: (Symbol<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstraintBlock<'a> {
pub nodes: (Vec<ConstraintBlockItem<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConstraintBlockItem<'a> {
Solve(ConstraintBlockItemSolve<'a>),
ConstraintExpression(ConstraintExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstraintBlockItemSolve<'a> {
pub nodes: (SolveBeforeList<'a>, SolveBeforeList<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SolveBeforeList<'a> {
pub nodes: (Vec<ConstraintPrimary<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstraintPrimary<'a> {
pub nodes: (
Option<ImplicitClassHandleOrClassScope<'a>>,
@ -48,7 +51,7 @@ pub struct ConstraintPrimary<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConstraintExpression<'a> {
Expression(ConstraintExpressionExpression<'a>),
UniquenessConstraint(UniquenessConstraint<'a>),
@ -58,25 +61,27 @@ pub enum ConstraintExpression<'a> {
Disable(ConstraintExpressionDisable<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstraintExpressionExpression<'a> {
pub nodes: (Option<Soft>, ExpressionOrDist<'a>),
pub nodes: (Option<Soft<'a>>, ExpressionOrDist<'a>),
}
#[derive(Debug)]
pub struct Soft {}
#[derive(Debug, Node)]
pub struct Soft<'a> {
pub nodes: (Symbol<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstraintExpressionArrow<'a> {
pub nodes: (Expression<'a>, ConstraintSet<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstraintExpressionIf<'a> {
pub nodes: (Expression<'a>, ConstraintSet<'a>, Option<ConstraintSet<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstraintExpressionForeach<'a> {
pub nodes: (
PsOrHierarchicalArrayIdentifier<'a>,
@ -85,79 +90,79 @@ pub struct ConstraintExpressionForeach<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstraintExpressionDisable<'a> {
pub nodes: (ConstraintPrimary<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct UniquenessConstraint<'a> {
pub nodes: (OpenRangeList<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ConstraintSet<'a> {
ConstraintExpression(Box<ConstraintExpression<'a>>),
Bracket(ConstraintSetBracket<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstraintSetBracket<'a> {
pub nodes: (Vec<ConstraintExpression<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DistList<'a> {
pub nodes: (Vec<DistItem<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DistItem<'a> {
pub nodes: (ValueRange<'a>, Option<DistWeight<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum DistWeight<'a> {
Equal(DistWeightEqual<'a>),
Divide(DistWeightDivide<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DistWeightEqual<'a> {
pub nodes: (Expression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DistWeightDivide<'a> {
pub nodes: (Expression<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ConstraintPrototype<'a> {
pub nodes: (
Option<ConstraintPrototypeQualifier>,
Option<Static>,
Option<ConstraintPrototypeQualifier<'a>>,
Option<Static<'a>>,
ConstraintIdentifier<'a>,
),
}
#[derive(Debug)]
pub enum ConstraintPrototypeQualifier {
Extern,
Pure,
#[derive(Debug, Node)]
pub enum ConstraintPrototypeQualifier<'a> {
Extern(Symbol<'a>),
Pure(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ExternConstraintDeclaration<'a> {
pub nodes: (
Option<Static>,
Option<Static<'a>>,
ClassScope<'a>,
ConstraintIdentifier<'a>,
ConstraintBlock<'a>,
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct IdentifierList<'a> {
pub nodes: (Vec<Identifier<'a>>,),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,45 +7,45 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum InterfaceOrGenerateItem<'a> {
Module(InterfaceOrGenerateItemModule<'a>),
Extern(InterfaceOrGenerateItemExtern<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceOrGenerateItemModule<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, ModuleCommonItem<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceOrGenerateItemExtern<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, ExternTfDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ExternTfDeclaration<'a> {
Method(ExternTfDeclarationMethod<'a>),
Task(ExternTfDeclarationTask<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ExternTfDeclarationMethod<'a> {
pub nodes: (MethodPrototype<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ExternTfDeclarationTask<'a> {
pub nodes: (TaskPrototype<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum InterfaceItem<'a> {
PortDeclaration(PortDeclaration<'a>),
NonPortInterfaceItem(NonPortInterfaceItem<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum NonPortInterfaceItem<'a> {
GenerateRegion(GenerateRegion<'a>),
InterfaceOrGenerateItem(InterfaceOrGenerateItem<'a>),

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -7,12 +8,12 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LibraryText<'a> {
pub nodes: (Vec<LibraryDescription<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum LibraryDescription<'a> {
LibraryDeclaration(LibraryDeclaration<'a>),
IncludeStatement(IncludeStatement<'a>),
@ -20,7 +21,7 @@ pub enum LibraryDescription<'a> {
Null(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct LibraryDeclaration<'a> {
pub nodes: (
Symbol<'a>,
@ -31,12 +32,12 @@ pub struct LibraryDeclaration<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct IncludeStatement<'a> {
pub nodes: (Symbol<'a>, FilePathSpec<'a>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct FilePathSpec<'a> {
pub nodes: (StringLiteral<'a>,),
}

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,7 +7,7 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ElaborationSystemTask<'a> {
Fatal(ElaborationSystemTaskFatal<'a>),
Error(ElaborationSystemTaskError<'a>),
@ -14,34 +15,34 @@ pub enum ElaborationSystemTask<'a> {
Info(ElaborationSystemTaskInfo<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ElaborationSystemTaskFatal<'a> {
pub nodes: (Option<(FinishNumber, Option<ListOfArguments<'a>>)>,),
pub nodes: (Option<(FinishNumber<'a>, Option<ListOfArguments<'a>>)>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ElaborationSystemTaskError<'a> {
pub nodes: (Option<Option<ListOfArguments<'a>>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ElaborationSystemTaskWarning<'a> {
pub nodes: (Option<Option<ListOfArguments<'a>>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ElaborationSystemTaskInfo<'a> {
pub nodes: (Option<Option<ListOfArguments<'a>>>,),
}
#[derive(Debug)]
pub enum FinishNumber {
Zero,
One,
Two,
#[derive(Debug, Node)]
pub enum FinishNumber<'a> {
Zero(Symbol<'a>),
One(Symbol<'a>),
Two(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ModuleCommonItem<'a> {
ModuleOrGenerateItemDeclaration(ModuleOrGenerateItemDeclaration<'a>),
InterfaceInstantiation(InterfaceInstantiation<'a>),
@ -58,13 +59,13 @@ pub enum ModuleCommonItem<'a> {
ElaborationSystemTask(ElaborationSystemTask<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ModuleItem<'a> {
PortDeclaratoin(PortDeclaration<'a>),
NonPortModuleItem(NonPortModuleItem<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ModuleOrGenerateItem<'a> {
Parameter(ModuleOrGenerateItemParameter<'a>),
Gate(ModuleOrGenerateItemGate<'a>),
@ -73,32 +74,32 @@ pub enum ModuleOrGenerateItem<'a> {
ModuleItem(Box<ModuleOrGenerateItemModuleItem<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleOrGenerateItemParameter<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, ParameterOverride<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleOrGenerateItemGate<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, GateInstantiation<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleOrGenerateItemUdp<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, UdpInstantiation<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleOrGenerateItemModule<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, ModuleInstantiation<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleOrGenerateItemModuleItem<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, ModuleCommonItem<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ModuleOrGenerateItemDeclaration<'a> {
PackageOrGenerateItemDeclaration(PackageOrGenerateItemDeclaration<'a>),
GenvarDeclaration(GenvarDeclaration<'a>),
@ -107,17 +108,17 @@ pub enum ModuleOrGenerateItemDeclaration<'a> {
Expression(ModuleOrGenerateItemDeclarationExpression<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleOrGenerateItemDeclarationClocking<'a> {
pub nodes: (ClockingIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleOrGenerateItemDeclarationExpression<'a> {
pub nodes: (ExpressionOrDist<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum NonPortModuleItem<'a> {
GenerateRegion(GenerateRegion<'a>),
ModuleOrGenerateItem(ModuleOrGenerateItem<'a>),
@ -129,23 +130,23 @@ pub enum NonPortModuleItem<'a> {
TimeunitsDeclaration(TimeunitsDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NonPortModuleItemSpecparam<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, SpecparamDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ParameterOverride<'a> {
pub nodes: (ListOfDefparamAssignments<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum BindDirective<'a> {
Scope(BindDirectiveScope<'a>),
Instance(BindDirectiveInstance<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BindDirectiveScope<'a> {
pub nodes: (
BindTargetScope<'a>,
@ -154,28 +155,28 @@ pub struct BindDirectiveScope<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BindDirectiveInstance<'a> {
pub nodes: (BindTargetInstanceList<'a>, BindInstantiation<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum BindTargetScope<'a> {
ModuleIdentifier(ModuleIdentifier<'a>),
InterfaceIdentifier(InterfaceIdentifier<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BindTargetInstance<'a> {
pub nodes: (HierarchicalIdentifier<'a>, ConstantBitSelect<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct BindTargetInstanceList<'a> {
pub nodes: (Vec<BindTargetInstance<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum BindInstantiation<'a> {
ProgramInstantiation(ProgramInstantiation<'a>),
ModuleInstantiation(ModuleInstantiation<'a>),

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,14 +7,14 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ParameterPortList<'a> {
Assignment(ParameterPortListAssignment<'a>),
Declaration(ParameterPortListDeclaration<'a>),
Empty,
Empty(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ParameterPortListAssignment<'a> {
pub nodes: (
ListOfParamAssignments<'a>,
@ -21,12 +22,12 @@ pub struct ParameterPortListAssignment<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ParameterPortListDeclaration<'a> {
pub nodes: (Vec<ParameterPortDeclaration<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ParameterPortDeclaration<'a> {
ParameterDeclaration(ParameterDeclaration<'a>),
LocalParameterDeclaration(LocalParameterDeclaration<'a>),
@ -34,27 +35,27 @@ pub enum ParameterPortDeclaration<'a> {
TypeList(ParameterPortDeclarationTypeList<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ParameterPortDeclarationParamList<'a> {
pub nodes: (DataType<'a>, ListOfParamAssignments<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ParameterPortDeclarationTypeList<'a> {
pub nodes: (ListOfTypeAssignments<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfPorts<'a> {
pub nodes: (Vec<Port<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ListOfPortDeclarations<'a> {
pub nodes: (Option<Vec<(Vec<AttributeInstance<'a>>, AnsiPortDeclaration<'a>)>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PortDeclaration<'a> {
Inout(PortDeclarationInout<'a>),
Input(PortDeclarationInput<'a>),
@ -63,110 +64,110 @@ pub enum PortDeclaration<'a> {
Interface(PortDeclarationInterface<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PortDeclarationInout<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, InoutDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PortDeclarationInput<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, InputDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PortDeclarationOutput<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, OutputDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PortDeclarationRef<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, RefDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PortDeclarationInterface<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, InterfacePortDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum Port<'a> {
NonNamed(PortNonNamed<'a>),
Named(PortNamed<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PortNonNamed<'a> {
pub nodes: (Option<PortExpression<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PortNamed<'a> {
pub nodes: (PortIdentifier<'a>, Option<PortExpression<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PortExpression<'a> {
PortReference(PortReference<'a>),
Bracket(PortExpressionBracket<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PortExpressionBracket<'a> {
pub nodes: (Vec<PortReference<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PortReference<'a> {
pub nodes: (PortIdentifier<'a>, ConstantSelect<'a>),
}
#[derive(Debug)]
pub enum PortDirection {
Input,
Output,
Inout,
Ref,
#[derive(Debug, Node)]
pub enum PortDirection<'a> {
Input(Symbol<'a>),
Output(Symbol<'a>),
Inout(Symbol<'a>),
Ref(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NetPortHeader<'a> {
pub nodes: (Option<PortDirection>, NetPortType<'a>),
pub nodes: (Option<PortDirection<'a>>, NetPortType<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct VariablePortHeader<'a> {
pub nodes: (Option<PortDirection>, VariablePortType<'a>),
pub nodes: (Option<PortDirection<'a>>, VariablePortType<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum InterfacePortHeader<'a> {
Identifier(InterfacePortHeaderIdentifier<'a>),
Interface(InterfacePortHeaderInterface<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfacePortHeaderIdentifier<'a> {
pub nodes: (InterfaceIdentifier<'a>, Option<ModportIdentifier<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfacePortHeaderInterface<'a> {
pub nodes: (Option<ModportIdentifier<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum NetPortHeaderOrInterfacePortHeader<'a> {
NetPortHeader(NetPortHeader<'a>),
InterfacePortHeader(InterfacePortHeader<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum AnsiPortDeclaration<'a> {
Net(AnsiPortDeclarationNet<'a>),
Variable(AnsiPortDeclarationVariable<'a>),
Paren(AnsiPortDeclarationParen<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AnsiPortDeclarationNet<'a> {
pub nodes: (
Option<NetPortHeaderOrInterfacePortHeader<'a>>,
@ -176,7 +177,7 @@ pub struct AnsiPortDeclarationNet<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AnsiPortDeclarationVariable<'a> {
pub nodes: (
Option<VariablePortHeader<'a>>,
@ -186,10 +187,10 @@ pub struct AnsiPortDeclarationVariable<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AnsiPortDeclarationParen<'a> {
pub nodes: (
Option<PortDirection>,
Option<PortDirection<'a>>,
PortIdentifier<'a>,
Option<Expression<'a>>,
),

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,7 +7,7 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PackageItem<'a> {
PackageOrGenerateItemDeclaration(PackageOrGenerateItemDeclaration<'a>),
AnonymousProgram(AnonymousProgram<'a>),
@ -14,7 +15,7 @@ pub enum PackageItem<'a> {
TimeunitsDeclaration(TimeunitsDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum PackageOrGenerateItemDeclaration<'a> {
NetDeclaration(NetDeclaration<'a>),
DataDeclaration(DataDeclaration<'a>),
@ -29,22 +30,22 @@ pub enum PackageOrGenerateItemDeclaration<'a> {
ParameterDeclaration(ParameterDeclaration<'a>),
CovergroupDeclaration(CovergroupDeclaration<'a>),
AssertionItemDeclaration(AssertionItemDeclaration<'a>),
Empty,
Empty(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct AnonymousProgram<'a> {
pub nodes: (Vec<AnonymousProgramItem<'a>>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum AnonymousProgramItem<'a> {
TaskDeclaration(TaskDeclaration<'a>),
FunctionDeclaration(FunctionDeclaration<'a>),
ClassDeclaration(ClassDeclaration<'a>),
CovergroupDeclaration(CovergroupDeclaration<'a>),
ClassConstructorDeclaration(ClassConstructorDeclaration<'a>),
Empty,
Empty(Symbol<'a>),
}
// -----------------------------------------------------------------------------

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
//use nom::branch::*;
//use nom::combinator::*;
@ -6,13 +7,13 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ProgramItem<'a> {
PortDeclaration(PortDeclaration<'a>),
NonPortProgramItem(NonPortProgramItem<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum NonPortProgramItem<'a> {
Assign(NonPortProgramItemAssign<'a>),
Module(NonPortProgramItemModule<'a>),
@ -23,12 +24,12 @@ pub enum NonPortProgramItem<'a> {
ProgramGenerateItem(ProgramGenerateItem<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NonPortProgramItemAssign<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, ContinuousAssign<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NonPortProgramItemModule<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -36,22 +37,22 @@ pub struct NonPortProgramItemModule<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NonPortProgramItemInitial<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, InitialConstruct<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NonPortProgramItemFinal<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, FinalConstruct<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct NonPortProgramItemAssertion<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, ConcurrentAssertionItem<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ProgramGenerateItem<'a> {
LoopGenerateConstuct(LoopGenerateConstruct<'a>),
ConditionalGenerateConstruct(ConditionalGenerateConstruct<'a>),

View File

@ -1,3 +1,4 @@
use crate::ast::*;
use crate::parser::*;
use nom::branch::*;
use nom::combinator::*;
@ -7,12 +8,12 @@ use nom::IResult;
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SourceText<'a> {
pub nodes: (Option<TimeunitsDeclaration<'a>>, Vec<Description<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum Description<'a> {
ModuleDeclaration(ModuleDeclaration<'a>),
UdpDeclaration(UdpDeclaration<'a>),
@ -24,17 +25,17 @@ pub enum Description<'a> {
ConfigDeclaration(ConfigDeclaration<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DescriptionPackageItem<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, PackageItem<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct DescriptionBindDirective<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, BindDirective<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleNonansiHeader<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -48,7 +49,7 @@ pub struct ModuleNonansiHeader<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleAnsiHeader<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -62,7 +63,7 @@ pub struct ModuleAnsiHeader<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ModuleDeclaration<'a> {
Nonansi(ModuleDeclarationNonansi<'a>),
Ansi(ModuleDeclarationAnsi<'a>),
@ -71,7 +72,7 @@ pub enum ModuleDeclaration<'a> {
ExternAnsi(ModuleDeclarationExternAnsi<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleDeclarationNonansi<'a> {
pub nodes: (
ModuleNonansiHeader<'a>,
@ -82,7 +83,7 @@ pub struct ModuleDeclarationNonansi<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleDeclarationAnsi<'a> {
pub nodes: (
ModuleAnsiHeader<'a>,
@ -93,7 +94,7 @@ pub struct ModuleDeclarationAnsi<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleDeclarationWildcard<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -109,23 +110,23 @@ pub struct ModuleDeclarationWildcard<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleDeclarationExternNonansi<'a> {
pub nodes: (Symbol<'a>, ModuleNonansiHeader<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ModuleDeclarationExternAnsi<'a> {
pub nodes: (Symbol<'a>, ModuleAnsiHeader<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ModuleKeyword<'a> {
Module(Symbol<'a>),
Macromodule(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum InterfaceDeclaration<'a> {
Nonansi(InterfaceDeclarationNonansi<'a>),
Ansi(InterfaceDeclarationAnsi<'a>),
@ -134,7 +135,7 @@ pub enum InterfaceDeclaration<'a> {
ExternAnsi(InterfaceDeclarationExternAnsi<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceDeclarationNonansi<'a> {
pub nodes: (
InterfaceNonansiHeader<'a>,
@ -145,7 +146,7 @@ pub struct InterfaceDeclarationNonansi<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceDeclarationAnsi<'a> {
pub nodes: (
InterfaceAnsiHeader<'a>,
@ -156,7 +157,7 @@ pub struct InterfaceDeclarationAnsi<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceDeclarationWildcard<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -172,17 +173,17 @@ pub struct InterfaceDeclarationWildcard<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceDeclarationExternNonansi<'a> {
pub nodes: (Symbol<'a>, InterfaceNonansiHeader<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceDeclarationExternAnsi<'a> {
pub nodes: (Symbol<'a>, InterfaceAnsiHeader<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceNonansiHeader<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -196,7 +197,7 @@ pub struct InterfaceNonansiHeader<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceAnsiHeader<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -210,7 +211,7 @@ pub struct InterfaceAnsiHeader<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum ProgramDeclaration<'a> {
Nonansi(ProgramDeclarationNonansi<'a>),
Ansi(ProgramDeclarationAnsi<'a>),
@ -219,7 +220,7 @@ pub enum ProgramDeclaration<'a> {
ExternAnsi(ProgramDeclarationExternAnsi<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProgramDeclarationNonansi<'a> {
pub nodes: (
ProgramNonansiHeader<'a>,
@ -230,7 +231,7 @@ pub struct ProgramDeclarationNonansi<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProgramDeclarationAnsi<'a> {
pub nodes: (
ProgramAnsiHeader<'a>,
@ -241,7 +242,7 @@ pub struct ProgramDeclarationAnsi<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProgramDeclarationWildcard<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -256,17 +257,17 @@ pub struct ProgramDeclarationWildcard<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProgramDeclarationExternNonansi<'a> {
pub nodes: (Symbol<'a>, ProgramNonansiHeader<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProgramDeclarationExternAnsi<'a> {
pub nodes: (Symbol<'a>, ProgramAnsiHeader<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProgramNonansiHeader<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -280,7 +281,7 @@ pub struct ProgramNonansiHeader<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ProgramAnsiHeader<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -294,7 +295,7 @@ pub struct ProgramAnsiHeader<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct CheckerDeclaration<'a> {
pub nodes: (
Symbol<'a>,
@ -307,7 +308,7 @@ pub struct CheckerDeclaration<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct ClassDeclaration<'a> {
pub nodes: (
Option<Virtual<'a>>,
@ -328,17 +329,17 @@ pub struct ClassDeclaration<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct Virtual<'a> {
pub nodes: (Symbol<'a>,),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceClassType<'a> {
pub nodes: (PsClassIdentifier<'a>, Option<ParameterValueAssignment<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceClassDeclaration<'a> {
pub nodes: (
Symbol<'a>,
@ -353,7 +354,7 @@ pub struct InterfaceClassDeclaration<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum InterfaceClassItem<'a> {
TypeDeclaration(TypeDeclaration<'a>),
Method(InterfaceClassItemMethod<'a>),
@ -362,17 +363,17 @@ pub enum InterfaceClassItem<'a> {
Null(Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceClassItemMethod<'a> {
pub nodes: (Vec<AttributeInstance<'a>>, InterfaceClassMethod<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct InterfaceClassMethod<'a> {
pub nodes: (Symbol<'a>, Symbol<'a>, MethodPrototype<'a>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct PackageDeclaration<'a> {
pub nodes: (
Vec<AttributeInstance<'a>>,
@ -387,7 +388,7 @@ pub struct PackageDeclaration<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub enum TimeunitsDeclaration<'a> {
Timeunit(TimeunitsDeclarationTimeunit<'a>),
Timeprecision(TimeunitsDeclarationTimeprecision<'a>),
@ -395,7 +396,7 @@ pub enum TimeunitsDeclaration<'a> {
TimeprecisionTimeunit(TimeunitsDeclarationTimeprecisionTimeunit<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TimeunitsDeclarationTimeunit<'a> {
pub nodes: (
Symbol<'a>,
@ -405,12 +406,12 @@ pub struct TimeunitsDeclarationTimeunit<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TimeunitsDeclarationTimeprecision<'a> {
pub nodes: (Symbol<'a>, TimeLiteral<'a>, Symbol<'a>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TimeunitsDeclarationTimeunitTimeprecision<'a> {
pub nodes: (
Symbol<'a>,
@ -422,7 +423,7 @@ pub struct TimeunitsDeclarationTimeunitTimeprecision<'a> {
),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct TimeunitsDeclarationTimeprecisionTimeunit<'a> {
pub nodes: (
Symbol<'a>,

View File

@ -7,12 +7,12 @@ use nom::{Err, IResult};
// -----------------------------------------------------------------------------
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SpecifyInputTerminalDescriptor<'a> {
pub nodes: (InputIdentifier<'a>, Option<ConstantRangeExpression<'a>>),
}
#[derive(Debug)]
#[derive(Debug, Node)]
pub struct SpecifyOutputTerminalDescriptor<'a> {
pub nodes: (OutputIdentifier<'a>, Option<ConstantRangeExpression<'a>>),
}