Add LTTngUSTLogger logger plugin
[deliverable/titan.core.git] / parser / parser.y
CommitLineData
970ed795 1/******************************************************************************
d44e3c4f 2 * Copyright (c) 2000-2016 Ericsson Telecom AB
970ed795
EL
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
d44e3c4f 7 *
8 * Contributors:
9 * Balasko, Jeno
10 * Lovassy, Arpad
11 * Szabo, Janos Zoltan – initial implementation
12 *
970ed795
EL
13 ******************************************************************************/
14
15/*
16
17Parser source code for TTCN-3 (input of bison)
18Rev: PA10
19Date: April 15 2005
20Author: Janos Zoltan Szabo (ejnosza)
21
22Revision history:
23
24Rev. Date Author Comments
25PA1 Nov 10 2000 tmpjsz Generated from the prototype compiler.
26 (Actions were removed.)
27PA2 Dec 5 2000 tmpjsz Many minor changes.
28 Updated according to BNF v1.0.9.
29PA3 Dec 11 2000 tmpjsz Added support for module definitive
30 identifiers.
31PA5 Sep 19 - Oct 1 2001 tmpjsz Upgrade to BNF v1.1.2.
32PA6 Apr 16-18 2002 tmpjsz Upgrade to BNF v2.2.0 (Rev. 12.5)
33PA7 Nov 26-27 2002 tmpjsz Upgrade to BNF v2.2.1 (Rev. 12.7)
34PA8 May 10-13 2004 ejnosza Upgrade to BNF v3.0.0Mockupv1
35PA9 March 2005 ejnosza Added support for multi-dimension
36 sub-references in port/timer/component
37 operations.
38PA10 Apr 13-15 2005 ejnosza Upgrade to final BNF v3.0.0
39
40*/
41
42%{
43
44#include <stdio.h>
45#include <string.h>
46#include <stdlib.h>
47#include <errno.h>
48
49void yyerror(char *s);
50int yylex();
51
52#define YYERROR_VERBOSE
53
54%}
55
56/* Bison declarations */
57
58/* Terminal symbols of TTCN-3 */
59
60/* Inline constants */
61
62%token Number
63%token FloatValue
64%token Identifier
65
66%token BooleanConst
67%token VerdictConst
68%token Bstring
69%token Hstring
70%token Ostring
71%token Cstring
72%token NullKeyword
73%token BitStringMatch
74%token HexStringMatch
75%token OctetStringMatch
76
77/* Keywords */
78
79%token ActionKeyword
80%token ActivateKeyword
81%token AddressKeyword
82%token AliveKeyword
83%token AllKeyword
84%token AltKeyword
85%token AltstepKeyword
86%token AnyKeyword
87%token AnyTypeKeyword
88%token BitStringKeyword
89%token BooleanKeyword
90%token CallOpKeyword
91%token CaseKeyword
92%token CatchOpKeyword
93%token CharKeyword
94%token CharStringKeyword
95%token CheckOpKeyword
96%token ClearOpKeyword
97%token ComplementKeyword
98%token ComponentKeyword
99%token ConnectKeyword
100%token ConstKeyword
101%token ControlKeyword
102%token CreateKeyword
103%token DeactivateKeyword
104%token DefaultKeyword
105%token DisconnectKeyword
106%token DisplayKeyword
107%token DoKeyword
108%token DoneKeyword
109%token ElseKeyword
110%token EncodeKeyword
111%token EnumKeyword
112%token ExceptKeyword
113%token ExceptionKeyword
114%token ExecuteKeyword
115%token ExtendsKeyword
116%token ExtensionKeyword
117%token ExtKeyword
118%token FloatKeyword
119%token ForKeyword
120%token FromKeyword
121%token FunctionKeyword
122%token GetCallOpKeyword
123%token GetReplyOpKeyword
124%token GetVerdictKeyword
125%token GotoKeyword
126%token GroupKeyword
127%token HexStringKeyword
128%token IfKeyword
129%token IfPresentKeyword
130%token ImportKeyword
131%token InParKeyword
132%token InfinityKeyword
133%token InOutParKeyword
134%token IntegerKeyword
135%token InterleavedKeyword
136%token KillKeyword
137%token KilledKeyword
138%token LabelKeyword
139%token LanguageKeyword
140%token LengthKeyword
141%token LogKeyword
142%token MapKeyword
143%token MatchKeyword
144%token MessageKeyword
145%token MixedKeyword
146%token ModifiesKeyword
147%token TTCN3ModuleKeyword
148%token ModuleParKeyword
149%token MTCKeyword
150%token NoBlockKeyword
151%token NowaitKeyword
152%token ObjectIdentifierKeyword
153%token OctetStringKeyword
154%token OfKeyword
155%token OmitKeyword
156%token OnKeyword
157%token OptionalKeyword
158%token OutParKeyword
159%token OverrideKeyword
160%token ParamKeyword
161%token PatternKeyword
162%token PermutationKeyword
163%token PortKeyword
164%token ProcedureKeyword
165%token RaiseKeyword
166%token ReadKeyword
167%token ReceiveOpKeyword
168%token RecordKeyword
169%token RecursiveKeyword
170%token RepeatKeyword
171%token ReplyKeyword
172%token ReturnKeyword
173%token RunningKeyword
174%token RunsKeyword
175%token SelectKeyword
176%token SelfOp
177%token SendOpKeyword
178%token SenderKeyword
179%token SetKeyword
180%token SetVerdictKeyword
181%token SignatureKeyword
182%token StartKeyword
183%token StopKeyword
184%token SubsetKeyword
185%token SupersetKeyword
186%token SystemKeyword
187%token TemplateKeyword
188%token TestcaseKeyword
189%token TimeoutKeyword
190%token TimerKeyword
191%token ToKeyword
192%token TriggerOpKeyword
193%token TypeDefKeyword
194%token UnionKeyword
195%token UniversalKeyword
196%token UnmapKeyword
197%token ValueKeyword
198%token ValueofKeyword
199%token VarKeyword
200%token VariantKeyword
201%token VerdictTypeKeyword
202%token WhileKeyword
203%token WithKeyword
204
205/* Keywords combined with a leading dot */
206
207%token DotAliveKeyword
208%token DotCallOpKeyword
209%token DotCatchOpKeyword
210%token DotCheckOpKeyword
211%token DotClearOpKeyword
212%token DotCreateKeyword
213%token DotDoneKeyword
214%token DotGetCallOpKeyword
215%token DotGetReplyOpKeyword
216%token DotKillKeyword
217%token DotKilledKeyword
218%token DotRaiseKeyword
219%token DotReadKeyword
220%token DotReceiveOpKeyword
221%token DotReplyKeyword
222%token DotRunningKeyword
223%token DotSendOpKeyword
224%token DotStartKeyword
225%token DotStopKeyword
226%token DotTimeoutKeyword
227%token DotTriggerOpKeyword
228
229/* Multi-character operators */
230
231%token AssignmentChar ":="
232%token DotDot ".."
233%token PortRedirectSymbol "->"
234%token EQ "=="
235%token NE "!="
236%token GE ">="
237%token LE "<="
238%token Or "or"
239%token Or4b "or4b"
240%token Xor "xor"
241%token Xor4b "xor4b"
242%token Mod "mod"
243%token Rem "rem"
244%token And "and"
245%token And4b "and4b"
246%token Not "not"
247%token Not4b "not4b"
248%token SL "<<"
249%token SR ">>"
250%token RL "<@"
251%token RR "@>"
252
253/* Operator precedences */
254
255/*
256%left Or
257%left Xor
258%left And
259%left Not
260%left EQ NE
261%left '<' '>' GE LE
262%left SL SR RL RR
263%left Or4b
264%left Xor4b
265%left And4b
266%left Not4b
267%left '+' '-' '&'
268%left '*' '/' Mod Rem
269%left UnarySign
270*/
271
272%expect 16
273
274/*
275Source of conflicts (16 S/R):
276
2771.) 7 conflicts in one state
278The Expression after 'return' keyword is optional in ReturnStatement.
279For 7 tokens the parser cannot decide whether the token is a part of
280the return expression (shift) or it is the beginning of the next statement
281(reduce).
282
2832.) 8 distinct states, each with one conflict caused by token '['
284The local definitions in altsteps can be followed immediately by the guard
285expression. When the parser sees the '[' token it cannot decide whether it
286belongs to the local definition as array dimension or array subreference
287(shift) or it is the beginning of the first guard expression (reduce).
288The situations are the following:
289- var t v := ref <here> [
290- var t v := ref[subref] <here> [
291- var t v := ref.integer <here> [
292- var t v := ref.subref <here> [
293- timer t <here> [
294- var t v <here> [
295- var t v := ref.objid{...}.subref <here> [
296- var template t v <here> [
297
2983.) 1 conflict
299The sequence identifier.objid can be either the beginning of a module name
300qualified with a module object identifier (shift) or a reference to an objid
301value within an entity of type anytype (reduce).
302
303Note that the parser implemented by bison always chooses to shift instead of
304reduce in case of conflicts. This is the desired behaviour in situations 1.)
305and 2.) since the opposite alternative can be forced by the correct usage
306of semi-colons.
307*/
308
309%%
310
311/* The grammar of TTCN-3 */
312
313/* A.1.6.0 TTCN-3 module */
314
315TTCN3Module:
316 TTCN3ModuleKeyword TTCN3ModuleId
317 '{'
318 optModuleDefinitionsPart
319 optModuleControlPart
320 '}'
321 optWithStatementAndSemiColon
322;
323
324TTCN3ModuleId:
325 Identifier optDefinitiveIdentifier optLanguageSpec
326;
327
328ModuleId:
329 GlobalModuleId optLanguageSpec
330;
331
332GlobalModuleId:
333 Identifier
334 | Identifier ObjectIdentifierValue
335;
336
337optLanguageSpec:
338 /* empty */
339 | LanguageKeyword FreeText
340;
341
342/* A.1.6.1 Module definitions part */
343
344/* A.1.6.1.0 General */
345
346optModuleDefinitionsPart:
347 /* empty */
348 | ModuleDefinitionsList
349;
350
351ModuleDefinitionsList:
352 ModuleDefinition optSemiColon
353 | ModuleDefinitionsList ModuleDefinition optSemiColon
354;
355
356ModuleDefinition:
357 ModuleDef optWithStatement
358;
359
360ModuleDef:
361 TypeDef
362 | ConstDef
363 | TemplateDef
364 | ModuleParDef
365 | FunctionDef
366 | SignatureDef
367 | TestcaseDef
368 | AltstepDef
369 | ImportDef
370 | GroupDef
371 | ExtFunctionDef
372 | ExtConstDef
373;
374
375/* A.1.6.1.1 Typedef definitions */
376
377TypeDef:
378 TypeDefKeyword TypeDefBody
379;
380
381TypeDefBody:
382 StructuredTypeDef
383 | SubTypeDef
384;
385
386StructuredTypeDef:
387 RecordDef
388 | UnionDef
389 | SetDef
390 | RecordOfDef
391 | SetOfDef
392 | EnumDef
393 | PortDef
394 | ComponentDef
395;
396
397RecordDef:
398 RecordKeyword StructDefBody
399;
400
401StructDefBody:
402 Identifier optStructDefFormalParList
403 '{' optStructFieldDefList '}'
404 | AddressKeyword '{' optStructFieldDefList '}'
405;
406
407optStructDefFormalParList:
408 /* empty */
409 | '(' StructDefFormalParList ')'
410;
411
412StructDefFormalParList:
413 StructDefFormalPar
414 | StructDefFormalParList ',' StructDefFormalPar
415;
416
417StructDefFormalPar:
418 FormalValuePar
419;
420
421optStructFieldDefList:
422 /* empty */
423 | StructFieldDefList
424;
425
426StructFieldDefList:
427 StructFieldDef
428 | StructFieldDefList ',' StructFieldDef
429;
430
431StructFieldDef:
432 TypeOrNestedTypeDef Identifier optArrayDef optSubTypeSpec
433 | TypeOrNestedTypeDef Identifier optArrayDef optSubTypeSpec
434 OptionalKeyword
435;
436
437TypeOrNestedTypeDef:
438 Type
439 | NestedTypeDef
440;
441
442NestedTypeDef:
443 NestedRecordDef
444 | NestedUnionDef
445 | NestedSetDef
446 | NestedRecordOfDef
447 | NestedSetOfDef
448 | NestedEnumDef
449;
450
451NestedRecordDef:
452 RecordKeyword '{' optStructFieldDefList '}'
453;
454
455NestedUnionDef:
456 UnionKeyword '{' UnionFieldDefList '}'
457;
458
459NestedSetDef:
460 SetKeyword '{' optStructFieldDefList '}'
461;
462
463NestedRecordOfDef:
464 RecordKeyword optStringLength OfKeyword TypeOrNestedTypeDef
465;
466
467NestedSetOfDef:
468 SetKeyword optStringLength OfKeyword TypeOrNestedTypeDef
469;
470
471NestedEnumDef:
472 EnumKeyword '{' EnumerationList '}'
473;
474
475UnionDef:
476 UnionKeyword UnionDefBody
477;
478
479UnionDefBody:
480 Identifier optStructDefFormalParList '{' UnionFieldDefList '}'
481 | AddressKeyword '{' UnionFieldDefList '}'
482
483;
484
485UnionFieldDefList:
486 UnionFieldDef
487 | UnionFieldDefList ',' UnionFieldDef
488;
489
490UnionFieldDef:
491 TypeOrNestedTypeDef Identifier optArrayDef optSubTypeSpec
492;
493
494SetDef:
495 SetKeyword StructDefBody
496;
497
498RecordOfDef:
499 RecordKeyword optStringLength OfKeyword StructOfDefBody
500;
501
502StructOfDefBody:
503 TypeOrNestedTypeDef Identifier optSubTypeSpec
504 | TypeOrNestedTypeDef AddressKeyword optSubTypeSpec
505;
506
507SetOfDef:
508 SetKeyword optStringLength OfKeyword StructOfDefBody
509;
510
511EnumDef:
512 EnumKeyword Identifier '{' EnumerationList '}'
513 | EnumKeyword AddressKeyword '{' EnumerationList '}'
514;
515
516EnumerationList:
517 Enumeration
518 | EnumerationList ',' Enumeration
519;
520
521Enumeration:
522 Identifier
523 | Identifier '(' Number ')'
524 | Identifier '(' Minus Number ')'
525;
526
527SubTypeDef:
528 Type Identifier optArrayDef optSubTypeSpec
529 | Type AddressKeyword optArrayDef optSubTypeSpec
530;
531
532optSubTypeSpec:
533 /* empty */
534 | AllowedValues
535 | AllowedValues StringLength
536 | StringLength
537;
538
539AllowedValues:
540 '(' seqValueOrRange ')'
541 | CharStringMatch
542;
543
544seqValueOrRange:
545 ValueOrRange
546 | seqValueOrRange ',' ValueOrRange
547;
548
549ValueOrRange:
550 RangeDef
551 | Expression
552;
553
554RangeDef:
555 LowerBound DotDot UpperBound
556;
557
558optStringLength:
559 /* empty */
560 | StringLength
561;
562
563StringLength:
564 LengthKeyword '(' SingleExpression ')'
565 | LengthKeyword '(' SingleExpression DotDot UpperBound ')'
566;
567
568PortType:
569 Identifier
570 | Identifier Dot Identifier
571 | Identifier Dot ObjectIdentifierValue Dot Identifier
572;
573
574PortDef:
575 PortKeyword PortDefBody
576;
577
578PortDefBody:
579 Identifier PortDefAttribs
580;
581
582PortDefAttribs:
583 MessageAttribs
584 | ProcedureAttribs
585 | MixedAttribs
586;
587
588MessageAttribs:
589 MessageKeyword
590 '{' MessageListList '}'
591;
592
593MessageListList:
594 MessageList optSemiColon
595 | MessageListList MessageList optSemiColon
596;
597
598MessageList:
599 Direction AllOrTypeList
600;
601
602Direction:
603 InParKeyword
604 | OutParKeyword
605 | InOutParKeyword
606;
607
608AllOrTypeList:
609 AllKeyword
610 | TypeList
611;
612
613TypeList:
614 Type
615 | TypeList ',' Type
616;
617
618ProcedureAttribs:
619 ProcedureKeyword
620 '{' ProcedureListList '}'
621;
622
623ProcedureListList:
624 ProcedureList optSemiColon
625 | ProcedureListList ProcedureList optSemiColon
626;
627
628ProcedureList:
629 Direction AllOrSignatureList
630;
631
632AllOrSignatureList:
633 AllKeyword
634 | SignatureList
635;
636
637SignatureList:
638 Signature
639 | SignatureList ',' Signature
640;
641
642MixedAttribs:
643 MixedKeyword
644 '{' MixedListList '}'
645;
646
647MixedListList:
648 MixedList optSemiColon
649 | MixedListList MixedList optSemiColon
650;
651
652MixedList:
653 Direction ProcOrTypeList
654;
655
656ProcOrTypeList:
657 seqProcOrType
658 | AllKeyword
659;
660
661seqProcOrType:
662 ProcOrType
663 | seqProcOrType ',' ProcOrType
664;
665
666ProcOrType:
667/* Signature -- covered by Type */
668 Type
669;
670
671ComponentDef:
672 ComponentKeyword Identifier
673 optExtendsDef
674 '{' ComponentDefList '}'
675;
676
677optExtendsDef:
678 /* empty */
679 | ExtendsKeyword ComponentTypeList
680;
681
682ComponentTypeList:
683 ComponentType
684 | ComponentTypeList ',' ComponentType
685;
686
687ComponentType:
688 Identifier
689 | Identifier Dot Identifier
690 | Identifier Dot ObjectIdentifierValue Dot Identifier
691;
692
693ComponentDefList:
694 /* empty */
695 | ComponentDefList ComponentElementDef optSemiColon
696;
697
698ComponentElementDef:
699 PortInstance
700 | VarInstance
701 | TimerInstance
702 | ConstDef
703;
704
705PortInstance:
706 PortKeyword PortType PortElementList
707;
708
709PortElementList:
710 PortElement
711 | PortElementList ',' PortElement
712;
713
714PortElement:
715 Identifier optArrayDef
716;
717
718/* A.1.6.1.2 Constant definitions */
719
720ConstDef:
721 ConstKeyword Type ConstList
722;
723
724ConstList:
725 SingleConstDef
726 | ConstList ',' SingleConstDef
727;
728
729SingleConstDef:
730 Identifier optArrayDef AssignmentChar Expression
731;
732
733/* A.1.6.1.3 Template definitions */
734
735TemplateDef:
736 TemplateKeyword BaseTemplate optDerivedDef AssignmentChar TemplateBody
737;
738
739BaseTemplate:
740 Type Identifier optTemplateFormalParList
741/* | Signature Identifier optTemplateFormalParList -- covered by
742 the previous rule */
743;
744
745optDerivedDef:
746 /* empty */
747 | ModifiesKeyword TemplateRef
748;
749
750optTemplateFormalParList:
751 /* empty */
752 | '(' TemplateFormalParList ')'
753;
754
755TemplateFormalParList:
756 TemplateFormalPar
757 | TemplateFormalParList ',' TemplateFormalPar
758;
759
760TemplateFormalPar:
761 FormalValuePar
762 | FormalTemplatePar
763;
764
765TemplateBody:
766 SimpleSpec optExtraMatchingAttributes
767 | FieldSpecList optExtraMatchingAttributes
768 | ArrayValueOrAttrib optExtraMatchingAttributes
769;
770
771SimpleSpec:
772 SingleValueOrAttrib
773;
774
775FieldSpecList:
776 '{' '}'
777 | '{' seqFieldSpec '}'
778;
779
780seqFieldSpec:
781 FieldSpec
782 | seqFieldSpec ',' FieldSpec
783;
784
785FieldSpec:
786 FieldReference AssignmentChar TemplateBody
787;
788
789FieldReference:
790 StructFieldRef
791 | ArrayOrBitRef
792/* | ParRef -- covered by StructFieldRef */
793;
794
795StructFieldRef:
796 Identifier
797 | PredefinedType
798/* | TypeReference
799Note: Non-parameterized type references are covered by (StructField)Identifier.
800 Parameterized type references are covered by FunctionInstance */
801 | FunctionInstance
802;
803
804ParRef:
805 Identifier
806;
807
808ArrayOrBitRef:
809 '[' FieldOrBitNumber ']'
810;
811
812FieldOrBitNumber:
813 SingleExpression
814;
815
816SingleValueOrAttrib:
817 MatchingSymbol
818 | SingleExpression
819/* | TemplateRefWithParList -- covered by SingleExpression */
820;
821
822ArrayValueOrAttrib:
823 '{' ArrayElementSpecList '}'
824;
825
826ArrayElementSpecList:
827 ArrayElementSpec
828 | ArrayElementSpecList ',' ArrayElementSpec
829;
830
831ArrayElementSpec:
832 NotUsedSymbol
833 | PermutationMatch
834 | TemplateBody
835;
836
837NotUsedSymbol:
838 Dash
839;
840
841MatchingSymbol:
842 Complement
843 | AnyValue
844 | AnyOrOmit
845 | ValueOrAttribList
846 | Range
847 | BitStringMatch
848 | HexStringMatch
849 | OctetStringMatch
850 | CharStringMatch
851 | SubsetMatch
852 | SupersetMatch
853;
854
855optExtraMatchingAttributes:
856 /* empty */
857 | LengthMatch
858 | IfPresentMatch
859 | LengthMatch IfPresentMatch
860;
861
862CharStringMatch:
863 PatternKeyword Cstring
864;
865
866Complement:
867 ComplementKeyword ValueList
868;
869
870ValueList:
871 '(' seqValue ')'
872;
873
874seqValue:
875 Expression
876 | seqValue ',' Expression
877;
878
879SubsetMatch:
880 SubsetKeyword ValueList
881;
882
883SupersetMatch:
884 SupersetKeyword ValueList
885;
886
887PermutationMatch:
888 PermutationKeyword PermutationList
889;
890
891PermutationList:
892 '(' seqValueOrAttrib ')'
893;
894
895AnyValue:
896 '?'
897;
898
899AnyOrOmit:
900 '*'
901;
902
903ValueOrAttribList:
904 '(' TemplateBody ',' seqValueOrAttrib ')'
905;
906
907seqValueOrAttrib:
908 TemplateBody
909 | seqValueOrAttrib ',' TemplateBody
910;
911
912LengthMatch:
913 StringLength
914;
915
916IfPresentMatch:
917 IfPresentKeyword
918;
919
920Range:
921 '(' LowerBound DotDot UpperBound ')'
922;
923
924LowerBound:
925 SingleExpression
926 | Minus InfinityKeyword
927;
928
929UpperBound:
930 SingleExpression
931 | InfinityKeyword
932;
933
934TemplateInstance:
935 InLineTemplate
936;
937
938TemplateRefWithParList:
939 Identifier optTemplateActualParList
940 | Identifier Dot Identifier optTemplateActualParList
941 | Identifier Dot ObjectIdentifierValue Dot Identifier
942 optTemplateActualParList
943;
944
945TemplateRef:
946 Identifier
947 | Identifier Dot Identifier
948 | Identifier Dot ObjectIdentifierValue Dot Identifier
949;
950
951InLineTemplate:
952 TemplateBody
953 | Type Colon TemplateBody
954/* | Signature Colon TemplateBody -- covered by the previous rule */
955 | DerivedRefWithParList AssignmentChar TemplateBody
956 | Type Colon DerivedRefWithParList AssignmentChar TemplateBody
957/* | Signature Colon DerivedRefWithParList AssignmentChar TemplateBody
958 -- covered by the previous rule */
959;
960
961DerivedRefWithParList:
962 ModifiesKeyword TemplateRefWithParList
963;
964
965optTemplateActualParList:
966 /* empty */
967 | '(' seqTemplateActualPar ')'
968;
969
970seqTemplateActualPar:
971 TemplateActualPar
972 | seqTemplateActualPar ',' TemplateActualPar
973;
974
975TemplateActualPar:
976 TemplateInstance
977;
978
979TemplateOps:
980 MatchOp
981 | ValueofOp
982;
983
984MatchOp:
985 MatchKeyword '(' Expression ',' TemplateInstance ')'
986;
987
988ValueofOp:
989 ValueofKeyword '(' TemplateInstance ')'
990;
991
992/* A.1.6.1.4 Function definitions */
993
994FunctionDef:
995 FunctionKeyword Identifier
996 '(' optFunctionFormalParList ')' optRunsOnSpec optReturnType
997 StatementBlock
998;
999
1000optFunctionFormalParList:
1001 /* empty */
1002 | FunctionFormalParList
1003;
1004
1005FunctionFormalParList:
1006 FunctionFormalPar
1007 | FunctionFormalParList ',' FunctionFormalPar
1008;
1009
1010FunctionFormalPar:
1011 FormalValuePar
1012 | FormalTimerPar
1013 | FormalTemplatePar
1014/* | FormalPortPar -- covered by FormalValuePar */
1015;
1016
1017optReturnType:
1018 /* empty */
1019 | ReturnType
1020;
1021
1022ReturnType:
1023 ReturnKeyword Type
1024 | ReturnKeyword TemplateKeyword Type
1025;
1026
1027optRunsOnSpec:
1028 /* empty */
1029 | RunsOnSpec
1030;
1031
1032RunsOnSpec:
1033 RunsKeyword OnKeyword ComponentType
1034;
1035
1036StatementBlock:
1037 '{' optFunctionStatementOrDefList '}'
1038;
1039
1040optFunctionStatementOrDefList:
1041 /* empty */
1042 | optFunctionStatementOrDefList FunctionStatementOrDef optSemiColon
1043;
1044
1045FunctionStatementOrDef:
1046 FunctionLocalDef
1047 | FunctionLocalInst
1048 | FunctionStatement
1049;
1050
1051FunctionLocalInst:
1052 VarInstance
1053 | TimerInstance
1054;
1055
1056FunctionLocalDef:
1057 ConstDef
1058 | TemplateDef
1059;
1060
1061FunctionStatement:
1062 ConfigurationStatements
1063 | TimerStatements
1064 | CommunicationStatements
1065 | BasicStatements
1066 | BehaviourStatements
1067 | VerdictStatements
1068 | SUTStatements
1069;
1070
1071FunctionInstance:
1072 Identifier '(' optFunctionActualParList ')'
1073 | Identifier Dot Identifier '(' optFunctionActualParList ')'
1074 | Identifier Dot ObjectIdentifierValue Dot Identifier
1075 '(' optFunctionActualParList ')'
1076;
1077
1078optFunctionActualParList:
1079 /* empty */
1080 | FunctionActualParList
1081;
1082
1083FunctionActualParList:
1084 FunctionActualPar
1085 | FunctionActualParList ',' FunctionActualPar
1086;
1087
1088FunctionActualPar:
1089/* TimerRef */
1090 TemplateInstance
1091/* | Port
1092 | ComponentRef -- TemplateInstance covers all the others */
1093;
1094
1095/* A.1.6.1.5 Signature definitions */
1096
1097SignatureDef:
1098 SignatureKeyword Identifier
1099 '(' optSignatureFormalParList ')' optReturnTypeOrNoBlockKeyword
1100 optExceptionSpec
1101;
1102
1103optSignatureFormalParList:
1104 /* empty */
1105 | SignatureFormalParList
1106;
1107
1108SignatureFormalParList:
1109 SignatureFormalPar
1110 | SignatureFormalParList ',' SignatureFormalPar
1111;
1112
1113SignatureFormalPar:
1114 FormalValuePar
1115;
1116
1117optReturnTypeOrNoBlockKeyword:
1118 /* empty */
1119 | ReturnType
1120 | NoBlockKeyword
1121;
1122
1123optExceptionSpec:
1124 /* empty */
1125 | ExceptionKeyword '(' ExceptionTypeList ')'
1126;
1127
1128ExceptionTypeList:
1129 Type
1130 | ExceptionTypeList ',' Type
1131;
1132
1133Signature:
1134 Identifier
1135 | Identifier Dot Identifier
1136 | Identifier Dot ObjectIdentifierValue Dot Identifier
1137;
1138
1139/* A.1.6.1.6 Testcase definitions */
1140
1141TestcaseDef:
1142 TestcaseKeyword Identifier
1143 '(' optTestcaseFormalParList ')' ConfigSpec
1144 StatementBlock
1145;
1146
1147optTestcaseFormalParList:
1148 /* empty */
1149 | TestcaseFormalParList
1150;
1151
1152TestcaseFormalParList:
1153 TestcaseFormalPar
1154 | TestcaseFormalParList ',' TestcaseFormalPar
1155;
1156
1157TestcaseFormalPar:
1158 FormalValuePar
1159 | FormalTemplatePar
1160;
1161
1162ConfigSpec:
1163 RunsOnSpec optSystemSpec
1164;
1165
1166optSystemSpec:
1167 /* empty */
1168 | SystemKeyword ComponentType
1169;
1170
1171TestcaseInstance:
1172 ExecuteKeyword '(' TestcaseRef '(' optTestcaseActualParList ')'
1173 optTestcaseTimerValue ')'
1174;
1175
1176TestcaseRef:
1177 Identifier
1178 | Identifier Dot Identifier
1179 | Identifier Dot ObjectIdentifierValue Dot Identifier
1180;
1181
1182optTestcaseTimerValue:
1183 /* empty */
1184 | ',' TimerValue
1185;
1186
1187optTestcaseActualParList:
1188 /* empty */
1189 | TestcaseActualParList
1190;
1191
1192TestcaseActualParList:
1193 TestcaseActualPar
1194 | TestcaseActualParList ',' TestcaseActualPar
1195;
1196
1197TestcaseActualPar:
1198 TemplateInstance
1199;
1200
1201/* A.1.6.1.7 Altstep definitions */
1202
1203AltstepDef:
1204 AltstepKeyword Identifier
1205 '(' optAltstepFormalParList ')' optRunsOnSpec
1206 '{' AltstepLocalDefList AltGuardList '}'
1207;
1208
1209optAltstepFormalParList:
1210 /* empty */
1211 | FunctionFormalParList
1212;
1213
1214AltstepLocalDefList:
1215 /* empty */
1216 | AltstepLocalDefList AltstepLocalDef optSemiColon
1217;
1218
1219AltstepLocalDef:
1220 VarInstance
1221 | TimerInstance
1222 | ConstDef
1223 | TemplateDef
1224;
1225
1226AltstepInstance:
1227 Identifier '(' optFunctionActualParList ')'
1228 | Identifier Dot Identifier '(' optFunctionActualParList ')'
1229 | Identifier Dot ObjectIdentifierValue Dot Identifier
1230 '(' optFunctionActualParList ')'
1231;
1232
1233AltstepRef:
1234 Identifier
1235 | Identifier Dot Identifier
1236 | Identifier Dot ObjectIdentifierValue Dot Identifier
1237;
1238
1239/* A.1.6.1.8 Import definitions */
1240
1241ImportDef:
1242 ImportKeyword ImportFromSpec AllWithExcepts
1243 | ImportKeyword ImportFromSpec '{' ImportSpec '}'
1244;
1245
1246AllWithExcepts:
1247 AllKeyword
1248 | AllKeyword ExceptsDef
1249;
1250
1251ExceptsDef:
1252 ExceptKeyword '{' ExceptSpec '}'
1253;
1254
1255ExceptSpec:
1256 /* empty */
1257 | ExceptSpec ExceptElement optSemiColon
1258;
1259
1260ExceptElement:
1261 ExceptGroupSpec
1262 | ExceptTypeDefSpec
1263 | ExceptTemplateSpec
1264 | ExceptConstSpec
1265 | ExceptTestcaseSpec
1266 | ExceptAltstepSpec
1267 | ExceptFunctionSpec
1268 | ExceptSignatureSpec
1269 | ExceptModuleParSpec
1270;
1271
1272ExceptGroupSpec:
1273 GroupKeyword ExceptGroupRefList
1274 | GroupKeyword AllKeyword
1275;
1276
1277ExceptTypeDefSpec:
1278 TypeDefKeyword TypeRefList
1279 | TypeDefKeyword AllKeyword
1280;
1281
1282ExceptTemplateSpec:
1283 TemplateKeyword TemplateRefList
1284 | TemplateKeyword AllKeyword
1285;
1286
1287ExceptConstSpec:
1288 ConstKeyword ConstRefList
1289 | ConstKeyword AllKeyword
1290;
1291
1292ExceptTestcaseSpec:
1293 TestcaseKeyword TestcaseRefList
1294 | TestcaseKeyword AllKeyword
1295;
1296
1297ExceptAltstepSpec:
1298 AltstepKeyword AltstepRefList
1299 | AltstepKeyword AllKeyword
1300;
1301
1302ExceptFunctionSpec:
1303 FunctionKeyword FunctionRefList
1304 | FunctionKeyword AllKeyword
1305;
1306
1307ExceptSignatureSpec:
1308 SignatureKeyword SignatureRefList
1309 | SignatureKeyword AllKeyword
1310;
1311
1312ExceptModuleParSpec:
1313 ModuleParKeyword ModuleParRefList
1314 | ModuleParKeyword AllKeyword
1315;
1316
1317ImportSpec:
1318 /* empty */
1319 | ImportSpec ImportElement optSemiColon
1320;
1321
1322ImportElement:
1323 ImportGroupSpec
1324 | ImportTypeDefSpec
1325 | ImportTemplateSpec
1326 | ImportConstSpec
1327 | ImportTestcaseSpec
1328 | ImportAltstepSpec
1329 | ImportFunctionSpec
1330 | ImportSignatureSpec
1331 | ImportModuleParSpec
1332;
1333
1334ImportFromSpec:
1335 FromKeyword ModuleId
1336 | FromKeyword ModuleId RecursiveKeyword
1337;
1338
1339ImportGroupSpec:
1340 GroupKeyword GroupRefListWithExcept
1341 | GroupKeyword AllGroupsWithExcept
1342;
1343
1344GroupRefList:
1345 FullGroupIdentifier
1346 | GroupRefList ',' FullGroupIdentifier
1347;
1348
1349GroupRefListWithExcept:
1350 FullGroupIdentifierWithExcept
1351 | GroupRefListWithExcept ',' FullGroupIdentifierWithExcept
1352;
1353
1354AllGroupsWithExcept:
1355 AllKeyword
1356 | AllKeyword ExceptKeyword GroupRefList
1357;
1358
1359FullGroupIdentifier:
1360 Identifier
1361 | FullGroupIdentifier Dot Identifier
1362;
1363
1364FullGroupIdentifierWithExcept:
1365 FullGroupIdentifier
1366 | FullGroupIdentifier ExceptsDef
1367;
1368
1369ExceptGroupRefList:
1370 ExceptFullGroupIdentifier
1371 | ExceptGroupRefList ',' ExceptFullGroupIdentifier
1372;
1373
1374ExceptFullGroupIdentifier:
1375 FullGroupIdentifier
1376;
1377
1378ImportTypeDefSpec:
1379 TypeDefKeyword TypeRefList
1380 | TypeDefKeyword AllTypesWithExcept
1381;
1382
1383TypeRefList:
1384 Identifier
1385 | TypeRefList ',' Identifier
1386;
1387
1388AllTypesWithExcept:
1389 AllKeyword
1390 | AllKeyword ExceptKeyword TypeRefList
1391;
1392
1393ImportTemplateSpec:
1394 TemplateKeyword TemplateRefList
1395 | TemplateKeyword AllTemplsWithExcept
1396;
1397
1398TemplateRefList:
1399 Identifier
1400 | TemplateRefList ',' Identifier
1401;
1402
1403AllTemplsWithExcept:
1404 AllKeyword
1405 | AllKeyword ExceptKeyword TemplateRefList
1406;
1407
1408ImportConstSpec:
1409 ConstKeyword ConstRefList
1410 | ConstKeyword AllConstsWithExcept
1411;
1412
1413ConstRefList:
1414 Identifier
1415 | ConstRefList ',' Identifier
1416;
1417
1418AllConstsWithExcept:
1419 AllKeyword
1420 | AllKeyword ExceptKeyword ConstRefList
1421;
1422
1423ImportAltstepSpec:
1424 AltstepKeyword AltstepRefList
1425 | AltstepKeyword AllAltstepsWithExcept
1426;
1427
1428AltstepRefList:
1429 Identifier
1430 | AltstepRefList ',' Identifier
1431;
1432
1433AllAltstepsWithExcept:
1434 AllKeyword
1435 | AllKeyword ExceptKeyword AltstepRefList
1436;
1437
1438ImportTestcaseSpec:
1439 TestcaseKeyword TestcaseRefList
1440 | TestcaseKeyword AllTestcasesWithExcept
1441;
1442
1443TestcaseRefList:
1444 Identifier
1445 | TestcaseRefList ',' Identifier
1446;
1447
1448AllTestcasesWithExcept:
1449 AllKeyword
1450 | AllKeyword ExceptKeyword TestcaseRefList
1451;
1452
1453ImportFunctionSpec:
1454 FunctionKeyword FunctionRefList
1455 | FunctionKeyword AllFunctionsWithExcept
1456;
1457
1458FunctionRefList:
1459 Identifier
1460 | FunctionRefList ',' Identifier
1461;
1462
1463AllFunctionsWithExcept:
1464 AllKeyword
1465 | AllKeyword ExceptKeyword FunctionRefList
1466;
1467
1468ImportSignatureSpec:
1469 SignatureKeyword SignatureRefList
1470 | SignatureKeyword AllSignaturesWithExcept
1471;
1472
1473SignatureRefList:
1474 Identifier
1475 | SignatureRefList ',' Identifier
1476;
1477
1478AllSignaturesWithExcept:
1479 AllKeyword
1480 | AllKeyword ExceptKeyword SignatureRefList
1481;
1482
1483ImportModuleParSpec:
1484 ModuleParKeyword ModuleParRefList
1485 | ModuleParKeyword AllModuleParWithExcept
1486;
1487
1488ModuleParRefList:
1489 Identifier
1490 | ModuleParRefList ',' Identifier
1491;
1492
1493AllModuleParWithExcept:
1494 AllKeyword
1495 | AllKeyword ExceptKeyword ModuleParRefList
1496;
1497
1498/* A.1.6.1.9 Group definitions */
1499
1500GroupDef:
1501 GroupKeyword Identifier
1502 '{' optModuleDefinitionsPart '}'
1503;
1504
1505/* A.1.6.1.10 External function definitions */
1506
1507ExtFunctionDef:
1508 ExtKeyword FunctionKeyword Identifier
1509 '(' optFunctionFormalParList ')' optReturnType
1510;
1511
1512/* A.1.6.1.11 External constant definitions */
1513
1514ExtConstDef:
1515 ExtKeyword ConstKeyword Type Identifier
1516;
1517
1518/* A.1.6.1.12 Module parameter definitions */
1519
1520ModuleParDef:
1521 ModuleParKeyword ModulePar
1522 | ModuleParKeyword '{' MultitypedModuleParList '}'
1523;
1524
1525MultitypedModuleParList:
1526 ModulePar SemiColon
1527 | MultitypedModuleParList ModulePar SemiColon
1528;
1529
1530ModulePar:
1531 Type ModuleParList
1532;
1533
1534ModuleParList:
1535 SingleModulePar
1536 | ModuleParList ',' SingleModulePar
1537;
1538
1539SingleModulePar:
1540 Identifier
1541 | Identifier AssignmentChar Expression
1542;
1543
1544/* A.1.6.2 Control part */
1545
1546/* A.1.6.2.0 General */
1547
1548optModuleControlPart:
1549 /* empty */
1550 | ModuleControlPart
1551;
1552
1553ModuleControlPart:
1554 ControlKeyword
1555 '{' ModuleControlBody '}'
1556 optWithStatementAndSemiColon
1557;
1558
1559ModuleControlBody:
1560 /* empty */
1561 | ControlStatementOrDefList
1562;
1563
1564ControlStatementOrDefList:
1565 ControlStatementOrDef optSemiColon
1566 | ControlStatementOrDefList ControlStatementOrDef optSemiColon
1567;
1568
1569ControlStatementOrDef:
1570 FunctionLocalDef
1571 | FunctionLocalInst
1572 | ControlStatement
1573;
1574
1575ControlStatement:
1576 TimerStatements
1577 | BasicStatements
1578 | BehaviourStatements
1579 | SUTStatements
1580 | StopKeyword
1581;
1582
1583/* A.1.6.2.1 Variable instantiation */
1584
1585VarInstance:
1586 VarKeyword Type VarList
1587 | VarKeyword TemplateKeyword Type TempVarList
1588;
1589
1590VarList:
1591 SingleVarInstance
1592 | VarList ',' SingleVarInstance
1593;
1594
1595SingleVarInstance:
1596 Identifier optArrayDef
1597 | Identifier optArrayDef AssignmentChar VarInitialValue
1598;
1599
1600VarInitialValue:
1601 Expression
1602;
1603
1604TempVarList:
1605 SingleTempVarInstance
1606 | TempVarList ',' SingleTempVarInstance
1607;
1608
1609SingleTempVarInstance:
1610 Identifier optArrayDef
1611 | Identifier optArrayDef AssignmentChar TempVarInitialValue
1612;
1613
1614TempVarInitialValue:
1615 TemplateBody
1616;
1617
1618VariableRef:
1619 Reference
1620;
1621
1622/* A.1.6.2.2 Timer instantiation */
1623
1624TimerInstance:
1625 TimerKeyword TimerList
1626;
1627
1628TimerList:
1629 SingleTimerInstance
1630 | TimerList ',' SingleTimerInstance
1631;
1632
1633SingleTimerInstance:
1634 Identifier optArrayDef
1635 | Identifier optArrayDef AssignmentChar TimerValue
1636;
1637
1638TimerValue:
1639 Expression
1640;
1641
1642TimerRef:
1643 VariableRef
1644;
1645
1646/* A.1.6.2.3 Component operations */
1647
1648ConfigurationStatements:
1649 ConnectStatement
1650 | MapStatement
1651 | DisconnectStatement
1652 | UnmapStatement
1653 | DoneStatement
1654 | KilledStatement
1655 | StartTCStatement
1656 | StopTCStatement
1657 | KillTCStatement
1658;
1659
1660ConfigurationOps:
1661 CreateOp
1662 | SelfOp
1663 | SystemOp
1664 | MTCOp
1665 | RunningOp
1666 | AliveOp
1667;
1668
1669CreateOp:
1670 VariableRef DotCreateKeyword optAliveKeyword
1671 | VariableRef DotCreateKeyword '(' SingleExpression ')' optAliveKeyword
1672;
1673
1674optAliveKeyword:
1675 /* empty */
1676 | AliveKeyword
1677;
1678
1679SystemOp:
1680 SystemKeyword
1681;
1682
1683MTCOp:
1684 MTCKeyword
1685;
1686
1687DoneStatement:
1688 ComponentId DotDoneKeyword
1689;
1690
1691KilledStatement:
1692 ComponentId DotKilledKeyword
1693;
1694
1695ComponentId:
1696 ComponentOrDefaultReference
1697 | AnyKeyword ComponentKeyword
1698 | AllKeyword ComponentKeyword
1699;
1700
1701RunningOp:
1702/* VariableRef DotRunningKeyword -- covered by RunningTimerOp */
1703 FunctionInstance DotRunningKeyword
1704 | AnyKeyword ComponentKeyword DotRunningKeyword
1705 | AllKeyword ComponentKeyword DotRunningKeyword
1706;
1707
1708AliveOp:
1709 ComponentId DotAliveKeyword
1710;
1711
1712ConnectStatement:
1713 ConnectKeyword SingleConnectionSpec
1714;
1715
1716SingleConnectionSpec:
1717 '(' PortRef ',' PortRef ')'
1718;
1719
1720PortRef:
1721 ComponentRef Colon Port
1722;
1723
1724ComponentRef:
1725 ComponentOrDefaultReference
1726 | SystemOp
1727 | SelfOp
1728 | MTCOp
1729;
1730
1731DisconnectStatement:
1732 DisconnectKeyword optSingleOrMultiConnectionSpec
1733;
1734
1735optSingleOrMultiConnectionSpec:
1736 /* empty */
1737 | SingleConnectionSpec
1738 | AllConnectionsSpec
1739 | AllPortsSpec
1740 | AllCompsAllPortsSpec
1741;
1742
1743AllConnectionsSpec:
1744 '(' PortRef ')'
1745;
1746
1747AllPortsSpec:
1748 '(' ComponentRef ':' AllKeyword PortKeyword ')'
1749;
1750
1751AllCompsAllPortsSpec:
1752 '(' AllKeyword ComponentKeyword ':' AllKeyword PortKeyword ')'
1753;
1754
1755MapStatement:
1756 MapKeyword SingleConnectionSpec
1757;
1758
1759UnmapStatement:
1760 UnmapKeyword optSingleOrMultiConnectionSpec
1761;
1762
1763StartTCStatement:
1764/* VariableRef DotStartKeyword '(' FunctionInstance ')'
1765 -- covered by StartTimerStatement */
1766 FunctionInstance DotStartKeyword '(' FunctionInstance ')'
1767;
1768
1769StopTCStatement:
1770 StopKeyword
1771/* | VariableRef DotStopKeyword -- covered by StopTimerStatement */
1772 | FunctionInstance DotStopKeyword
1773 | MTCOp DotStopKeyword
1774 | SelfOp DotStopKeyword
1775 | AllKeyword ComponentKeyword DotStopKeyword
1776;
1777
1778ComponentReferenceOrLiteral:
1779 ComponentOrDefaultReference
1780 | MTCOp
1781 | SelfOp
1782;
1783
1784KillTCStatement:
1785 KillKeyword
1786 | ComponentReferenceOrLiteral DotKillKeyword
1787 | AllKeyword ComponentKeyword DotKillKeyword
1788;
1789
1790ComponentOrDefaultReference:
1791 VariableRef
1792 | FunctionInstance
1793;
1794
1795/* A.1.6.2.4 Port operations */
1796
1797Port:
1798 VariableRef
1799;
1800
1801CommunicationStatements:
1802 SendStatement
1803 | CallStatement
1804 | ReplyStatement
1805 | RaiseStatement
1806 | ReceiveStatement
1807 | TriggerStatement
1808 | GetCallStatement
1809 | GetReplyStatement
1810 | CatchStatement
1811 | CheckStatement
1812 | ClearStatement
1813 | StartStatement
1814 | StopStatement
1815;
1816
1817SendStatement:
1818 Port DotSendOpKeyword PortSendOp
1819;
1820
1821PortSendOp:
1822 '(' SendParameter ')' optToClause
1823;
1824
1825SendParameter:
1826 TemplateInstance
1827;
1828
1829optToClause:
1830 /* empty */
1831 | ToKeyword AddressRef
1832/* | ToKeyword AddressRefList -- covered by the previous rule
1833 (as ValueOrAttribList) */
1834 | ToKeyword AllKeyword ComponentKeyword
1835;
1836
1837AddressRefList:
1838 '(' seqAddressRef ')'
1839;
1840
1841seqAddressRef:
1842 AddressRef
1843 | seqAddressRef ',' AddressRef
1844;
1845
1846AddressRef:
1847 TemplateInstance
1848;
1849
1850CallStatement:
1851 Port DotCallOpKeyword PortCallOp optPortCallBody
1852;
1853
1854PortCallOp:
1855 '(' CallParameters ')' optToClause
1856;
1857
1858CallParameters:
1859 TemplateInstance
1860 | TemplateInstance ',' CallTimerValue
1861;
1862
1863CallTimerValue:
1864 TimerValue
1865 | NowaitKeyword
1866;
1867
1868optPortCallBody:
1869 /* empty */
1870 | '{' CallBodyStatementList '}'
1871;
1872
1873CallBodyStatementList:
1874 CallBodyStatement optSemiColon
1875 | CallBodyStatementList CallBodyStatement optSemiColon
1876;
1877
1878CallBodyStatement:
1879 CallBodyGuard StatementBlock
1880;
1881
1882CallBodyGuard:
1883 AltGuardChar CallBodyOps
1884;
1885
1886CallBodyOps:
1887 GetReplyStatement
1888 | CatchStatement
1889;
1890
1891ReplyStatement:
1892 Port DotReplyKeyword PortReplyOp
1893;
1894
1895PortReplyOp:
1896 '(' TemplateInstance optReplyValue ')' optToClause
1897;
1898
1899optReplyValue:
1900 /* empty */
1901 | ValueKeyword Expression
1902;
1903
1904RaiseStatement:
1905 Port DotRaiseKeyword PortRaiseOp
1906;
1907
1908PortRaiseOp:
1909 '(' Signature ',' TemplateInstance ')' optToClause
1910;
1911
1912ReceiveStatement:
1913 PortOrAny DotReceiveOpKeyword PortReceiveOp
1914;
1915
1916PortOrAny:
1917 Port
1918 | AnyKeyword PortKeyword
1919;
1920
1921PortReceiveOp:
1922 optReceiveParameter optFromClause optPortRedirect
1923;
1924
1925optReceiveParameter:
1926 /* empty */
1927 | '(' ReceiveParameter ')'
1928;
1929
1930ReceiveParameter:
1931 TemplateInstance
1932;
1933
1934optFromClause:
1935 /* empty */
1936 | FromClause
1937;
1938
1939FromClause:
1940 FromKeyword AddressRef
1941;
1942
1943optPortRedirect:
1944 /* empty */
1945 | PortRedirectSymbol ValueSpec
1946 | PortRedirectSymbol SenderSpec
1947 | PortRedirectSymbol ValueSpec SenderSpec
1948;
1949
1950ValueSpec:
1951 ValueKeyword VariableRef
1952;
1953
1954SenderSpec:
1955 SenderKeyword VariableRef
1956;
1957
1958TriggerStatement:
1959 PortOrAny DotTriggerOpKeyword PortTriggerOp
1960;
1961
1962PortTriggerOp:
1963 optReceiveParameter optFromClause optPortRedirect
1964;
1965
1966GetCallStatement:
1967 PortOrAny DotGetCallOpKeyword PortGetCallOp
1968;
1969
1970PortGetCallOp:
1971 optReceiveParameter optFromClause optPortRedirectWithParam
1972;
1973
1974optPortRedirectWithParam:
1975 /* empty */
1976 | PortRedirectSymbol RedirectWithParamSpec
1977;
1978
1979RedirectWithParamSpec:
1980 ParamSpec
1981 | ParamSpec SenderSpec
1982 | SenderSpec
1983;
1984
1985ParamSpec:
1986 ParamKeyword ParamAssignmentList
1987;
1988
1989ParamAssignmentList:
1990 '(' AssignmentList ')'
1991 | '(' VariableList ')'
1992;
1993
1994AssignmentList:
1995 VariableAssignment
1996 | AssignmentList ',' VariableAssignment
1997;
1998
1999VariableAssignment:
2000 VariableRef AssignmentChar Identifier
2001;
2002
2003VariableList:
2004 VariableEntry
2005 | VariableList ',' VariableEntry
2006;
2007
2008VariableEntry:
2009 VariableRef
2010 | NotUsedSymbol
2011;
2012
2013GetReplyStatement:
2014 PortOrAny DotGetReplyOpKeyword PortGetReplyOp
2015;
2016
2017PortGetReplyOp:
2018 optGetReplyParameter optFromClause
2019 optPortRedirectWithValueAndParam
2020;
2021
2022optPortRedirectWithValueAndParam:
2023 /* empty */
2024 | PortRedirectSymbol RedirectWithValueAndParamSpec
2025;
2026
2027RedirectWithValueAndParamSpec:
2028 ValueSpec
2029 | ValueSpec ParamSpec
2030 | ValueSpec SenderSpec
2031 | ValueSpec ParamSpec SenderSpec
2032 | RedirectWithParamSpec
2033;
2034
2035optGetReplyParameter:
2036 /* empty */
2037 | '(' ReceiveParameter ')'
2038 | '(' ReceiveParameter ValueMatchSpec ')'
2039;
2040
2041ValueMatchSpec:
2042 ValueKeyword TemplateInstance
2043;
2044
2045CheckStatement:
2046 PortOrAny DotCheckOpKeyword optCheckParameter
2047;
2048
2049optCheckParameter:
2050 /* empty */
2051 | '(' CheckParameter ')'
2052;
2053
2054CheckParameter:
2055 CheckPortOpsPresent
2056 | FromClausePresent
2057 | RedirectPresent
2058;
2059
2060FromClausePresent:
2061 FromClause
2062 | FromClause PortRedirectSymbol SenderSpec
2063;
2064
2065RedirectPresent:
2066 PortRedirectSymbol SenderSpec
2067;
2068
2069CheckPortOpsPresent:
2070 ReceiveOpKeyword PortReceiveOp
2071 | GetCallOpKeyword PortGetCallOp
2072 | GetReplyOpKeyword PortGetReplyOp
2073 | CatchOpKeyword PortCatchOp
2074;
2075
2076CatchStatement:
2077 PortOrAny DotCatchOpKeyword PortCatchOp
2078;
2079
2080PortCatchOp:
2081 optCatchOpParameter optFromClause optPortRedirect
2082;
2083
2084optCatchOpParameter:
2085 /* empty */
2086 | '(' CatchOpParameter ')'
2087;
2088
2089CatchOpParameter:
2090 Signature ',' TemplateInstance
2091 | TimeoutKeyword
2092;
2093
2094ClearStatement:
2095 PortOrAll DotClearOpKeyword
2096;
2097
2098PortOrAll:
2099 Port
2100 | AllKeyword PortKeyword
2101;
2102
2103StartStatement:
2104/* Port DotPortStartKeyword -- covered by StartTimerStatement */
2105 AllKeyword PortKeyword DotStartKeyword
2106;
2107
2108StopStatement:
2109/* Port DotPortStopKeyword -- covered by StopTimerStatement */
2110 AllKeyword PortKeyword DotStopKeyword
2111;
2112
2113/* A.1.6.2.5 Timer operations */
2114
2115TimerStatements:
2116 StartTimerStatement
2117 | StopTimerStatement
2118 | TimeoutStatement
2119;
2120
2121TimerOps:
2122 ReadTimerOp
2123 | RunningTimerOp
2124;
2125
2126StartTimerStatement:
2127 TimerRef DotStartKeyword optTimerValue
2128;
2129
2130optTimerValue:
2131 /* empty */
2132 | '(' TimerValue ')'
2133;
2134
2135StopTimerStatement:
2136 TimerRefOrAll DotStopKeyword
2137;
2138
2139TimerRefOrAll:
2140 TimerRef
2141 | AllKeyword TimerKeyword
2142;
2143
2144ReadTimerOp:
2145 TimerRef DotReadKeyword
2146;
2147
2148RunningTimerOp:
2149 TimerRefOrAny DotRunningKeyword
2150;
2151
2152TimeoutStatement:
2153 TimerRefOrAny DotTimeoutKeyword
2154;
2155
2156TimerRefOrAny:
2157 TimerRef
2158 | AnyKeyword TimerKeyword
2159;
2160
2161/* A.1.6.3 Type */
2162
2163Type:
2164 PredefinedType
2165 | ReferencedType
2166;
2167
2168PredefinedType:
2169 BitStringKeyword
2170 | BooleanKeyword
2171 | CharStringKeyword
2172 | UniversalCharString
2173 | IntegerKeyword
2174 | OctetStringKeyword
2175 | HexStringKeyword
2176 | VerdictTypeKeyword
2177 | FloatKeyword
2178 | AddressKeyword
2179 | DefaultKeyword
2180 | AnyTypeKeyword
2181 | ObjectIdentifierKeyword
2182;
2183
2184UniversalCharString:
2185 UniversalKeyword CharStringKeyword
2186;
2187
2188ReferencedType:
2189 Reference
2190 | FunctionInstance optExtendedFieldReference
2191 /* covers all parameterized type references */
2192;
2193
2194TypeReference:
2195 Identifier
2196 | Identifier TypeActualParList
2197;
2198
2199TypeActualParList:
2200 '(' seqTypeActualPar ')'
2201;
2202
2203seqTypeActualPar:
2204 TypeActualPar
2205 | seqTypeActualPar ',' TypeActualPar
2206;
2207
2208TypeActualPar:
2209 Expression
2210;
2211
2212optArrayDef:
2213 /* empty */
2214 | optArrayDef ArrayIndex
2215;
2216
2217ArrayIndex:
2218 '[' ArrayBounds ']'
2219 | '[' ArrayBounds DotDot ArrayBounds ']'
2220;
2221
2222ArrayBounds:
2223 SingleExpression
2224;
2225
2226/* A.1.6.4 Value */
2227
2228Value:
2229 PredefinedValue
2230 | ReferencedValue
2231;
2232
2233PredefinedValue:
2234 BitStringValue
2235 | BooleanValue
2236 | CharStringValue
2237 | IntegerValue
2238 | OctetStringValue
2239 | HexStringValue
2240 | VerdictTypeValue
2241/* | EnumeratedValue -- covered by ReferencedValue */
2242 | FloatValue
2243 | AddressValue
2244 | OmitValue
2245 | ObjectIdentifierValue
2246;
2247
2248BitStringValue:
2249 Bstring
2250;
2251
2252BooleanValue:
2253 BooleanConst
2254;
2255
2256IntegerValue:
2257 Number
2258;
2259
2260OctetStringValue:
2261 Ostring
2262;
2263
2264HexStringValue:
2265 Hstring
2266;
2267
2268VerdictTypeValue:
2269 VerdictConst
2270;
2271
2272CharStringValue:
2273 Cstring
2274 | Quadruple
2275;
2276
2277Quadruple:
2278 CharKeyword '(' Group ',' Plane ',' Row ',' Cell ')'
2279;
2280
2281Group:
2282 Number
2283;
2284
2285Plane:
2286 Number
2287;
2288
2289Row:
2290 Number
2291;
2292
2293Cell:
2294 Number
2295;
2296
2297ReferencedValue:
2298 Reference
2299;
2300
2301Reference:
2302 Identifier
2303 | Identifier Dot Identifier optExtendedFieldReference
2304 | Identifier Dot PredefinedType optExtendedFieldReference
2305 | Identifier ArrayOrBitRef optExtendedFieldReference
2306 | Identifier Dot ObjectIdentifierValue Dot Identifier
2307 optExtendedFieldReference
2308;
2309
2310FreeText:
2311 Cstring
2312;
2313
2314AddressValue:
2315 NullKeyword
2316;
2317
2318OmitValue:
2319 OmitKeyword
2320;
2321
2322/* A.1.6.5 Parameterization */
2323
2324FormalValuePar:
2325 Type Identifier
2326 | InParKeyword Type Identifier
2327 | InOutParKeyword Type Identifier
2328 | OutParKeyword Type Identifier
2329;
2330
2331FormalPortPar:
2332 Identifier Identifier
2333 | InOutParKeyword Identifier Identifier
2334;
2335
2336FormalTimerPar:
2337 TimerKeyword Identifier
2338 | InOutParKeyword TimerKeyword Identifier
2339;
2340
2341FormalTemplatePar:
2342 TemplateKeyword Type Identifier
2343 | InParKeyword TemplateKeyword Type Identifier
2344 | InOutParKeyword TemplateKeyword Type Identifier
2345 | OutParKeyword TemplateKeyword Type Identifier
2346;
2347
2348/* A.1.6.6 With statement */
2349
2350optWithStatement:
2351 /* empty */
2352 | WithStatement
2353;
2354
2355optWithStatementAndSemiColon:
2356 /* empty */
2357 | WithStatement
2358 | SemiColon
2359 | WithStatement SemiColon
2360;
2361
2362WithStatement:
2363 WithKeyword WithAttribList
2364;
2365
2366WithAttribList:
2367 '{' MultiWithAttrib '}'
2368;
2369
2370MultiWithAttrib:
2371 SingleWithAttrib optSemiColon
2372 | MultiWithAttrib SingleWithAttrib optSemiColon
2373;
2374
2375SingleWithAttrib:
2376 AttribKeyword optOverrideKeyword optAttribQualifier AttribSpec
2377;
2378
2379AttribKeyword:
2380 EncodeKeyword
2381 | VariantKeyword
2382 | DisplayKeyword
2383 | ExtensionKeyword
2384;
2385
2386optOverrideKeyword:
2387 /* empty */
2388 | OverrideKeyword
2389;
2390
2391optAttribQualifier:
2392 /* empty */
2393 | '(' DefOrFieldRefList ')'
2394;
2395
2396DefOrFieldRefList:
2397 DefOrFieldRef
2398 | DefOrFieldRefList ',' DefOrFieldRef
2399;
2400
2401DefOrFieldRef:
2402 DefinitionRef
2403 | FieldReference
2404 | AllRef
2405;
2406
2407DefinitionRef:
2408 /* other alternatives are covered by FieldReference */
2409 Identifier Dot FullGroupIdentifier
2410;
2411
2412AllRef:
2413 GroupKeyword AllKeyword
2414 | GroupKeyword AllKeyword ExceptKeyword '{' GroupRefList '}'
2415 | TypeDefKeyword AllKeyword
2416 | TypeDefKeyword AllKeyword ExceptKeyword '{' TypeRefList '}'
2417 | TemplateKeyword AllKeyword
2418 | TemplateKeyword AllKeyword ExceptKeyword '{' TemplateRefList '}'
2419 | ConstKeyword AllKeyword
2420 | ConstKeyword AllKeyword ExceptKeyword '{' ConstRefList '}'
2421 | AltstepKeyword AllKeyword
2422 | AltstepKeyword AllKeyword ExceptKeyword '{' AltstepRefList '}'
2423 | TestcaseKeyword AllKeyword
2424 | TestcaseKeyword AllKeyword ExceptKeyword '{' TestcaseRefList '}'
2425 | FunctionKeyword AllKeyword
2426 | FunctionKeyword AllKeyword ExceptKeyword '{' FunctionRefList '}'
2427 | SignatureKeyword AllKeyword
2428 | SignatureKeyword AllKeyword ExceptKeyword '{' SignatureRefList '}'
2429 | ModuleParKeyword AllKeyword
2430 | ModuleParKeyword AllKeyword ExceptKeyword '{' ModuleParRefList '}'
2431;
2432
2433AttribSpec:
2434 FreeText
2435;
2436
2437/* A.1.6.7 Behaviour statements */
2438
2439BehaviourStatements:
2440 TestcaseInstance
2441 | FunctionInstance
2442 | ReturnStatement
2443 | AltConstruct
2444 | InterleavedConstruct
2445 | LabelStatement
2446 | GotoStatement
2447 | RepeatStatement
2448 | DeactivateStatement
2449/* | AltstepInstance -- covered by FunctionInstance */
2450 | ActivateOp
2451;
2452
2453VerdictStatements:
2454 SetLocalVerdict
2455;
2456
2457VerdictOps:
2458 GetLocalVerdict
2459;
2460
2461SetLocalVerdict:
2462 SetVerdictKeyword '(' SingleExpression ')'
2463;
2464
2465GetLocalVerdict:
2466 GetVerdictKeyword
2467;
2468
2469SUTStatements:
2470 ActionKeyword '(' ')'
2471 | ActionKeyword '(' seqActionText ')'
2472;
2473
2474seqActionText:
2475 ActionText
2476/* | seqActionText StringOp ActionText -- covered by the previous rule */
2477;
2478
2479ActionText:
2480/* FreeText -- covered by the next rule */
2481 Expression
2482;
2483
2484ReturnStatement:
2485 ReturnKeyword
2486 | ReturnKeyword Expression
2487;
2488
2489AltConstruct:
2490 AltKeyword '{' AltGuardList '}'
2491;
2492
2493AltGuardList:
2494 AltGuard
2495 | AltGuardList AltGuard
2496;
2497
2498AltGuard:
2499 GuardStatement
2500 | ElseStatement optSemiColon
2501;
2502
2503GuardStatement:
2504 AltGuardChar AltstepInstance
2505 | AltGuardChar AltstepInstance StatementBlock
2506 | AltGuardChar GuardOp StatementBlock
2507;
2508
2509ElseStatement:
2510 '[' ElseKeyword ']' StatementBlock
2511;
2512
2513AltGuardChar:
2514 '[' ']'
2515 | '[' BooleanExpression ']'
2516;
2517
2518GuardOp:
2519 TimeoutStatement
2520 | ReceiveStatement
2521 | TriggerStatement
2522 | GetCallStatement
2523 | CatchStatement
2524 | CheckStatement
2525 | GetReplyStatement
2526 | DoneStatement
2527 | KilledStatement
2528;
2529
2530InterleavedConstruct:
2531 InterleavedKeyword '{' InterleavedGuardList '}'
2532;
2533
2534InterleavedGuardList:
2535 InterleavedGuardElement optSemiColon
2536 | InterleavedGuardList InterleavedGuardElement optSemiColon
2537;
2538
2539InterleavedGuardElement:
2540 InterleavedGuard InterleavedAction
2541;
2542
2543InterleavedGuard:
2544 '[' ']' GuardOp
2545;
2546
2547InterleavedAction:
2548 StatementBlock
2549;
2550
2551LabelStatement:
2552 LabelKeyword Identifier
2553;
2554
2555GotoStatement:
2556 GotoKeyword Identifier
2557;
2558
2559RepeatStatement:
2560 RepeatKeyword
2561;
2562
2563ActivateOp:
2564 ActivateKeyword '(' AltstepInstance ')'
2565;
2566
2567DeactivateStatement:
2568 DeactivateKeyword
2569 | DeactivateKeyword '(' ComponentOrDefaultReference ')'
2570;
2571
2572/* A.1.6.8 Basic statements */
2573
2574BasicStatements:
2575 Assignment
2576 | LogStatement
2577 | LoopConstruct
2578 | ConditionalConstruct
2579 | SelectCaseConstruct
2580;
2581
2582Expression:
2583 SingleExpression
2584 | CompoundExpression
2585;
2586
2587CompoundExpression:
2588 FieldExpressionList
2589 | ArrayExpression
2590;
2591
2592FieldExpressionList:
2593 '{' seqFieldExpressionSpec '}'
2594;
2595
2596seqFieldExpressionSpec:
2597 FieldExpressionSpec
2598 | seqFieldExpressionSpec ',' FieldExpressionSpec
2599;
2600
2601FieldExpressionSpec:
2602 FieldReference AssignmentChar NotUsedOrExpression
2603;
2604
2605ArrayExpression:
2606 '{' '}'
2607 | '{' ArrayElementExpressionList '}'
2608;
2609
2610ArrayElementExpressionList:
2611 NotUsedOrExpression
2612 | ArrayElementExpressionList ',' NotUsedOrExpression
2613;
2614
2615NotUsedOrExpression:
2616 Expression
2617 | NotUsedSymbol
2618;
2619
2620BooleanExpression:
2621 SingleExpression
2622;
2623
2624Assignment:
2625/* VariableRef AssignmentChar Expression -- covered by the next rule */
2626 VariableRef AssignmentChar TemplateBody
2627;
2628
2629SingleExpression:
2630 XorExpression
2631 | SingleExpression Or XorExpression
2632;
2633
2634XorExpression:
2635 AndExpression
2636 | XorExpression Xor AndExpression
2637;
2638
2639AndExpression:
2640 NotExpression
2641 | AndExpression And NotExpression
2642;
2643
2644NotExpression:
2645 EqualExpression
2646 | Not EqualExpression
2647;
2648
2649EqualExpression:
2650 RelExpression
2651 | EqualExpression EqualOp RelExpression
2652;
2653
2654RelExpression:
2655 ShiftExpression
2656 | ShiftExpression RelOp ShiftExpression
2657;
2658
2659ShiftExpression:
2660 BitOrExpression
2661 | ShiftExpression ShiftOp BitOrExpression
2662;
2663
2664BitOrExpression:
2665 BitXorExpression
2666 | BitOrExpression Or4b BitXorExpression
2667;
2668
2669BitXorExpression:
2670 BitAndExpression
2671 | BitXorExpression Xor4b BitAndExpression
2672;
2673
2674BitAndExpression:
2675 BitNotExpression
2676 | BitAndExpression And4b BitNotExpression
2677;
2678
2679BitNotExpression:
2680 AddExpression
2681 | Not4b AddExpression
2682;
2683
2684AddExpression:
2685 MulExpression
2686 | AddExpression AddOp MulExpression
2687;
2688
2689MulExpression:
2690 UnaryExpression
2691 | MulExpression MultiplyOp UnaryExpression
2692;
2693
2694UnaryExpression:
2695 Primary
2696 | UnaryOp Primary
2697;
2698
2699Primary:
2700 OpCall
2701 | Value
2702 | '(' SingleExpression ')'
2703;
2704
2705optExtendedFieldReference:
2706 /* empty */
2707 | optExtendedFieldReference Dot FieldIdentifier
2708 | optExtendedFieldReference ArrayOrBitRef
2709;
2710
2711FieldIdentifier:
2712 Identifier
2713 | PredefinedType
2714 | Identifier TypeActualParList
2715;
2716
2717OpCall:
2718 ConfigurationOps
2719 | VerdictOps
2720 | TimerOps
2721 | TestcaseInstance
2722 | FunctionInstance
2723 | TemplateOps
2724 | ActivateOp
2725;
2726
2727AddOp:
2728 '+'
2729 | '-'
2730 | StringOp
2731;
2732
2733MultiplyOp:
2734 '*'
2735 | '/'
2736 | Mod
2737 | Rem
2738;
2739
2740UnaryOp:
2741 '+'
2742 | '-'
2743;
2744
2745RelOp:
2746 '<'
2747 | '>'
2748 | GE
2749 | LE
2750;
2751
2752EqualOp:
2753 EQ
2754 | NE
2755;
2756
2757StringOp:
2758 '&'
2759;
2760
2761ShiftOp:
2762 SL
2763 | SR
2764 | RL
2765 | RR
2766;
2767
2768LogStatement:
2769 LogKeyword '(' seqLogItem ')'
2770;
2771
2772seqLogItem:
2773 LogItem
2774 | seqLogItem ',' LogItem
2775;
2776
2777LogItem:
2778/* FreeText -- covered by the next rule */
2779 TemplateInstance
2780;
2781
2782LoopConstruct:
2783 ForStatement
2784 | WhileStatement
2785 | DoWhileStatement
2786;
2787
2788ForStatement:
2789 ForKeyword '(' Initial SemiColon Final SemiColon Step ')'
2790 StatementBlock
2791;
2792
2793Initial:
2794 VarInstance
2795 | Assignment
2796;
2797
2798Final:
2799 BooleanExpression
2800;
2801
2802Step:
2803 Assignment
2804;
2805
2806WhileStatement:
2807 WhileKeyword '(' BooleanExpression ')'
2808 StatementBlock
2809;
2810
2811DoWhileStatement:
2812 DoKeyword StatementBlock
2813 WhileKeyword '(' BooleanExpression ')'
2814;
2815
2816ConditionalConstruct:
2817 IfKeyword '(' BooleanExpression ')'
2818 StatementBlock
2819 seqElseIfClause optElseClause
2820;
2821
2822seqElseIfClause:
2823 /* empty */
2824 | seqElseIfClause ElseIfClause
2825;
2826
2827ElseIfClause:
2828 ElseKeyword IfKeyword '(' BooleanExpression ')' StatementBlock
2829;
2830
2831optElseClause:
2832 /* empty */
2833 | ElseKeyword StatementBlock
2834;
2835
2836SelectCaseConstruct:
2837 SelectKeyword '(' SingleExpression ')' SelectCaseBody
2838;
2839
2840SelectCaseBody:
2841 '{' seqSelectCase '}'
2842;
2843
2844seqSelectCase:
2845 SelectCase
2846 | seqSelectCase SelectCase
2847;
2848
2849SelectCase:
2850 CaseKeyword '(' seqTemplateInstance ')' StatementBlock
2851 | CaseKeyword ElseKeyword StatementBlock
2852;
2853
2854seqTemplateInstance:
2855 TemplateInstance
2856 | seqTemplateInstance ',' TemplateInstance
2857;
2858
2859/* A.1.6.9 Miscellanous productions */
2860
2861Dot:
2862 '.'
2863;
2864
2865Dash:
2866 '-'
2867;
2868
2869Minus:
2870 '-'
2871;
2872
2873SemiColon:
2874 ';'
2875;
2876
2877optSemiColon:
2878 /* empty */
2879 | ';'
2880;
2881
2882Colon:
2883 ':'
2884;
2885
2886/* A.1 ASN.1 support */
2887
2888optDefinitiveIdentifier:
2889 /* empty */
2890 | DefinitiveIdentifier
2891;
2892
2893DefinitiveIdentifier:
2894 Dot ObjectIdentifierKeyword '{' DefinitiveObjIdComponentList '}'
2895;
2896
2897DefinitiveObjIdComponentList:
2898 DefinitiveObjIdComponent
2899 | DefinitiveObjIdComponentList DefinitiveObjIdComponent
2900;
2901
2902DefinitiveObjIdComponent:
2903 NameForm
2904 | DefinitiveNumberForm
2905 | DefinitiveNameAndNumberForm
2906;
2907
2908DefinitiveNumberForm:
2909 Number
2910;
2911
2912DefinitiveNameAndNumberForm:
2913 Identifier '(' DefinitiveNumberForm ')'
2914;
2915
2916ObjectIdentifierValue:
2917 ObjectIdentifierKeyword '{' ObjIdComponentList '}'
2918;
2919
2920ObjIdComponentList:
2921 ObjIdComponent
2922 | ObjIdComponentList ObjIdComponent
2923;
2924
2925ObjIdComponent:
2926/* NameForm -- covered by NumberForm (as ReferencedValue) */
2927 NumberForm
2928 | NameAndNumberForm
2929;
2930
2931NumberForm:
2932 Number
2933 | ReferencedValue
2934;
2935
2936NameAndNumberForm:
2937 Identifier '(' NumberForm ')'
2938;
2939
2940NameForm:
2941 Identifier
2942;
2943
2944%%
2945
2946/* Additional C code */
2947
2948extern int yylineno;
2949extern char *yytext;
2950extern FILE *yyin;
2951
2952extern int dot_flag;
2953
2954void yyerror(char *s)
2955{
2956 fprintf(stderr, "line %d: syntax error at or near token '%s': "
2957 "%s\n", yylineno, yytext, s);
2958}
2959
2960void parse_input()
2961{
2962 dot_flag = 0;
2963 if (!yyparse()) fprintf(stderr, "The input was parsed successfully!\n");
2964 else fprintf(stderr, "Parse error!\n");
2965}
2966
2967int main(int argc, char *argv[])
2968{
2969 puts("TTCN-3 parser. Complies with BNF v3.0.0\n"
d44e3c4f 2970 "Copyright (c) 2000-2016 Ericsson Telecom AB");
970ed795
EL
2971 if (argc > 1) {
2972 int i;
2973 for (i = 1; i < argc; i++) {
2974 yyin = fopen(argv[i], "r");
2975 if (yyin == NULL) {
2976 fprintf(stderr, "%s: Cannot open file"
2977 " %s for reading: %s\n", argv[0], argv[i],
2978 strerror(errno));
2979 return 1;
2980 }
2981 printf("Parsing file %s ...\n", argv[i]);
2982 parse_input();
2983 fclose(yyin);
2984 }
2985 } else {
2986 puts("Parsing standard input ...");
2987 parse_input();
2988 }
2989 return 0;
2990}
This page took 0.140559 seconds and 5 git commands to generate.