sv_parser_syntaxtree/behavioral_statements/
randsequence.rs

1use crate::*;
2
3// -----------------------------------------------------------------------------
4
5#[derive(Clone, Debug, PartialEq, Node)]
6pub struct RandsequenceStatement {
7    pub nodes: (
8        Keyword,
9        Paren<Option<ProductionIdentifier>>,
10        Production,
11        Vec<Production>,
12        Keyword,
13    ),
14}
15
16#[derive(Clone, Debug, PartialEq, Node)]
17pub struct Production {
18    pub nodes: (
19        Option<DataTypeOrVoid>,
20        ProductionIdentifier,
21        Option<Paren<TfPortList>>,
22        Symbol,
23        List<Symbol, RsRule>,
24        Symbol,
25    ),
26}
27
28#[derive(Clone, Debug, PartialEq, Node)]
29pub struct RsRule {
30    pub nodes: (
31        RsProductionList,
32        Option<(Symbol, WeightSpecification, Option<RsCodeBlock>)>,
33    ),
34}
35
36#[derive(Clone, Debug, PartialEq, Node)]
37pub enum RsProductionList {
38    Prod(Box<RsProductionListProd>),
39    Join(Box<RsProductionListJoin>),
40}
41
42#[derive(Clone, Debug, PartialEq, Node)]
43pub struct RsProductionListProd {
44    pub nodes: (RsProd, Vec<RsProd>),
45}
46
47#[derive(Clone, Debug, PartialEq, Node)]
48pub struct RsProductionListJoin {
49    pub nodes: (
50        Keyword,
51        Keyword,
52        Option<Paren<Expression>>,
53        ProductionItem,
54        ProductionItem,
55        Vec<ProductionItem>,
56    ),
57}
58
59#[derive(Clone, Debug, PartialEq, Node)]
60pub enum WeightSpecification {
61    IntegralNumber(Box<IntegralNumber>),
62    PsIdentifier(Box<PsIdentifier>),
63    Expression(Box<WeightSpecificationExpression>),
64}
65
66#[derive(Clone, Debug, PartialEq, Node)]
67pub struct WeightSpecificationExpression {
68    pub nodes: (Paren<Expression>,),
69}
70
71#[derive(Clone, Debug, PartialEq, Node)]
72pub struct RsCodeBlock {
73    pub nodes: (Brace<(Vec<DataDeclaration>, Vec<StatementOrNull>)>,),
74}
75
76#[derive(Clone, Debug, PartialEq, Node)]
77pub enum RsProd {
78    ProductionItem(Box<ProductionItem>),
79    RsCodeBlock(Box<RsCodeBlock>),
80    RsIfElse(Box<RsIfElse>),
81    RsRepeat(Box<RsRepeat>),
82    RsCase(Box<RsCase>),
83}
84
85#[derive(Clone, Debug, PartialEq, Node)]
86pub struct ProductionItem {
87    pub nodes: (ProductionIdentifier, Option<Paren<ListOfArguments>>),
88}
89
90#[derive(Clone, Debug, PartialEq, Node)]
91pub struct RsIfElse {
92    pub nodes: (
93        Keyword,
94        Paren<Expression>,
95        ProductionItem,
96        Option<(Keyword, ProductionItem)>,
97    ),
98}
99
100#[derive(Clone, Debug, PartialEq, Node)]
101pub struct RsRepeat {
102    pub nodes: (Keyword, Paren<Expression>, ProductionItem),
103}
104
105#[derive(Clone, Debug, PartialEq, Node)]
106pub struct RsCase {
107    pub nodes: (
108        Keyword,
109        Paren<CaseExpression>,
110        RsCaseItem,
111        Vec<RsCaseItem>,
112        Keyword,
113    ),
114}
115
116#[derive(Clone, Debug, PartialEq, Node)]
117pub enum RsCaseItem {
118    NonDefault(Box<RsCaseItemNondefault>),
119    Default(Box<RsCaseItemDefault>),
120}
121
122#[derive(Clone, Debug, PartialEq, Node)]
123pub struct RsCaseItemNondefault {
124    pub nodes: (
125        List<Symbol, CaseItemExpression>,
126        Symbol,
127        ProductionItem,
128        Symbol,
129    ),
130}
131
132#[derive(Clone, Debug, PartialEq, Node)]
133pub struct RsCaseItemDefault {
134    pub nodes: (Keyword, Option<Symbol>, ProductionItem, Symbol),
135}