1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
use crate::*;

// -----------------------------------------------------------------------------

#[derive(Clone, Debug, PartialEq, Node)]
pub enum ConstantPrimary {
    PrimaryLiteral(Box<PrimaryLiteral>),
    PsParameter(Box<ConstantPrimaryPsParameter>),
    Specparam(Box<ConstantPrimarySpecparam>),
    GenvarIdentifier(Box<GenvarIdentifier>),
    FormalPort(Box<ConstantPrimaryFormalPort>),
    Enum(Box<ConstantPrimaryEnum>),
    Concatenation(Box<ConstantPrimaryConcatenation>),
    MultipleConcatenation(Box<ConstantPrimaryMultipleConcatenation>),
    ConstantFunctionCall(Box<ConstantFunctionCall>),
    ConstantLetExpression(Box<ConstantLetExpression>),
    MintypmaxExpression(Box<ConstantPrimaryMintypmaxExpression>),
    ConstantCast(Box<ConstantCast>),
    ConstantAssignmentPatternExpression(Box<ConstantAssignmentPatternExpression>),
    TypeReference(Box<TypeReference>),
    Null(Box<Keyword>),
    Dollar(Box<Keyword>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstantPrimaryPsParameter {
    pub nodes: (PsParameterIdentifier, ConstantSelect),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstantPrimarySpecparam {
    pub nodes: (
        SpecparamIdentifier,
        Option<Bracket<ConstantRangeExpression>>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstantPrimaryFormalPort {
    pub nodes: (FormalPortIdentifier, ConstantSelect),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstantPrimaryEnum {
    pub nodes: (PackageScopeOrClassScope, EnumIdentifier),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstantPrimaryConcatenation {
    pub nodes: (
        ConstantConcatenation,
        Option<Bracket<ConstantRangeExpression>>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstantPrimaryMultipleConcatenation {
    pub nodes: (
        ConstantMultipleConcatenation,
        Option<Bracket<ConstantRangeExpression>>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstantPrimaryMintypmaxExpression {
    pub nodes: (Paren<ConstantMintypmaxExpression>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum ModulePathPrimary {
    Number(Box<Number>),
    Identifier(Box<Identifier>),
    ModulePathConcatenation(Box<ModulePathConcatenation>),
    ModulePathMultipleConcatenation(Box<ModulePathMultipleConcatenation>),
    FunctionSubroutineCall(Box<FunctionSubroutineCall>),
    Mintypmax(Box<ModulePathPrimaryMintypmax>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ModulePathPrimaryMintypmax {
    pub nodes: (Paren<ModulePathMintypmaxExpression>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum Primary {
    PrimaryLiteral(Box<PrimaryLiteral>),
    Hierarchical(Box<PrimaryHierarchical>),
    EmptyUnpackedArrayConcatenation(Box<EmptyUnpackedArrayConcatenation>),
    Concatenation(Box<PrimaryConcatenation>),
    MultipleConcatenation(Box<PrimaryMultipleConcatenation>),
    FunctionSubroutineCall(Box<FunctionSubroutineCall>),
    LetExpression(Box<LetExpression>),
    MintypmaxExpression(Box<PrimaryMintypmaxExpression>),
    Cast(Box<Cast>),
    AssignmentPatternExpression(Box<AssignmentPatternExpression>),
    StreamingConcatenation(Box<StreamingConcatenation>),
    SequenceMethodCall(Box<SequenceMethodCall>),
    This(Box<Keyword>),
    Dollar(Box<Keyword>),
    Null(Box<Keyword>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct PrimaryHierarchical {
    pub nodes: (
        Option<ClassQualifierOrPackageScope>,
        HierarchicalIdentifier,
        Select,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct PrimaryConcatenation {
    pub nodes: (Concatenation, Option<Bracket<RangeExpression>>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct PrimaryMultipleConcatenation {
    pub nodes: (MultipleConcatenation, Option<Bracket<RangeExpression>>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct PrimaryMintypmaxExpression {
    pub nodes: (Paren<MintypmaxExpression>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum ClassQualifierOrPackageScope {
    ClassQualifier(Box<ClassQualifier>),
    PackageScope(Box<PackageScope>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ClassQualifier {
    pub nodes: (Option<Local>, Option<ImplicitClassHandleOrClassScope>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum RangeExpression {
    Expression(Box<Expression>),
    PartSelectRange(Box<PartSelectRange>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum PrimaryLiteral {
    Number(Box<Number>),
    TimeLiteral(Box<TimeLiteral>),
    UnbasedUnsizedLiteral(Box<UnbasedUnsizedLiteral>),
    StringLiteral(Box<StringLiteral>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum TimeLiteral {
    Unsigned(Box<TimeLiteralUnsigned>),
    FixedPoint(Box<TimeLiteralFixedPoint>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct TimeLiteralUnsigned {
    pub nodes: (UnsignedNumber, TimeUnit),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct TimeLiteralFixedPoint {
    pub nodes: (FixedPointNumber, TimeUnit),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum TimeUnit {
    S(Box<Keyword>),
    MS(Box<Keyword>),
    US(Box<Keyword>),
    NS(Box<Keyword>),
    PS(Box<Keyword>),
    FS(Box<Keyword>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum ImplicitClassHandle {
    This(Box<Keyword>),
    Super(Box<Keyword>),
    ThisSuper(Box<(Keyword, Symbol, Keyword)>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BitSelect {
    pub nodes: (Vec<Bracket<Expression>>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct Select {
    pub nodes: (
        Option<(
            Vec<(Symbol, MemberIdentifier, BitSelect)>,
            Symbol,
            MemberIdentifier,
        )>,
        BitSelect,
        Option<Bracket<PartSelectRange>>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct NonrangeSelect {
    pub nodes: (
        Option<(
            Vec<(Symbol, MemberIdentifier, BitSelect)>,
            Symbol,
            MemberIdentifier,
        )>,
        BitSelect,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstantBitSelect {
    pub nodes: (Vec<Bracket<ConstantExpression>>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstantSelect {
    pub nodes: (
        Option<(
            Vec<(Symbol, MemberIdentifier, ConstantBitSelect)>,
            Symbol,
            MemberIdentifier,
        )>,
        ConstantBitSelect,
        Option<Bracket<ConstantPartSelectRange>>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstantCast {
    pub nodes: (CastingType, Symbol, Paren<ConstantExpression>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstantLetExpression {
    pub nodes: (LetExpression,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct Cast {
    pub nodes: (CastingType, Symbol, Paren<Expression>),
}