documentationsHood: HOOD4-SIFyacc.txt

File HOOD4-SIFyacc.txt, 13.6 KB (added by alan, 15 years ago)
Line 
1%token ABSTRACT ACTIVE ASER ASERBYIT ATTRIBUTES BYIT BYPOINTER BYREFERENCE BYVALUE CLASS CODE CONSTANTS CONSTRAINEDBY CONSTRAINEDOPERATIONS DATA DATAFLOWS DESCRIPTION END ENDOBJECT ENDOPERATION ENVIRONMENT EXCEPTIONS EXCEPTIONFLOWS FORMALPARAMETERS GENERIC HANDLEDEXCEPTIONS HSER HSERTOER IMPLEMENTATIONCONSTRAINTS IMPLEMENTATIONORSYNCHRONISATIONCONSTRAINTS IMPLEMENTATIONORSYNCHRONIZATIONCONSTRAINTS IMPLEMENTEDBY IN INHERITANCE INHERITED INSTANCEOF INSTANCERANGE INTERNALS IS LSER LSERTOER MEMBEROF MTEX NONE OBJECT OBJECTS OBJECTCONTROLSTRUCTURE OPERATION OPERATIONS OPERATIONCONTROLSTRUCTURES OPERATIONSETS OPCONTROL OSTD OUT PARAMETERS PASSIVE PRAGMA PROPAGATEDEXCEPTIONS PROTOCOL PROVIDEDINTERFACE PSEUDOCODE RAISEDBY RASER REQUIREDINTERFACE RETURN RLSER ROER RWER SIFVERSION STATE TARGETLANGUAGE TO TOOLNAME TOOLVERSION TYPES USEDOPERATIONS VIRTUALNODE
2
3%token LP RP COMMA DOT COLON ASSIGN SEMICOLON LARROW BIARROW RARROW
4
5%token ENTIER FREETEXT NOM REEL STRING2
6
7%%
8
9sif /* (1) */
10 : sifHeaderOpt objectDescriptorRpt1;
11
12sifHeader /* (2) */
13 : SIFVERSION freeText semiColon TOOLNAME freeText semiColon TOOLVERSION freeText semiColon TARGETLANGUAGE freeText semiColon;
14
15objectDescriptor /* (3) */
16 : moduleKind identifier IS annotationList r1Opt formalParametersSectionOpt instanceRangeOpt actualParametersSectionOpt descriptionSectionOpt implementationConstraintsSectionOpt providedInterfaceSectionOpt visibleObcsSectionOpt requiredInterfaceSectionOpt dataFlowSectionOpt exceptionFlowSectionOpt internalsOpt objectTrailer;
17
18r1
19 : objectKind annotationList;
20
21moduleKind /* (4) */
22 : OBJECT
23 | CLASS
24 | OPCONTROL
25 | VIRTUALNODE;
26
27objectKind /* (5) */
28 : GENERICOpt ENVIRONMENTOpt ACTIVE
29 | GENERICOpt ENVIRONMENTOpt PASSIVE
30 | INSTANCEOF identifier
31 | PROTOCOL freeText
32 | CLASS ENVIRONMENTOpt ACTIVE
33 | CLASS ENVIRONMENTOpt PASSIVE
34 | OPCONTROL
35 | VIRTUALNODE;
36
37objectTrailer /* (6) */
38 : ENDOBJECT identifier annotationList
39 | END identifier annotationList;
40
41descriptionSection /* (7) */
42 : DESCRIPTION annotationList
43 | DESCRIPTION NONE;
44
45implementationConstraintsSection /* (8) */
46 : implementationConstraintsKeyword annotationList
47 | implementationConstraintsKeyword NONE;
48
49implementationConstraintsKeyword /* (9) */
50 : IMPLEMENTATIONCONSTRAINTS
51 | IMPLEMENTATIONORSYNCHRONIZATIONCONSTRAINTS
52 | IMPLEMENTATIONORSYNCHRONISATIONCONSTRAINTS;
53
54dataFlowSection /* (10) */
55 : DATAFLOWS flowRpt1
56 | DATAFLOWS NONE;
57
58exceptionFlowSection /* (11) */
59 : EXCEPTIONFLOWS flowRpt1
60 | EXCEPTIONFLOWS NONE;
61
62flow /* (12) */
63 : identifier flowDirection identifier semiColon
64 | identifier flowDirection OPERATION operationIdentifier semiColon;
65
66flowDirection /* (13) */
67 : LARROW
68 | BIARROW
69 | RARROW;
70
71providedInterfaceSection /* (14) */
72 : PROVIDEDINTERFACE entityDeclarationSectionRpt1
73 | PROVIDEDINTERFACE NONE;
74
75requiredInterfaceSection /* (15) */
76 : REQUIREDINTERFACE requiredObjectRpt1
77 | REQUIREDINTERFACE NONE;
78
79requiredObject /* (16) */
80 : requiredObjectHeader semiColon requiredEntitySectionRpt1
81 | requiredObjectHeader semiColon NONE;
82
83requiredObjectHeader /* (17) */
84 : OBJECT identifier
85 | FORMALPARAMETERS;
86
87requiredEntitySection /* (18) */
88 : TYPES pragmaRpt0 r2Rpt1
89 | TYPES pragmaRpt0 NONE
90 | CONSTANTS pragmaRpt0 r3Rpt1
91 | CONSTANTS pragmaRpt0 NONE
92 | OPERATIONS pragmaRpt0 r4Rpt1
93 | OPERATIONS pragmaRpt0 NONE
94 | OPERATIONSETS pragmaRpt0 r5Rpt1
95 | OPERATIONSETS pragmaRpt0 NONE
96 | EXCEPTIONS pragmaRpt0 r6Rpt1
97 | EXCEPTIONS pragmaRpt0 NONE;
98
99r2
100 : reference semiColon;
101
102r3
103 : reference semiColon;
104
105r4
106 : opReference semiColon;
107
108r5
109 : reference semiColon;
110
111r6
112 : reference semiColon;
113
114internals /* (19) */
115 : INTERNALS childObjectSectionOpt entityDeclarationSectionRpt0 internalObcsSectionOpt operationControlStructuresOpt;
116
117childObjectSection /* (20) */
118 : OBJECTS r7Rpt1
119 | OBJECTS NONE;
120
121r7
122 : identifier semiColon;
123
124visibleObcsSection /* (21) */
125 : OBJECTCONTROLSTRUCTURE annotationList descriptionSectionOpt ostdSectionOpt constrainedOperationSectionOpt
126 | OBJECTCONTROLSTRUCTURE NONE;
127
128ostdSection /* (22) */
129 : OSTD annotationList
130 | OSTD NONE;
131
132constrainedOperationSection /* (23) */
133 : CONSTRAINEDOPERATIONS annotationList constrainedOperationRpt1
134 | CONSTRAINEDOPERATIONS NONE;
135
136constrainedOperation /* (24) */
137 : operationIdentifier semiColon
138 | operationIdentifier CONSTRAINEDBY constrainedLabel freeTextOpt semiColon;
139
140constrainedLabel /* (25) */
141 : STATE protocolOpt concurrencyOpt constraintAttributeRpt0
142 | protocol concurrencyOpt constraintAttributeRpt0
143 | concurrency constraintAttributeRpt0
144 | constraintAttributeRpt1
145 | freeText
146 | ASERBYIT td
147 | LSERTOER numericLiteral
148 | HSERTOER numericLiteral;
149
150protocol /* (26) */
151 : LSER
152 | HSER
153 | ASER
154 | RASER
155 | RLSER;
156
157concurrency /* (27) */
158 : MTEX
159 | RWER
160 | ROER;
161
162constraintAttribute /* (28) */
163 : TO numericLiteral
164 | BYIT td;
165
166internalObcsSection /* (29) */
167 : OBJECTCONTROLSTRUCTURE controlStructure
168 | OBJECTCONTROLSTRUCTURE IMPLEMENTEDBY identifier CommaAndIdentifierRpt0 semiColon
169 | OBJECTCONTROLSTRUCTURE NONE;
170
171CommaAndIdentifier
172 : comma identifier;
173
174operationControlStructures /* (30) */
175 : OPERATIONCONTROLSTRUCTURES opcsRpt1
176 | OPERATIONCONTROLSTRUCTURES NONE;
177
178opcs /* (31) */
179 : OPERATION operationIdentifier controlStructure ENDOPERATION operationIdentifier;
180
181controlStructure /* (32) */
182 : annotationList descriptionSectionOpt usedOperationsSectionOpt propagatedExceptionsSectionOpt handledExceptionsSectionOpt pseudoCodeSectionOpt codeSectionOpt;
183
184usedOperationsSection /* (33) */
185 : USEDOPERATIONS r4Rpt1
186 | USEDOPERATIONS NONE;
187
188propagatedExceptionsSection /* (34) */
189 : PROPAGATEDEXCEPTIONS r2Rpt1
190 | PROPAGATEDEXCEPTIONS NONE;
191
192handledExceptionsSection /* (35) */
193 : HANDLEDEXCEPTIONS r2Rpt1
194 | HANDLEDEXCEPTIONS NONE;
195
196pseudoCodeSection /* (36) */
197 : PSEUDOCODE freeText
198 | PSEUDOCODE NONE;
199
200codeSection /* (37) */
201 : CODE tdOpt codeSubSectionRpt0
202 | CODE NONE;
203
204codeSubSection /* (38) */
205 : identifier td
206 | identifier NONE;
207
208entityDeclarationSection /* (39) */
209 : TYPES typeDeclarationRpt1
210 | TYPES NONE
211 | CONSTANTS constantDeclarationRpt1
212 | CONSTANTS NONE
213 | OPERATIONS operationDeclarationRpt1
214 | OPERATIONS NONE
215 | OPERATIONSETS opSetDeclarationRpt1
216 | OPERATIONSETS NONE
217 | EXCEPTIONS exceptionDeclarationRpt1
218 | EXCEPTIONS NONE
219 | DATA variableDeclarationRpt1
220 | DATA NONE;
221
222typeDeclaration /* (40) */
223 : identifier ABSTRACTOpt classInheritance typeAttributesOpt tdOpt semiColon
224 | identifier typeAttributesOpt tdOpt semiColon
225 | identifier IMPLEMENTEDBY reference semiColon;
226
227classInheritance /* (41) */
228 : INHERITANCE reference COMMAAndReferenceRpt0
229 | INHERITANCE NONE;
230
231COMMAAndReference
232 : COMMA reference;
233
234typeAttributes /* (42) */
235 : ATTRIBUTES attributeDeclaration r8Rpt0 ATTRIBUTES NONE;
236
237r8
238 : COMMA attributeDeclaration;
239
240attributeDeclaration /* (43) */
241 : identifier COLONAndReferenceOpt;
242
243COLONAndReference
244 : COLON reference;
245
246constantDeclaration /* (44) */
247 : identifier COLONAndReferenceOpt tdOpt semiColon
248 | identifier IMPLEMENTEDBY reference semiColon;
249
250operationDeclaration /* (45) */
251 : operationIdentifier ABSTRACTOpt INHERITEDOpt membershipClauseOpt semiColon
252 | operationIdentifier IMPLEMENTEDBY opReference semiColon;
253
254opSetDeclaration /* (46) */
255 : identifier membershipClauseOpt semiColon
256 | identifier IMPLEMENTEDBY reference semiColon;
257
258exceptionDeclaration /* (47) */
259 : identifier tdOpt semiColon
260 | identifier tdOpt raisedByClause SEMICOLON annotationList
261 | identifier IMPLEMENTEDBY reference semiColon;
262
263variableDeclaration /* (48) */
264 : identifier COLONAndReferenceOpt tdOpt semiColon;
265
266membershipClause /* (49) */
267 : MEMBEROF identifier;
268
269raisedByClause /* (50) */
270 : RAISEDBY opReference r9Rpt0;
271
272r9
273 : comma opReference;
274
275formalParametersSection /* (51) */
276 : FORMALPARAMETERS entityDeclarationSectionRpt1
277 | FORMALPARAMETERS NONE;
278
279actualParametersSection /* (52) */
280 : PARAMETERS parameterAssociationSectionRpt1
281 | PARAMETERS NONE;
282
283parameterAssociationSection /* (53) */
284 : TYPES associationRpt1
285 | TYPES NONE
286 | CONSTANTS associationRpt1
287 | CONSTANTS NONE
288 | OPERATIONS operationAssociationRpt1
289 | OPERATIONS NONE
290 | OPERATIONSETS associationRpt1
291 | OPERATIONSETS NONE;
292
293association /* (54) */
294 : identifier RARROW referenceOrTd semiColon;
295
296operationAssociation /* (55) */
297 : operationIdentifier RARROW opReference semiColon;
298
299referenceOrTd /* (56) */
300 : reference
301 | td;
302
303instanceRange /* (57) */
304 : INSTANCERANGE integer DOT DOT integer;
305
306operationIdentifier /* (58) */
307 : identifier opParameterPartOpt opReturnPartOpt
308 | stringLiteral opParameterPartOpt opReturnPartOpt;
309
310reference /* (59) */
311 : identifier DOT identifier
312 | identifier;
313
314opReference /* (60) */
315 : identifier DOT operationIdentifier
316 | operationIdentifier;
317
318opParameterPart /* (61) */
319 : LP opParameter r10Rpt0 RP;
320
321r10
322 : SEMICOLON opParameter;
323
324opReturnPart /* (62) */
325 : RETURN reference opTypeQualifierOpt;
326
327opParameter /* (63) */
328 : identifier COLON opParameterMode reference opTypeQualifierOpt ASSIGNAndTdOpt;
329
330ASSIGNAndTd
331 : ASSIGN td;
332
333opTypeQualifier /* (64) */
334 : BYVALUE
335 | ptrOrRefOpTypeQualifierRpt1;
336
337ptrOrRefOpTypeQualifier /* (65) */
338 : BYPOINTER
339 | BYREFERENCE;
340
341opParameterMode /* (66) */
342 : IN
343 | OUT
344 | IN OUT;
345
346numericLiteral /* (67) */
347 : integer
348 | real;
349
350annotationList /* (68) */
351 : r11Rpt0;
352
353r11
354 : freeText
355 | pragma;
356
357td /* (69) */
358 : text;
359
360freeText /* (70) */
361 : text;
362
363semiColon /* (71) */
364 : r12Opt;
365
366r12
367 : SEMICOLON annotationList;
368
369comma /* (72) */
370 : COMMAOpt;
371
372pragma /* (73) */
373 : PRAGMA identifier pragmaParameterPartOpt SEMICOLONOpt;
374
375pragmaParameterPart /* (74) */
376 : LP pragmaParameter r13Rpt0 RP;
377
378r13
379 : comma pragmaParameter;
380
381pragmaParameter /* (75) */
382 : identifier RARROW pragmaParameterValue
383 | pragmaParameterValue;
384
385pragmaParameterValue /* (76) */
386 : opReference
387 | numericLiteral
388 | freeText;
389
390identifier /* (0.1) */
391 : NOM;
392
393integer /* (0.2) */
394 : ENTIER;
395
396real /* (0.3) */
397 : REEL;
398
399stringLiteral /* (0.4) */
400 : STRING2;
401
402text /* (0.5) */
403 : FREETEXT;
404
405/* optional and repeated items : */
406
407ABSTRACTOpt : | ABSTRACT;
408actualParametersSectionOpt : | actualParametersSection;
409ASSIGNAndTdOpt : | ASSIGNAndTd;
410associationRpt1 : association | associationRpt1 association;
411childObjectSectionOpt : | childObjectSection;
412codeSectionOpt : | codeSection;
413codeSubSectionRpt0 : | codeSubSectionRpt0 codeSubSection;
414COLONAndReferenceOpt : | COLONAndReference;
415CommaAndIdentifierRpt0 : | CommaAndIdentifierRpt0 CommaAndIdentifier;
416COMMAAndReferenceRpt0 : | COMMAAndReferenceRpt0 COMMAAndReference;
417COMMAOpt : | COMMA;
418concurrencyOpt : | concurrency;
419constantDeclarationRpt1 : constantDeclaration | constantDeclarationRpt1 constantDeclaration;
420constrainedOperationRpt1 : constrainedOperation | constrainedOperationRpt1 constrainedOperation;
421constrainedOperationSectionOpt : | constrainedOperationSection;
422constraintAttributeRpt0 : | constraintAttributeRpt0 constraintAttribute;
423constraintAttributeRpt1 : constraintAttribute | constraintAttributeRpt1 constraintAttribute;
424dataFlowSectionOpt : | dataFlowSection;
425descriptionSectionOpt : | descriptionSection;
426entityDeclarationSectionRpt0 : | entityDeclarationSectionRpt0 entityDeclarationSection;
427entityDeclarationSectionRpt1 : entityDeclarationSection | entityDeclarationSectionRpt1 entityDeclarationSection;
428ENVIRONMENTOpt : | ENVIRONMENT;
429exceptionDeclarationRpt1 : exceptionDeclaration | exceptionDeclarationRpt1 exceptionDeclaration;
430exceptionFlowSectionOpt : | exceptionFlowSection;
431flowRpt1 : flow | flowRpt1 flow;
432formalParametersSectionOpt : | formalParametersSection;
433freeTextOpt : | freeText;
434GENERICOpt : | GENERIC;
435handledExceptionsSectionOpt : | handledExceptionsSection;
436implementationConstraintsSectionOpt : | implementationConstraintsSection;
437INHERITEDOpt : | INHERITED;
438instanceRangeOpt : | instanceRange;
439internalsOpt : | internals;
440internalObcsSectionOpt : | internalObcsSection;
441membershipClauseOpt : | membershipClause;
442objectDescriptorRpt1 : objectDescriptor | objectDescriptorRpt1 objectDescriptor;
443opcsRpt1 : opcs | opcsRpt1 opcs;
444operationAssociationRpt1 : operationAssociation | operationAssociationRpt1 operationAssociation;
445operationControlStructuresOpt : | operationControlStructures;
446operationDeclarationRpt1 : operationDeclaration | operationDeclarationRpt1 operationDeclaration;
447opParameterPartOpt : | opParameterPart;
448opReturnPartOpt : | opReturnPart;
449opSetDeclarationRpt1 : opSetDeclaration | opSetDeclarationRpt1 opSetDeclaration;
450opTypeQualifierOpt : | opTypeQualifier;
451ostdSectionOpt : | ostdSection;
452parameterAssociationSectionRpt1 : parameterAssociationSection | parameterAssociationSectionRpt1 parameterAssociationSection;
453pragmaParameterPartOpt : | pragmaParameterPart;
454pragmaRpt0 : | pragmaRpt0 pragma;
455propagatedExceptionsSectionOpt : | propagatedExceptionsSection;
456protocolOpt : | protocol;
457providedInterfaceSectionOpt : | providedInterfaceSection;
458pseudoCodeSectionOpt : | pseudoCodeSection;
459ptrOrRefOpTypeQualifierRpt1 : ptrOrRefOpTypeQualifier | ptrOrRefOpTypeQualifierRpt1 ptrOrRefOpTypeQualifier;
460r10Rpt0 : | r10Rpt0 r10;
461r11Rpt0 : | r11Rpt0 r11;
462r12Opt : | r12;
463r13Rpt0 : | r13Rpt0 r13;
464r1Opt : | r1;
465r2Rpt1 : r2 | r2Rpt1 r2;
466r3Rpt1 : r3 | r3Rpt1 r3;
467r4Rpt1 : r4 | r4Rpt1 r4;
468r5Rpt1 : r5 | r5Rpt1 r5;
469r6Rpt1 : r6 | r6Rpt1 r6;
470r7Rpt1 : r7 | r7Rpt1 r7;
471r8Rpt0 : | r8Rpt0 r8;
472r9Rpt0 : | r9Rpt0 r9;
473requiredEntitySectionRpt1 : requiredEntitySection | requiredEntitySectionRpt1 requiredEntitySection;
474requiredInterfaceSectionOpt : | requiredInterfaceSection;
475requiredObjectRpt1 : requiredObject | requiredObjectRpt1 requiredObject;
476SEMICOLONOpt : | SEMICOLON;
477sifHeaderOpt : | sifHeader;
478tdOpt : | td;
479typeAttributesOpt : | typeAttributes;
480typeDeclarationRpt1 : typeDeclaration | typeDeclarationRpt1 typeDeclaration;
481usedOperationsSectionOpt : | usedOperationsSection;
482variableDeclarationRpt1 : variableDeclaration | variableDeclarationRpt1 variableDeclaration;
483visibleObcsSectionOpt : | visibleObcsSection;