rumoca 0.7.2

Modelica compiler written in RUST
Documentation
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
%start stored_definition
%title "Modelica grammar"
%comment "Modelica grammar 3.7-dev for `parol`"
%line_comment "//"
%block_comment "/\*" "\*/"
%nt_type algorithm_section = crate::modelica_grammar::AlgorithmSection
%nt_type argument = crate::ir::ast::Expression
%nt_type argument_list = crate::modelica_grammar::ExpressionList
%nt_type arithmetic_expression = crate::ir::ast::Expression
%nt_type array_subscripts = crate::modelica_grammar::ArraySubscripts
%nt_type class_definition = crate::ir::ast::ClassDefinition
%nt_type component_list = crate::modelica_grammar::ComponentList
%nt_type component_ref_part = crate::ir::ast::ComponentRefPart
%nt_type component_reference = crate::ir::ast::ComponentReference
%nt_type composition = crate::modelica_grammar::Composition
%nt_type description_string = crate::modelica_grammar::TokenList
%nt_type element_list = crate::modelica_grammar::ElementList
%nt_type equation_block = crate::ir::ast::EquationBlock
%nt_type equation_section = crate::modelica_grammar::EquationSection
%nt_type expression = crate::ir::ast::Expression
%nt_type factor = crate::ir::ast::Expression
%nt_type function_argument = crate::ir::ast::Expression
%nt_type function_arguments = crate::modelica_grammar::ExpressionList
%nt_type function_arguments_non_first = crate::modelica_grammar::ExpressionList
%nt_type function_call_args = crate::modelica_grammar::ExpressionList
%nt_type ident = crate::ir::ast::Token
%nt_type logical_expression = crate::ir::ast::Expression
%nt_type logical_factor = crate::ir::ast::Expression
%nt_type logical_term = crate::ir::ast::Expression
%nt_type name = crate::ir::ast::Name
%nt_type output_expression_list = crate::modelica_grammar::ExpressionList
%nt_type primary = crate::ir::ast::Expression
%nt_type relation = crate::ir::ast::Expression
%nt_type simple_expression = crate::ir::ast::Expression
%nt_type some_equation = crate::ir::ast::Equation
%nt_type statement = crate::ir::ast::Statement
%nt_type statement_block = crate::ir::ast::StatementBlock
%nt_type stored_definition = crate::ir::ast::StoredDefinition
%nt_type string = crate::ir::ast::Token
%nt_type subscript = crate::ir::ast::Subscript
%nt_type term = crate::ir::ast::Expression
%nt_type unsigned_integer = crate::ir::ast::Token
%nt_type unsigned_real = crate::ir::ast::Token
%t_type crate::ir::ast::Token

%%

