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
use crate::*;

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

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstraintDeclaration {
    pub nodes: (
        Option<Static>,
        Keyword,
        ConstraintIdentifier,
        ConstraintBlock,
    ),
}

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

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstraintBlock {
    pub nodes: (Brace<Vec<ConstraintBlockItem>>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum ConstraintBlockItem {
    Solve(Box<ConstraintBlockItemSolve>),
    ConstraintExpression(Box<ConstraintExpression>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstraintBlockItemSolve {
    pub nodes: (Keyword, SolveBeforeList, Keyword, SolveBeforeList, Symbol),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct SolveBeforeList {
    pub nodes: (List<Symbol, ConstraintPrimary>,),
}

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

#[derive(Clone, Debug, PartialEq, Node)]
pub enum ConstraintExpression {
    Expression(Box<ConstraintExpressionExpression>),
    UniquenessConstraint(Box<(UniquenessConstraint, Symbol)>),
    Arrow(Box<ConstraintExpressionArrow>),
    If(Box<ConstraintExpressionIf>),
    Foreach(Box<ConstraintExpressionForeach>),
    Disable(Box<ConstraintExpressionDisable>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstraintExpressionExpression {
    pub nodes: (Option<Soft>, ExpressionOrDist, Symbol),
}

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

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstraintExpressionArrow {
    pub nodes: (Expression, Symbol, ConstraintSet),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstraintExpressionIf {
    pub nodes: (
        Keyword,
        Paren<Expression>,
        ConstraintSet,
        Option<(Keyword, ConstraintSet)>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstraintExpressionForeach {
    pub nodes: (
        Keyword,
        Paren<(PsOrHierarchicalArrayIdentifier, Bracket<LoopVariables>)>,
        ConstraintSet,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstraintExpressionDisable {
    pub nodes: (Keyword, Keyword, ConstraintPrimary, Symbol),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct UniquenessConstraint {
    pub nodes: (Keyword, Brace<OpenRangeList>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum ConstraintSet {
    ConstraintExpression(Box<ConstraintExpression>),
    Brace(Box<ConstraintSetBrace>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstraintSetBrace {
    pub nodes: (Brace<Vec<ConstraintExpression>>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct DistList {
    pub nodes: (List<Symbol, DistItem>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct DistItem {
    pub nodes: (ValueRange, Option<DistWeight>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum DistWeight {
    Equal(Box<DistWeightEqual>),
    Divide(Box<DistWeightDivide>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct DistWeightEqual {
    pub nodes: (Symbol, Expression),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct DistWeightDivide {
    pub nodes: (Symbol, Expression),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ConstraintPrototype {
    pub nodes: (
        Option<ConstraintPrototypeQualifier>,
        Option<Static>,
        Keyword,
        ConstraintIdentifier,
        Symbol,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum ConstraintPrototypeQualifier {
    Extern(Box<Keyword>),
    Pure(Box<Keyword>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ExternConstraintDeclaration {
    pub nodes: (
        Option<Static>,
        Keyword,
        ClassScope,
        ConstraintIdentifier,
        ConstraintBlock,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct IdentifierList {
    pub nodes: (List<Symbol, Identifier>,),
}