/*   0 */ algorithm: 'algorithm';
/*   1 */ and: 'and';
/*   2 */ annotation: 'annotation';
/*   3 */ block: 'block';
/*   4 */ break: 'break';
/*   5 */ class: 'class';
/*   6 */ connect: 'connect';
/*   7 */ connector: 'connector';
/*   8 */ constant: 'constant';
/*   9 */ constrainedby: 'constrainedby';
/*  10 */ der: 'der';
/*  11 */ discrete: 'discrete';
/*  12 */ each: 'each';
/*  13 */ else: 'else';
/*  14 */ elseif: 'elseif';
/*  15 */ elsewhen: 'elsewhen';
/*  16 */ encapsulated: 'encapsulated';
/*  17 */ end: 'end';
/*  18 */ enumeration: 'enumeration';
/*  19 */ equation: 'equation';
/*  20 */ expandable: 'expandable';
/*  21 */ extends: 'extends';
/*  22 */ external: 'external';
/*  23 */ false: 'false';
/*  24 */ final: 'final';
/*  25 */ flow: 'flow';
/*  26 */ for: 'for';
/*  27 */ function: 'function';
/*  28 */ if: 'if';
/*  29 */ import: 'import';
/*  30 */ impure: 'impure';
/*  31 */ in: 'in';
/*  32 */ initial: 'initial';
/*  33 */ inner: 'inner';
/*  34 */ input: 'input';
/*  35 */ loop: 'loop';
/*  36 */ model: 'model';
/*  37 */ not: 'not';
/*  38 */ operator: 'operator';
/*  39 */ or: 'or';
/*  40 */ outer: 'outer';
/*  41 */ output: 'output';
/*  42 */ package: 'package';
/*  43 */ parameter: 'parameter';
/*  44 */ partial: 'partial';
/*  45 */ protected: 'protected';
/*  46 */ public: 'public';
/*  47 */ pure: 'pure';
/*  48 */ record: 'record';
/*  49 */ redeclare: 'redeclare';
/*  50 */ replaceable: 'replaceable';
/*  51 */ return: 'return';
/*  52 */ stream: 'stream';
/*  53 */ then: 'then';
/*  54 */ true: 'true';
/*  55 */ type: 'type';
/*  56 */ when: 'when';
/*  57 */ while: 'while';
/*  58 */ within: 'within';
/*  59 */ ident: /[_a-zA-Z][_a-zA-Z0-9]*/@basic_ident;
/*  60 */ ident: /\'[_a-zA-Z0-9!#\$%&\(\)\*\+,-\.\/:;<>=\?@\[\]\^\{\}\|~ \"]*\'/@q_ident;
/*  61 */ string: /"[' \w]*"/;
/*  62 */ unsigned_integer: /[0-9]+/;
/*  63 */ unsigned_real: /[0-9]+\.[0-9]+/@decimal;
/*  64 */ unsigned_real: /[0-9]+\.([0-9]+)?([eE][+-]?[0-9]+)?/@scientific;
/*  65 */ unsigned_real: /\.[0-9]+([eE][+-]?[0-9]+)?/@scientific2;
/*  66 */ stored_definition: stored_definitionOpt /* Option */ stored_definitionList /* Vec */;
/*  67 */ stored_definitionList /* Vec<T>::Push */: stored_definitionOpt0 /* Option */ class_definition ';'^ /* Clipped */ stored_definitionList;
/*  68 */ stored_definitionList /* Vec<T>::New */: ;
/*  69 */ stored_definitionOpt0 /* Option<T>::Some */: final;
/*  70 */ stored_definitionOpt0 /* Option<T>::None */: ;
/*  71 */ stored_definitionOpt /* Option<T>::Some */: within^ /* Clipped */ stored_definitionOpt1 /* Option */ ';'^ /* Clipped */;
/*  72 */ stored_definitionOpt1 /* Option<T>::Some */: name;
/*  73 */ stored_definitionOpt1 /* Option<T>::None */: ;
/*  74 */ stored_definitionOpt /* Option<T>::None */: ;
/*  75 */ class_definition: class_definitionOpt /* Option */ class_prefixes class_specifier;
/*  76 */ class_definitionOpt /* Option<T>::Some */: encapsulated;
/*  77 */ class_definitionOpt /* Option<T>::None */: ;
/*  78 */ class_type: class;
/*  79 */ class_type: model;
/*  80 */ class_type: class_typeOpt /* Option */ record;
/*  81 */ class_type: block;
/*  82 */ class_type: class_typeOpt0 /* Option */ connector;
/*  83 */ class_type: type;
/*  84 */ class_type: package;
/*  85 */ class_type: class_typeOpt1 /* Option */ class_typeOpt2 /* Option */ function;
/*  86 */ class_type: operator;
/*  87 */ class_typeOpt2 /* Option<T>::Some */: operator;
/*  88 */ class_typeOpt2 /* Option<T>::None */: ;
/*  89 */ class_typeOpt1 /* Option<T>::Some */: class_typeOpt1Group;
/*  90 */ class_typeOpt1Group: pure;
/*  91 */ class_typeOpt1Group: impure;
/*  92 */ class_typeOpt1 /* Option<T>::None */: ;
/*  93 */ class_typeOpt0 /* Option<T>::Some */: expandable;
/*  94 */ class_typeOpt0 /* Option<T>::None */: ;
/*  95 */ class_typeOpt /* Option<T>::Some */: operator;
/*  96 */ class_typeOpt /* Option<T>::None */: ;
/*  97 */ class_prefixes: class_prefixesOpt /* Option */ class_type;
/*  98 */ class_prefixesOpt /* Option<T>::Some */: partial;
/*  99 */ class_prefixesOpt /* Option<T>::None */: ;
/* 100 */ class_specifier: long_class_specifier;
/* 101 */ class_specifier: short_class_specifier;
/* 102 */ class_specifier: der_class_specifier;
/* 103 */ long_class_specifier: standard_class_specifier;
/* 104 */ long_class_specifier: extends_class_specifier;
/* 105 */ standard_class_specifier: ident@name description_string composition end^ /* Clipped */ ident;
/* 106 */ extends_class_specifier: extends^ /* Clipped */ ident extends_class_specifierOpt /* Option */ description_string composition end^ /* Clipped */ ident;
/* 107 */ extends_class_specifierOpt /* Option<T>::Some */: class_modification;
/* 108 */ extends_class_specifierOpt /* Option<T>::None */: ;
/* 109 */ short_class_specifier: type_class_specifier;
/* 110 */ short_class_specifier: enum_class_specifier;
/* 111 */ type_class_specifier: ident '='^ /* Clipped */ base_prefix type_specifier type_class_specifierOpt /* Option */ type_class_specifierOpt0 /* Option */ description;
/* 112 */ type_class_specifierOpt0 /* Option<T>::Some */: class_modification;
/* 113 */ type_class_specifierOpt0 /* Option<T>::None */: ;
/* 114 */ type_class_specifierOpt /* Option<T>::Some */: array_subscripts;
/* 115 */ type_class_specifierOpt /* Option<T>::None */: ;
/* 116 */ enum_class_specifier: ident '='^ /* Clipped */ enumeration '('^ /* Clipped */ enum_class_specifierGroup ')'^ /* Clipped */ description;
/* 117 */ enum_class_specifierGroup: enum_class_specifierOpt /* Option */;
/* 118 */ enum_class_specifierGroup: ':'^ /* Clipped */;
/* 119 */ enum_class_specifierOpt /* Option<T>::Some */: enum_list;
/* 120 */ enum_class_specifierOpt /* Option<T>::None */: ;
/* 121 */ der_class_specifier: ident '='^ /* Clipped */ der '('^ /* Clipped */ type_specifier ','^ /* Clipped */ ident der_class_specifierList /* Vec */ ')'^ /* Clipped */ description;
/* 122 */ der_class_specifierList /* Vec<T>::Push */: ','^ /* Clipped */ ident der_class_specifierList;
/* 123 */ der_class_specifierList /* Vec<T>::New */: ;
/* 124 */ base_prefix: base_prefixOpt /* Option */;
/* 125 */ base_prefixOpt /* Option<T>::Some */: base_prefixOptGroup;
/* 126 */ base_prefixOptGroup: input;
/* 127 */ base_prefixOptGroup: output;
/* 128 */ base_prefixOpt /* Option<T>::None */: ;
/* 129 */ enum_list: enumeration_literal enum_listList /* Vec */;
/* 130 */ enum_listList /* Vec<T>::Push */: ','^ /* Clipped */ enumeration_literal enum_listList;
/* 131 */ enum_listList /* Vec<T>::New */: ;
/* 132 */ enumeration_literal: ident description;
/* 133 */ composition: element_list compositionList /* Vec */ compositionOpt /* Option */ compositionOpt0 /* Option */;
/* 134 */ compositionList /* Vec<T>::Push */: compositionListGroup compositionList;
/* 135 */ compositionListGroup: public element_list;
/* 136 */ compositionListGroup: protected element_list;
/* 137 */ compositionListGroup: equation_section;
/* 138 */ compositionListGroup: algorithm_section;
/* 139 */ compositionList /* Vec<T>::New */: ;
/* 140 */ compositionOpt0 /* Option<T>::Some */: annotation_clause ';'^ /* Clipped */;
/* 141 */ compositionOpt0 /* Option<T>::None */: ;
/* 142 */ compositionOpt /* Option<T>::Some */: external^ /* Clipped */ compositionOpt1 /* Option */ compositionOpt2 /* Option */ compositionOpt3 /* Option */ ';'^ /* Clipped */;
/* 143 */ compositionOpt3 /* Option<T>::Some */: annotation_clause;
/* 144 */ compositionOpt3 /* Option<T>::None */: ;
/* 145 */ compositionOpt2 /* Option<T>::Some */: external_function_call;
/* 146 */ compositionOpt2 /* Option<T>::None */: ;
/* 147 */ compositionOpt1 /* Option<T>::Some */: language_specification;
/* 148 */ compositionOpt1 /* Option<T>::None */: ;
/* 149 */ compositionOpt /* Option<T>::None */: ;
/* 150 */ language_specification: string;
/* 151 */ external_function_call: external_function_callOpt /* Option */ ident '('^ /* Clipped */ external_function_callOpt0 /* Option */ ')'^ /* Clipped */;
/* 152 */ external_function_callOpt0 /* Option<T>::Some */: expression_list;
/* 153 */ external_function_callOpt0 /* Option<T>::None */: ;
/* 154 */ external_function_callOpt /* Option<T>::Some */: component_reference '='^ /* Clipped */;
/* 155 */ external_function_callOpt /* Option<T>::None */: ;
/* 156 */ element_list: element_listList /* Vec */;
/* 157 */ element_listList /* Vec<T>::Push */: element ';'^ /* Clipped */ element_listList;
/* 158 */ element_listList /* Vec<T>::New */: ;
/* 159 */ element: import_clause;
/* 160 */ element: extends_clause;
/* 161 */ element: element_definition;
/* 162 */ element: element_replaceable_definition;
/* 163 */ element_definition: element_definitionOpt /* Option */ element_definitionOpt0 /* Option */ element_definitionOpt1 /* Option */ element_definitionOpt2 /* Option */ element_definitionGroup;
/* 164 */ element_definitionGroup: class_definition;
/* 165 */ element_definitionGroup: component_clause;
/* 166 */ element_definitionOpt2 /* Option<T>::Some */: outer;
/* 167 */ element_definitionOpt2 /* Option<T>::None */: ;
/* 168 */ element_definitionOpt1 /* Option<T>::Some */: inner;
/* 169 */ element_definitionOpt1 /* Option<T>::None */: ;
/* 170 */ element_definitionOpt0 /* Option<T>::Some */: final;
/* 171 */ element_definitionOpt0 /* Option<T>::None */: ;
/* 172 */ element_definitionOpt /* Option<T>::Some */: redeclare;
/* 173 */ element_definitionOpt /* Option<T>::None */: ;
/* 174 */ element_replaceable_definition: replaceable element_replaceable_definitionGroup element_replaceable_definitionOpt /* Option */;
/* 175 */ element_replaceable_definitionGroup: class_definition;
/* 176 */ element_replaceable_definitionGroup: component_clause;
/* 177 */ element_replaceable_definitionOpt /* Option<T>::Some */: constraining_clause description;
/* 178 */ element_replaceable_definitionOpt /* Option<T>::None */: ;
/* 179 */ import_clause: import import_clauseGroup description;
/* 180 */ import_clauseGroup: ident '='^ /* Clipped */ name;
/* 181 */ import_clauseGroup: name import_clauseOpt /* Option */;
/* 182 */ import_clauseOpt /* Option<T>::Some */: import_clauseOptGroup;
/* 183 */ import_clauseOptGroup: '.*';
/* 184 */ import_clauseOptGroup: '.' import_clauseOptGroupGroup;
/* 185 */ import_clauseOptGroupGroup: '*';
/* 186 */ import_clauseOptGroupGroup: '{'^ /* Clipped */ import_list '}'^ /* Clipped */;
/* 187 */ import_clauseOpt /* Option<T>::None */: ;
/* 188 */ import_list: ident import_listList /* Vec */;
/* 189 */ import_listList /* Vec<T>::Push */: ','^ /* Clipped */ ident import_listList;
/* 190 */ import_listList /* Vec<T>::New */: ;
/* 191 */ extends_clause: extends^ /* Clipped */ type_specifier extends_clauseOpt /* Option */ extends_clauseOpt0 /* Option */;
/* 192 */ extends_clauseOpt0 /* Option<T>::Some */: annotation_clause;
/* 193 */ extends_clauseOpt0 /* Option<T>::None */: ;
/* 194 */ extends_clauseOpt /* Option<T>::Some */: class_or_inheritance_modification;
/* 195 */ extends_clauseOpt /* Option<T>::None */: ;
/* 196 */ constraining_clause: constrainedby^ /* Clipped */ type_specifier constraining_clauseOpt /* Option */;
/* 197 */ constraining_clauseOpt /* Option<T>::Some */: class_modification;
/* 198 */ constraining_clauseOpt /* Option<T>::None */: ;
/* 199 */ class_or_inheritance_modification: '('^ /* Clipped */ class_or_inheritance_modificationOpt /* Option */ ')'^ /* Clipped */;
/* 200 */ class_or_inheritance_modificationOpt /* Option<T>::Some */: argument_or_inheritance_modification_list;
/* 201 */ class_or_inheritance_modificationOpt /* Option<T>::None */: ;
/* 202 */ argument_or_inheritance_modification_list: argument_or_inheritance_modification_listGroup argument_or_inheritance_modification_listList /* Vec */;
/* 203 */ argument_or_inheritance_modification_listGroup: argument;
/* 204 */ argument_or_inheritance_modification_listGroup: inheritance_modification;
/* 205 */ argument_or_inheritance_modification_listList /* Vec<T>::Push */: ','^ /* Clipped */ argument_or_inheritance_modification_listListGroup argument_or_inheritance_modification_listList;
/* 206 */ argument_or_inheritance_modification_listListGroup: argument;
/* 207 */ argument_or_inheritance_modification_listListGroup: inheritance_modification;
/* 208 */ argument_or_inheritance_modification_listList /* Vec<T>::New */: ;
/* 209 */ inheritance_modification: break^ /* Clipped */ inheritance_modificationGroup;
/* 210 */ inheritance_modificationGroup: connect_equation;
/* 211 */ inheritance_modificationGroup: ident;
/* 212 */ component_clause: type_prefix type_specifier component_clauseOpt /* Option */ component_list;
/* 213 */ component_clauseOpt /* Option<T>::Some */: array_subscripts;
/* 214 */ component_clauseOpt /* Option<T>::None */: ;
/* 215 */ type_prefix: type_prefixOpt /* Option */ type_prefixOpt0 /* Option */ type_prefixOpt1 /* Option */;
/* 216 */ type_prefixOpt1 /* Option<T>::Some */: type_prefixOpt1Group;
/* 217 */ type_prefixOpt1Group: input;
/* 218 */ type_prefixOpt1Group: output;
/* 219 */ type_prefixOpt1 /* Option<T>::None */: ;
/* 220 */ type_prefixOpt0 /* Option<T>::Some */: type_prefixOpt0Group;
/* 221 */ type_prefixOpt0Group: discrete;
/* 222 */ type_prefixOpt0Group: parameter;
/* 223 */ type_prefixOpt0Group: constant;
/* 224 */ type_prefixOpt0 /* Option<T>::None */: ;
/* 225 */ type_prefixOpt /* Option<T>::Some */: type_prefixOptGroup;
/* 226 */ type_prefixOptGroup: flow;
/* 227 */ type_prefixOptGroup: stream;
/* 228 */ type_prefixOpt /* Option<T>::None */: ;
/* 229 */ component_list: component_declaration component_listList /* Vec */;
/* 230 */ component_listList /* Vec<T>::Push */: ','^ /* Clipped */ component_declaration component_listList;
/* 231 */ component_listList /* Vec<T>::New */: ;
/* 232 */ component_declaration: declaration component_declarationOpt /* Option */ description;
/* 233 */ component_declarationOpt /* Option<T>::Some */: condition_attribute;
/* 234 */ component_declarationOpt /* Option<T>::None */: ;
/* 235 */ condition_attribute: if^ /* Clipped */ expression;
/* 236 */ declaration: ident declarationOpt /* Option */ declarationOpt0 /* Option */;
/* 237 */ declarationOpt0 /* Option<T>::Some */: modification;
/* 238 */ declarationOpt0 /* Option<T>::None */: ;
/* 239 */ declarationOpt /* Option<T>::Some */: array_subscripts;
/* 240 */ declarationOpt /* Option<T>::None */: ;
/* 241 */ modification: class_modification modificationOpt /* Option */;
/* 242 */ modification: '='^ /* Clipped */ modification_expression;
/* 243 */ modificationOpt /* Option<T>::Some */: '='^ /* Clipped */ modification_expression;
/* 244 */ modificationOpt /* Option<T>::None */: ;
/* 245 */ modification_expression: expression;
/* 246 */ modification_expression: break;
/* 247 */ class_modification: '('^ /* Clipped */ class_modificationOpt /* Option */ ')'^ /* Clipped */;
/* 248 */ class_modificationOpt /* Option<T>::Some */: argument_list;
/* 249 */ class_modificationOpt /* Option<T>::None */: ;
/* 250 */ argument_list: argument argument_listList /* Vec */;
/* 251 */ argument_listList /* Vec<T>::Push */: ','^ /* Clipped */ argument argument_listList;
/* 252 */ argument_listList /* Vec<T>::New */: ;
/* 253 */ argument: element_modification_or_replaceable;
/* 254 */ argument: element_redeclaration;
/* 255 */ element_modification_or_replaceable: element_modification_or_replaceableOpt /* Option */ element_modification_or_replaceableOpt0 /* Option */ element_modification_or_replaceableGroup;
/* 256 */ element_modification_or_replaceableGroup: element_modification;
/* 257 */ element_modification_or_replaceableGroup: element_replaceable;
/* 258 */ element_modification_or_replaceableOpt0 /* Option<T>::Some */: final;
/* 259 */ element_modification_or_replaceableOpt0 /* Option<T>::None */: ;
/* 260 */ element_modification_or_replaceableOpt /* Option<T>::Some */: each;
/* 261 */ element_modification_or_replaceableOpt /* Option<T>::None */: ;
/* 262 */ element_modification: name element_modificationOpt /* Option */ description_string;
/* 263 */ element_modificationOpt /* Option<T>::Some */: modification;
/* 264 */ element_modificationOpt /* Option<T>::None */: ;
/* 265 */ element_redeclaration: redeclare element_redeclarationOpt /* Option */ element_redeclarationOpt0 /* Option */ element_redeclarationGroup;
/* 266 */ element_redeclarationGroup: short_class_definition;
/* 267 */ element_redeclarationGroup: component_clause1;
/* 268 */ element_redeclarationGroup: element_replaceable;
/* 269 */ element_redeclarationOpt0 /* Option<T>::Some */: final;
/* 270 */ element_redeclarationOpt0 /* Option<T>::None */: ;
/* 271 */ element_redeclarationOpt /* Option<T>::Some */: each;
/* 272 */ element_redeclarationOpt /* Option<T>::None */: ;
/* 273 */ element_replaceable: replaceable element_replaceableGroup element_replaceableOpt /* Option */;
/* 274 */ element_replaceableGroup: short_class_definition;
/* 275 */ element_replaceableGroup: component_clause1;
/* 276 */ element_replaceableOpt /* Option<T>::Some */: constraining_clause;
/* 277 */ element_replaceableOpt /* Option<T>::None */: ;
/* 278 */ component_clause1: type_prefix type_specifier component_declaration1;
/* 279 */ component_declaration1: declaration description;
/* 280 */ short_class_definition: class_prefixes short_class_specifier;
/* 281 */ equation_section: equation_sectionOpt /* Option */ equation^ /* Clipped */ equation_sectionList /* Vec */;
/* 282 */ equation_sectionList /* Vec<T>::Push */: some_equation ';'^ /* Clipped */ equation_sectionList;
/* 283 */ equation_sectionList /* Vec<T>::New */: ;
/* 284 */ equation_sectionOpt /* Option<T>::Some */: initial^ /* Clipped */;
/* 285 */ equation_sectionOpt /* Option<T>::None */: ;
/* 286 */ algorithm_section: algorithm_sectionOpt /* Option */ algorithm^ /* Clipped */ algorithm_sectionList /* Vec */;
/* 287 */ algorithm_sectionList /* Vec<T>::Push */: statement ';'^ /* Clipped */ algorithm_sectionList;
/* 288 */ algorithm_sectionList /* Vec<T>::New */: ;
/* 289 */ algorithm_sectionOpt /* Option<T>::Some */: initial^ /* Clipped */;
/* 290 */ algorithm_sectionOpt /* Option<T>::None */: ;
/* 291 */ some_equation_option: simple_equation;
/* 292 */ some_equation_option: if_equation;
/* 293 */ some_equation_option: for_equation;
/* 294 */ some_equation_option: connect_equation;
/* 295 */ some_equation_option: when_equation;
/* 296 */ simple_equation: simple_expression simple_equationOpt /* Option */;
/* 297 */ simple_equationOpt /* Option<T>::Some */: '='^ /* Clipped */ expression;
/* 298 */ simple_equationOpt /* Option<T>::None */: ;
/* 299 */ some_equation: some_equation_option description;
/* 300 */ statement_option: component_statement;
/* 301 */ statement_option: function_call_output_statement;
/* 302 */ statement_option: break;
/* 303 */ statement_option: return;
/* 304 */ statement_option: if_statement;
/* 305 */ statement_option: for_statement;
/* 306 */ statement_option: while_statement;
/* 307 */ statement_option: when_statement;
/* 308 */ component_statement: component_reference component_statementGroup;
/* 309 */ component_statementGroup: ':='^ /* Clipped */ expression;
/* 310 */ component_statementGroup: function_call_args;
/* 311 */ function_call_output_statement: '('^ /* Clipped */ output_expression_list ')'^ /* Clipped */ ':='^ /* Clipped */ component_reference function_call_args;
/* 312 */ statement: statement_option description;
/* 313 */ equation_block: expression then^ /* Clipped */ equation_blockList /* Vec */;
/* 314 */ equation_blockList /* Vec<T>::Push */: some_equation ';'^ /* Clipped */ equation_blockList;
/* 315 */ equation_blockList /* Vec<T>::New */: ;
/* 316 */ if_equation: if^ /* Clipped */ equation_block@if if_equationList /* Vec */ if_equationOpt /* Option */ end^ /* Clipped */ if^ /* Clipped */;
/* 317 */ if_equationList /* Vec<T>::Push */: elseif^ /* Clipped */ equation_block@elseif if_equationList;
/* 318 */ if_equationList /* Vec<T>::New */: ;
/* 319 */ if_equationOpt /* Option<T>::Some */: else^ /* Clipped */ if_equationOptList /* Vec */;
/* 320 */ if_equationOptList /* Vec<T>::Push */: some_equation ';'^ /* Clipped */ if_equationOptList;
/* 321 */ if_equationOptList /* Vec<T>::New */: ;
/* 322 */ if_equationOpt /* Option<T>::None */: ;
/* 323 */ statement_block: expression then^ /* Clipped */ statement_blockList /* Vec */;
/* 324 */ statement_blockList /* Vec<T>::Push */: statement ';'^ /* Clipped */ statement_blockList;
/* 325 */ statement_blockList /* Vec<T>::New */: ;
/* 326 */ if_statement: if^ /* Clipped */ statement_block@if if_statementList /* Vec */ if_statementOpt /* Option */ end^ /* Clipped */ if^ /* Clipped */;
/* 327 */ if_statementList /* Vec<T>::Push */: elseif^ /* Clipped */ statement_block@elseif if_statementList;
/* 328 */ if_statementList /* Vec<T>::New */: ;
/* 329 */ if_statementOpt /* Option<T>::Some */: else^ /* Clipped */ if_statementOptList /* Vec */;
/* 330 */ if_statementOptList /* Vec<T>::Push */: statement@else ';'^ /* Clipped */ if_statementOptList;
/* 331 */ if_statementOptList /* Vec<T>::New */: ;
/* 332 */ if_statementOpt /* Option<T>::None */: ;
/* 333 */ for_equation: for^ /* Clipped */ for_indices loop^ /* Clipped */ for_equationList /* Vec */ end^ /* Clipped */ for^ /* Clipped */;
/* 334 */ for_equationList /* Vec<T>::Push */: some_equation ';'^ /* Clipped */ for_equationList;
/* 335 */ for_equationList /* Vec<T>::New */: ;
/* 336 */ for_statement: for^ /* Clipped */ for_indices loop^ /* Clipped */ for_statementList /* Vec */ end^ /* Clipped */ for^ /* Clipped */;
/* 337 */ for_statementList /* Vec<T>::Push */: statement ';'^ /* Clipped */ for_statementList;
/* 338 */ for_statementList /* Vec<T>::New */: ;
/* 339 */ for_indices: for_index for_indicesList /* Vec */;
/* 340 */ for_indicesList /* Vec<T>::Push */: ','^ /* Clipped */ for_index for_indicesList;
/* 341 */ for_indicesList /* Vec<T>::New */: ;
/* 342 */ for_index: ident for_indexOpt /* Option */;
/* 343 */ for_indexOpt /* Option<T>::Some */: in^ /* Clipped */ expression;
/* 344 */ for_indexOpt /* Option<T>::None */: ;
/* 345 */ while_statement: while^ /* Clipped */ expression loop^ /* Clipped */ while_statementList /* Vec */ end^ /* Clipped */ while^ /* Clipped */;
/* 346 */ while_statementList /* Vec<T>::Push */: statement ';'^ /* Clipped */ while_statementList;
/* 347 */ while_statementList /* Vec<T>::New */: ;
/* 348 */ when_equation: when^ /* Clipped */ equation_block@when when_equationList /* Vec */ end^ /* Clipped */ when^ /* Clipped */;
/* 349 */ when_equationList /* Vec<T>::Push */: elsewhen^ /* Clipped */ equation_block@elsewhen when_equationList;
/* 350 */ when_equationList /* Vec<T>::New */: ;
/* 351 */ when_statement: when^ /* Clipped */ statement_block@when when_statementList /* Vec */ end^ /* Clipped */ when^ /* Clipped */;
/* 352 */ when_statementList /* Vec<T>::Push */: elsewhen^ /* Clipped */ statement_block@elsewhen when_statementList;
/* 353 */ when_statementList /* Vec<T>::New */: ;
/* 354 */ connect_equation: connect^ /* Clipped */ '('^ /* Clipped */ component_reference ','^ /* Clipped */ component_reference ')'^ /* Clipped */;
/* 355 */ expression: simple_expression;
/* 356 */ expression: if_expression;
/* 357 */ if_expression: if^ /* Clipped */ expression then^ /* Clipped */ expression if_expressionList /* Vec */ else^ /* Clipped */ expression;
/* 358 */ if_expressionList /* Vec<T>::Push */: elseif^ /* Clipped */ expression then^ /* Clipped */ expression if_expressionList;
/* 359 */ if_expressionList /* Vec<T>::New */: ;
/* 360 */ simple_expression: logical_expression simple_expressionOpt /* Option */;
/* 361 */ simple_expressionOpt /* Option<T>::Some */: ':'^ /* Clipped */ logical_expression simple_expressionOpt0 /* Option */;
/* 362 */ simple_expressionOpt0 /* Option<T>::Some */: ':'^ /* Clipped */ logical_expression;
/* 363 */ simple_expressionOpt0 /* Option<T>::None */: ;
/* 364 */ simple_expressionOpt /* Option<T>::None */: ;
/* 365 */ logical_expression: logical_term logical_expressionList /* Vec */;
/* 366 */ logical_expressionList /* Vec<T>::Push */: or^ /* Clipped */ logical_term logical_expressionList;
/* 367 */ logical_expressionList /* Vec<T>::New */: ;
/* 368 */ logical_term: logical_factor logical_termList /* Vec */;
/* 369 */ logical_termList /* Vec<T>::Push */: and^ /* Clipped */ logical_factor logical_termList;
/* 370 */ logical_termList /* Vec<T>::New */: ;
/* 371 */ logical_factor: logical_factorOpt /* Option */ relation;
/* 372 */ logical_factorOpt /* Option<T>::Some */: not;
/* 373 */ logical_factorOpt /* Option<T>::None */: ;
/* 374 */ relation: arithmetic_expression relationOpt /* Option */;
/* 375 */ relationOpt /* Option<T>::Some */: relational_operator arithmetic_expression;
/* 376 */ relationOpt /* Option<T>::None */: ;
/* 377 */ relational_operator: '<';
/* 378 */ relational_operator: '<=';
/* 379 */ relational_operator: '>';
/* 380 */ relational_operator: '>=';
/* 381 */ relational_operator: '==';
/* 382 */ relational_operator: '<>';
/* 383 */ arithmetic_expression: arithmetic_expressionOpt /* Option */ term arithmetic_expressionList /* Vec */;
/* 384 */ arithmetic_expressionList /* Vec<T>::Push */: add_operator term arithmetic_expressionList;
/* 385 */ arithmetic_expressionList /* Vec<T>::New */: ;
/* 386 */ arithmetic_expressionOpt /* Option<T>::Some */: add_operator;
/* 387 */ arithmetic_expressionOpt /* Option<T>::None */: ;
/* 388 */ add_operator: '+';
/* 389 */ add_operator: '-';
/* 390 */ add_operator: '.+';
/* 391 */ add_operator: '.-';
/* 392 */ term: factor termList /* Vec */;
/* 393 */ termList /* Vec<T>::Push */: mul_operator factor termList;
/* 394 */ termList /* Vec<T>::New */: ;
/* 395 */ mul_operator: '*';
/* 396 */ mul_operator: '/';
/* 397 */ mul_operator: '.*';
/* 398 */ mul_operator: './';
/* 399 */ factor: primary factorList /* Vec */;
/* 400 */ factorList /* Vec<T>::Push */: factorListGroup primary factorList;
/* 401 */ factorListGroup: '^';
/* 402 */ factorListGroup: '.^';
/* 403 */ factorList /* Vec<T>::New */: ;
/* 404 */ primary: unsigned_number;
/* 405 */ primary: string;
/* 406 */ primary: false;
/* 407 */ primary: true;
/* 408 */ primary: global_function_call;
/* 409 */ primary: component_primary;
/* 410 */ primary: output_primary;
/* 411 */ primary: range_primary;
/* 412 */ primary: array_primary;
/* 413 */ primary: end;
/* 414 */ component_primary: component_reference component_primaryOpt /* Option */;
/* 415 */ component_primaryOpt /* Option<T>::Some */: function_call_args;
/* 416 */ component_primaryOpt /* Option<T>::None */: ;
/* 417 */ output_primary: '('^ /* Clipped */ output_expression_list ')'^ /* Clipped */ output_primaryOpt /* Option */;
/* 418 */ output_primaryOpt /* Option<T>::Some */: output_primaryOptGroup;
/* 419 */ output_primaryOptGroup: array_subscripts;
/* 420 */ output_primaryOptGroup: '.'^ /* Clipped */ ident;
/* 421 */ output_primaryOpt /* Option<T>::None */: ;
/* 422 */ range_primary: '['^ /* Clipped */ expression_list range_primaryList /* Vec */ ']'^ /* Clipped */;
/* 423 */ range_primaryList /* Vec<T>::Push */: ';'^ /* Clipped */ expression_list range_primaryList;
/* 424 */ range_primaryList /* Vec<T>::New */: ;
/* 425 */ array_primary: '{'^ /* Clipped */ array_arguments '}'^ /* Clipped */;
/* 426 */ global_function_call: global_function_callGroup function_call_args;
/* 427 */ global_function_callGroup: der;
/* 428 */ global_function_callGroup: initial;
/* 429 */ global_function_callGroup: pure;
/* 430 */ unsigned_number: unsigned_integer;
/* 431 */ unsigned_number: unsigned_real;
/* 432 */ type_specifier: type_specifierOpt /* Option */ name;
/* 433 */ type_specifierOpt /* Option<T>::Some */: '.'^ /* Clipped */;
/* 434 */ type_specifierOpt /* Option<T>::None */: ;
/* 435 */ name: ident nameList /* Vec */;
/* 436 */ nameList /* Vec<T>::Push */: '.'^ /* Clipped */ ident nameList;
/* 437 */ nameList /* Vec<T>::New */: ;
/* 438 */ component_reference: component_referenceOpt /* Option */ ident component_referenceOpt0 /* Option */ component_referenceList /* Vec */;
/* 439 */ component_referenceList /* Vec<T>::Push */: component_ref_part component_referenceList;
/* 440 */ component_referenceList /* Vec<T>::New */: ;
/* 441 */ component_referenceOpt0 /* Option<T>::Some */: array_subscripts;
/* 442 */ component_referenceOpt0 /* Option<T>::None */: ;
/* 443 */ component_referenceOpt /* Option<T>::Some */: '.'^ /* Clipped */;
/* 444 */ component_referenceOpt /* Option<T>::None */: ;
/* 445 */ component_ref_part: '.'^ /* Clipped */ ident component_ref_partOpt /* Option */;
/* 446 */ component_ref_partOpt /* Option<T>::Some */: array_subscripts;
/* 447 */ component_ref_partOpt /* Option<T>::None */: ;
/* 448 */ function_call_args: '('^ /* Clipped */ function_call_argsOpt /* Option */ ')'^ /* Clipped */;
/* 449 */ function_call_argsOpt /* Option<T>::Some */: function_arguments;
/* 450 */ function_call_argsOpt /* Option<T>::None */: ;
/* 451 */ function_arguments: expression function_argumentsOpt /* Option */;
/* 452 */ function_arguments: function_partial_application function_argumentsOpt0 /* Option */;
/* 453 */ function_arguments: named_arguments;
/* 454 */ function_argumentsOpt0 /* Option<T>::Some */: ','^ /* Clipped */ function_arguments_non_first;
/* 455 */ function_argumentsOpt0 /* Option<T>::None */: ;
/* 456 */ function_argumentsOpt /* Option<T>::Some */: function_argumentsOptGroup;
/* 457 */ function_argumentsOptGroup: ','^ /* Clipped */ function_arguments_non_first;
/* 458 */ function_argumentsOptGroup: for for_indices;
/* 459 */ function_argumentsOpt /* Option<T>::None */: ;
/* 460 */ function_arguments_non_first: function_argument function_arguments_non_firstOpt /* Option */;
/* 461 */ function_arguments_non_first: named_arguments;
/* 462 */ function_arguments_non_firstOpt /* Option<T>::Some */: ','^ /* Clipped */ function_arguments_non_first;
/* 463 */ function_arguments_non_firstOpt /* Option<T>::None */: ;
/* 464 */ array_arguments: expression array_argumentsOpt /* Option */;
/* 465 */ array_argumentsOpt /* Option<T>::Some */: array_argumentsOptGroup;
/* 466 */ array_argumentsOptGroup: ','^ /* Clipped */ array_arguments_non_first;
/* 467 */ array_argumentsOptGroup: for for_indices;
/* 468 */ array_argumentsOpt /* Option<T>::None */: ;
/* 469 */ array_arguments_non_first: expression array_arguments_non_firstOpt /* Option */;
/* 470 */ array_arguments_non_firstOpt /* Option<T>::Some */: ','^ /* Clipped */ array_arguments_non_first;
/* 471 */ array_arguments_non_firstOpt /* Option<T>::None */: ;
/* 472 */ named_arguments: named_argument named_argumentsOpt /* Option */;
/* 473 */ named_argumentsOpt /* Option<T>::Some */: ','^ /* Clipped */ named_arguments;
/* 474 */ named_argumentsOpt /* Option<T>::None */: ;
/* 475 */ named_argument: ident '='^ /* Clipped */ function_argument;
/* 476 */ function_argument: function_partial_application;
/* 477 */ function_argument: expression;
/* 478 */ function_partial_application: function type_specifier '('^ /* Clipped */ function_partial_applicationOpt /* Option */ ')'^ /* Clipped */;
/* 479 */ function_partial_applicationOpt /* Option<T>::Some */: named_arguments;
/* 480 */ function_partial_applicationOpt /* Option<T>::None */: ;
/* 481 */ output_expression_list: output_expression_listOpt /* Option */ output_expression_listList /* Vec */;
/* 482 */ output_expression_listList /* Vec<T>::Push */: ','^ /* Clipped */ output_expression_listOpt0 /* Option */ output_expression_listList;
/* 483 */ output_expression_listList /* Vec<T>::New */: ;
/* 484 */ output_expression_listOpt0 /* Option<T>::Some */: expression;
/* 485 */ output_expression_listOpt0 /* Option<T>::None */: ;
/* 486 */ output_expression_listOpt /* Option<T>::Some */: expression;
/* 487 */ output_expression_listOpt /* Option<T>::None */: ;
/* 488 */ expression_list: expression expression_listList /* Vec */;
/* 489 */ expression_listList /* Vec<T>::Push */: ','^ /* Clipped */ expression expression_listList;
/* 490 */ expression_listList /* Vec<T>::New */: ;
/* 491 */ array_subscripts: '['^ /* Clipped */ subscript array_subscriptsList /* Vec */ ']'^ /* Clipped */;
/* 492 */ array_subscriptsList /* Vec<T>::Push */: ','^ /* Clipped */ subscript array_subscriptsList;
/* 493 */ array_subscriptsList /* Vec<T>::New */: ;
/* 494 */ subscript: ':';
/* 495 */ subscript: expression;
/* 496 */ description: description_string descriptionOpt /* Option */;
/* 497 */ descriptionOpt /* Option<T>::Some */: annotation_clause;
/* 498 */ descriptionOpt /* Option<T>::None */: ;
/* 499 */ description_string: description_stringOpt /* Option */;
/* 500 */ description_stringOpt /* Option<T>::Some */: string description_stringOptList /* Vec */;
/* 501 */ description_stringOptList /* Vec<T>::Push */: '+'^ /* Clipped */ string description_stringOptList;
/* 502 */ description_stringOptList /* Vec<T>::New */: ;
/* 503 */ description_stringOpt /* Option<T>::None */: ;
/* 504 */ annotation_clause: annotation class_modification;