// A.1.6  TTCN-3 syntax BNF productions 
// A.1.6.0 TTCN-3 module 
1.TTCN3Module ::= TTCN3ModuleKeyword ModuleId "{" [ModuleDefinitionsList]    
                   [ModuleControlPart] "}" [WithStatement] [SemiColon]  
2.TTCN3ModuleKeyword ::= "module"  
3.ModuleId ::= Identifier [LanguageSpec]  
4.LanguageSpec ::= LanguageKeyword FreeText {"," FreeText}  
5.LanguageKeyword ::= "language"  
// A.1.6.1 Module definitions part 
// A.1.6.1.0 General 
6.ModuleDefinitionsList ::= {ModuleDefinition [SemiColon]}+  
7.ModuleDefinition ::= (([Visibility] (TypeDef |  
                                        ConstDef |  
                                        TemplateDef |  
                                        ModuleParDef |  
                                        FunctionDef |  
                                        SignatureDef |  
                                        TestcaseDef |  
                                        AltstepDef |  
                                        ImportDef |  
                                        ExtFunctionDef |  
                                        ExtConstDef  
                                       )) |  
                         (["public"] GroupDef) |  
                         (["private"] FriendModuleDef)  
                        ) [WithStatement]  
8.Visibility ::= "public" |  
                  "friend" |  
                  "private"  
// A.1.6.1.1 Typedef d efinitions 
9.TypeDef ::= TypeDefKeyword TypeDefBody  
10.TypeDefBody ::= StructuredTypeDef | SubTypeDef  
11.TypeDefKeyword ::= "type"  
12.StructuredTypeDef ::= RecordDef |  
                          UnionDef |  
                          SetDef |  
                          RecordOfDef |  
                          SetOfDef |  
                          EnumDef |  
                          PortDef |  
                          ComponentDef  
13.RecordDef ::= RecordKeyword Identifier  
14.RecordKeyword ::= "record"  
15.StructDefBody ::= (Identifier | AddressKeyword) "{" [StructFieldDef    
                                                         {"," StructFieldDef}]    
                      "}"  
16.StructFieldDef ::= (Type | NestedTypeDef) Identifier [ArrayDef] [SubTypeSpec]    
                       [OptionalKeyword]  
17.NestedTypeDef ::= NestedRecordDef |  
                      NestedUnionDef |  
                      NestedSetDef |  
                      NestedRecordOfDef |  
                      NestedSetOfDef |  
                      NestedEnumDef  
18.NestedRecordDef ::= RecordKeyword "{" [StructFieldDef {"," StructFieldDef}]    
                        "}"  
19.NestedUnionDef ::= UnionKeyword "{" UnionFieldDef {"," UnionFieldDef}    
                       "}"  
20.NestedSetDef ::= SetKeyword "{" [StructFieldDef {"," StructFieldDef}]    
                     "}"  
21.NestedRecordOfDef ::= RecordKeyword [StringLength] OfKeyword (Type |  
                                                                  NestedTypeDef)  
22.NestedSetOfDef ::= SetKeyword [StringLength] OfKeyword (Type | NestedTypeDef)  
23.NestedEnumDef ::= EnumKeyword "{" EnumerationList "}"  
24.OptionalKeyword ::= "optional"  
25.UnionDef ::= UnionKeyword UnionDefBody  
26.UnionKeyword ::= "union"  
 
 
27.UnionDefBody ::= (Identifier | AddressKeyword) "{" UnionFieldDef {","    
                                                                      UnionFieldDef}    
                     "}"  
28.UnionFieldDef ::= (Type | NestedTypeDef) Identifier [ArrayDef] [SubTypeSpec]  
29.SetDef ::= SetKeyword StructDefBody  
30.SetKeyword ::= "set"  
31.RecordOfDef ::= RecordKeyword [StringLength] OfKeyword StructOfDefBody  
32.OfKeyword ::= "of"  
33.StructOfDefBody ::= (Type | NestedTypeDef) (Identifier | AddressKeyword)    
                        [SubTypeSpec]  
34.SetOfDef ::= SetKeyword [StringLength] OfKeyword StructOfDefBody  
35.EnumDef ::= EnumKeyword (Identifier | AddressKeyword) "{" EnumerationList    
                "}"  
36.EnumKeyword ::= "enumerated"  
37.EnumerationList ::= Enumeration {"," Enumeration}  
38.Enumeration ::= Identifier ["(" [Minus] Number ")"]  
39.SubTypeDef ::= Type (Identifier | AddressKeyword) [ArrayDef] [SubTypeSpec]  
40.SubTypeSpec ::= AllowedValues [StringLength] | StringLength  
 
/* STATIC SEMANTICS - AllowedValues shall be of the same type as the field being subtyped */  
41.AllowedValues ::= "(" (ValueOrRange {"," ValueOrRange}) | CharStringMatch    
                      ")"  
42.ValueOrRange ::= RangeDef |  
                     ConstantExpression |  
                     Type  
 
/* STATIC SEMANTICS - RangeDef production shall only be used with integer, charstring, universal 
charstring or float based types */  
/* STATIC SEMANTICS - When subtyping charstring or universal charstring range and values shall not 
be mixed in the same SubTypeSpec */  
43.RangeDef ::= Bound ".." Bound  
44.StringLength ::= LengthKeyword "(" SingleExpression [".." Bound] ")"  
 
/* STATIC SEMANTICS - StringLength shall only be used with String types or to limit set of and 
record of. SingleExpression and Bound shall evaluate to non-negative integer values (in case of 
Bound including infinity) */  
45.LengthKeyword ::= "length"  
46.PortDef ::= PortKeyword PortDefBody  
47.PortDefBody ::= Identifier PortDefAttribs  
48.PortKeyword ::= "port"  
49.PortDefAttribs ::= MessageAttribs |  
                       ProcedureAttribs |  
                       MixedAttribs  
50.MessageAttribs ::= MessageKeyword "{" [AddressDecl] {MessageList [SemiColon]}+    
                       "}" [MapKeyword ParamKeyword "(" FormalValuePar    
                            {"," FormalValuePar} ")"] [UnmapKeyword ParamKeyword    
                                                      "(" FormalValuePar    
                                                      {"," FormalValuePar}    
                                                      ")"]  
51.AddressDecl ::= AddressKeyword Type SemiColon  
52.MessageList ::= Direction AllOrTypeList  
53.Direction ::= InParKeyword |  
                  OutParKeyword |  
                  InOutParKeyword  
54.MessageKeyword ::= "message"  
55.AllOrTypeList ::= AllKeyword | TypeList  
 
/* NOTE: The use of AllKeyword in port definitions is deprecated */  
56.AllKeyword ::= "all"  
57.TypeList ::= Type {"," Type}  
58.ProcedureAttribs ::= ProcedureKeyword "{" [AddressDecl] {ProcedureList    
                                                             [SemiColon]}+    
                         "}" [MapKeyword ParamKeyword "(" FormalValuePar    
                              {"," FormalValuePar} ")"] [UnmapKeyword ParamKeyword    
                                                        "(" FormalValuePar    
                                                        {"," FormalValuePar}    
                                                        ")"]  
59.ProcedureKeyword ::= "procedure"  
60.ProcedureList ::= Direction AllOrSignatureList  
61.AllOrSignatureList ::= AllKeyword | SignatureList  
62.SignatureList ::= Signature {"," Signature}  
63.MixedAttribs ::= MixedKeyword "{" [AddressDecl] {MixedList [SemiColon]}+    
                     "}"  
64.MixedKeyword ::= "mixed"  
65.MixedList ::= Direction ProcOrTypeList  
66.ProcOrTypeList ::= AllKeyword | (ProcOrType {"," ProcOrType})  
67.ProcOrType ::= Signature | Type  
68.ComponentDef ::= ComponentKeyword Identifier [ExtendsKeyword ComponentType    
 
 
                                                  {"," ComponentType}] "{"    
                     [ComponentDefList] "}"  
69.ComponentKeyword ::= "component"  
70.ExtendsKeyword ::= "extends"  
71.ComponentType ::= ExtendedIdentifier  
72.ComponentDefList ::= {ComponentElementDef [SemiColon]}  
73.ComponentElementDef ::= PortInstance |  
                            VarInstance |  
                            TimerInstance |  
                            ConstDef  
74.PortInstance ::= PortKeyword ExtendedIdentifier PortElement {"," PortElement}  
75.PortElement ::= Identifier [ArrayDef]  
// A.1.6.1.2 Constant d efinitions 
76.ConstDef ::= ConstKeyword Type ConstList  
77.ConstList ::= SingleConstDef {"," SingleConstDef}  
78.SingleConstDef ::= Identifier [ArrayDef] AssignmentChar ConstantExpression  
79.ConstKeyword ::= "const"  
// A.1.6.1.3 Template d efinitions 
80.TemplateDef ::= TemplateKeyword [TemplateRestriction] BaseTemplate    
                    [DerivedDef] AssignmentChar TemplateBody  
81.BaseTemplate ::= (Type | Signature) Identifier ["(" TemplateOrValueFormalParList    
                                                    ")"]  
82.TemplateKeyword ::= "template"  
83.DerivedDef ::= ModifiesKeyword ExtendedIdentifier  
84.ModifiesKeyword ::= "modifies"  
85.TemplateOrValueFormalParList ::= TemplateOrValueFormalPar {"," TemplateOrValueFormalPar}  
86.TemplateOrValueFormalPar ::= FormalValuePar | FormalTemplatePar  
 
/* STATIC SEMANTICS - FormalValuePar shall resolve to an in parameter */  
87.TemplateBody ::= (SimpleSpec |  
                      FieldSpecList |  
                      ArrayValueOrAttrib  
                     ) [ExtraMatchingAttributes]  
 
/* STATIC SEMANTICS - Within TeplateBody the ArrayValueOrAttrib can be used for array, record, 
record of and set of types. */  
88.SimpleSpec ::= (SingleExpression ["&" SimpleTemplateSpec]) | SimpleTemplateSpec  
89.SimpleTemplateSpec ::= CharStringMatch | (SingleTemplateExpression    
                                              ["&" SimpleSpec])  
90.SingleTemplateExpression ::= MatchingSymbol | (TemplateRefWithParList    
                                                   [ExtendedFieldReference])  
91.FieldSpecList ::= "{" [FieldSpec {"," FieldSpec}] "}"  
92.FieldSpec ::= FieldReference AssignmentChar TemplateBody  
93.FieldReference ::= StructFieldRef |  
                       ArrayOrBitRef |  
                       ParRef  
94.StructFieldRef ::= Identifier |  
                       PredefinedType |  
                       TypeReference  
 
/* STATIC SEMANTICS - PredefinedType and TypeReference shall be used for anytype value notation 
only. PredefinedType shall not be AnyTypeKeyword.*/  
95.ParRef ::= Identifier  
 
/* STATIC SEMANTICS - Identifier in ParRef shall be a formal parameter identifier from the 
associated signature definition */  
96.ArrayOrBitRef ::= "[" FieldOrBitNumber "]"  
 
/* STATIC SEMANTICS - ArrayRef shall be optionally used for array types and TTCN-3 record of and set 
of. The same notation can be used for a Bit reference inside an TTCN-3 charstring, universal 
charstring, bitstring, octetstring and hexstring type */  
97.FieldOrBitNumber ::= SingleExpression  
 
/* STATIC SEMANTICS - SingleExpression will resolve to a value of integer type */  
98.ArrayValueOrAttrib ::= "{" ArrayElementSpecList "}"  
99.ArrayElementSpecList ::= ArrayElementSpec {"," ArrayElementSpec}  
100.ArrayElementSpec ::= Minus |  
                          PermutationMatch |  
                          TemplateBody  
101.MatchingSymbol ::= Complement |  
                        (AnyValue [WildcardLengthMatch]) |  
                        (AnyOrOmit [WildcardLengthMatch]) |  
                        ValueOrAttribList |  
                        Range |  
 
 
                        BitStringMatch |  
                        HexStringMatch |  
                        OctetStringMatch |  
                        CharStringMatch |  
                        SubsetMatch |  
                        SupersetMatch  
 
/* STATIC SEMANTIC  WildcardLengthMatch must be used when MatchingSymbol is used in fractions of a 
concatenated string or list (see clause 15.11) and shall not be used in other cases. In this case, 
the Complement, ValueOrAttribList, Range, BitStringMatch, HexStringMatch, OctetStringMatch, 
CharStringMatch, SubsetMatch and SupersetMatch productions shall not be used. */  
102.ExtraMatchingAttributes ::= StringLength |  
                                 IfPresentKeyword |  
                                 (StringLength IfPresentKeyword)  
103.BitStringMatch ::= "'" {BinOrMatch} "'" "B"  
104.BinOrMatch ::= Bin |  
                    AnyValue |  
                    AnyOrOmit  
105.HexStringMatch ::= "'" {HexOrMatch} "'" "H"  
106.HexOrMatch ::= Hex |  
                    AnyValue |  
                    AnyOrOmit  
107.OctetStringMatch ::= "'" {OctOrMatch} "'" "O"  
108.OctOrMatch ::= Oct |  
                    AnyValue |  
                    AnyOrOmit  
109.CharStringMatch ::= PatternKeyword PatternParticle {"&" PatternParticle}  
110.PatternParticle ::= Pattern | ReferencedValue  
111.PatternKeyword ::= "pattern"  
112.Pattern ::= """ {PatternElement} """  
113.PatternElement ::= ("\" ("?" | "*" | "\" | "[" | "]" | "{" | "}" |  
                              """ | "|" | "(" | ")" | "#" | "+" | "d" |  
                              "w" | "t" | "n" | "r" | "s" | "b"  
                             )) | ("?" | "*" | "\" | "|" | "+"  
                                  ) | ("[" ["^"] [{PatternChar ["-" PatternChar]}]    
                                       "]") |  
                        ("{" ReferencedValue "}") |  
                        ("\" "N" "{" (ReferencedValue | Type) "}") |  
                        (""" """) |  
                        ("(" PatternElement ")") |  
                        ("#" (Num |  
                              ("(" Num "," [Num] ")") | ("(" "," Num ")")  
                             )) |  
                        PatternChar  
114.PatternChar ::= Char | PatternQuadruple  
115.PatternQuadruple ::= "\" "q" "(" Number "," Number "," Number ","    
                          Number ")"  
116.Complement ::= ComplementKeyword "(" TemplateBody {"," TemplateBody}    
                    ")"  
117.ComplementKeyword ::= "complement"  
118.SubsetMatch ::= SubsetKeyword ValueOrAttribList  
119.SubsetKeyword ::= "subset"  
120.SupersetMatch ::= SupersetKeyword ValueOrAttribList  
121.SupersetKeyword ::= "superset"  
122.PermutationMatch ::= PermutationKeyword PermutationList  
123.PermutationKeyword ::= "permutation"  
124.PermutationList ::= "(" TemplateBody {"," TemplateBody} ")"  
 
/* STATIC SEMANTICS: Restrictions on the content of TemplateBody are given in clause B.1.3.3. */  
125.AnyValue ::= "?"  
126.AnyOrOmit ::= "*"  
127.ValueOrAttribList ::= "(" TemplateBody {"," TemplateBody}+ ")"  
128.WildcardLengthMatch ::= LengthKeyword "(" ConstantExpression ")"  
129.IfPresentKeyword ::= "ifpresent"  
130.PresentKeyword ::= "present"  
131.Range ::= "(" Bound ".." Bound ")"  
132.Bound ::= (["!"] SingleExpression) | ([Minus] InfinityKeyword)  
 
/* STATIC SEMANTICS - Bounds shall evaluate to types integer, charstring, universal charstring or 
float. In case they evaluate to types charstring or universal charstring, the string length shall be 
1. infinity as lower bound and infinity as upper bound are allowed for float types only. */  
133.InfinityKeyword ::= "infinity"  
134.TemplateInstanceAssignment ::= Identifier ":=" InLineTemplate  
 
/* STATIC SEMANTICS  if a value parameter is used, the inline template shall evaluate to a value */  
135.TemplateRefWithParList ::= ExtendedIdentifier [TemplateActualParList]  
136.InLineTemplate ::= [(Type | Signature) Colon] [DerivedRefWithParList    
                                                    AssignmentChar] TemplateBody  
 
 
137.DerivedRefWithParList ::= ModifiesKeyword TemplateRefWithParList  
138.TemplateActualParList ::= "(" [(TemplateInstanceActualPar {"," TemplateInstanceActualPar}) |  
                                    (TemplateInstanceAssignment {"," TemplateInstanceAssignment})]    
                               ")"  
139.TemplateInstanceActualPar ::= InLineTemplate | Minus  
 
/* STATIC SEMANTICS - When the corresponding formal parameter is not of template type the 
TemplateInstance production shall resolve to one or more SingleExpressions */  
140.TemplateOps ::= MatchOp | ValueofOp  
141.MatchOp ::= MatchKeyword "(" Expression "," InLineTemplate ")"  
142.MatchKeyword ::= "match"  
143.ValueofOp ::= ValueofKeyword "(" InLineTemplate ")"  
144.ValueofKeyword ::= "valueof"  
// A.1.6.1.4 Function d efinitions 
145.FunctionDef ::= FunctionKeyword Identifier "(" [FunctionFormalParList]    
                     ")" [RunsOnSpec] [ReturnType] StatementBlock  
146.FunctionKeyword ::= "function"  
147.FunctionFormalParList ::= FunctionFormalPar {"," FunctionFormalPar}  
148.FunctionFormalPar ::= FormalValuePar |  
                           FormalTimerPar |  
                           FormalTemplatePar |  
                           FormalPortPar  
149.ReturnType ::= ReturnKeyword [TemplateKeyword | RestrictedTemplate]    
                    Type  
150.ReturnKeyword ::= "return"  
151.RunsOnSpec ::= RunsKeyword OnKeyword ComponentType  
152.RunsKeyword ::= "runs"  
153.OnKeyword ::= "on"  
154.MTCKeyword ::= "mtc"  
155.StatementBlock ::= "{" [FunctionDefList] [FunctionStatementList] "}"  
156.FunctionDefList ::= {(FunctionLocalDef | FunctionLocalInst) [SemiColon]}+  
157.FunctionStatementList ::= {FunctionStatement [SemiColon]}+  
158.FunctionLocalInst ::= VarInstance | TimerInstance  
159.FunctionLocalDef ::= ConstDef | TemplateDef  
160.FunctionStatement ::= ConfigurationStatements |  
                           TimerStatements |  
                           CommunicationStatements |  
                           BasicStatements |  
                           BehaviourStatements |  
                           SetLocalVerdict |  
                           SUTStatements |  
                           TestcaseOperation  
161.FunctionInstance ::= FunctionRef "(" [FunctionActualParList] ")"  
162.FunctionRef ::= [Identifier Dot] (Identifier | PreDefFunctionIdentifier)  
163.PreDefFunctionIdentifier ::= Identifier  
 
/* STATIC SEMANTICS - The Identifier shall be one of the pre-defined TTCN-3 Function Identifiers 
from Annex C of ES 201 873-1 */  
164.FunctionActualParList ::= (FunctionActualPar {"," FunctionActualPar}) |  
                               (FunctionActualParAssignment {"," FunctionActualParAssignment})  
165.FunctionActualPar ::= ArrayIdentifierRef |  
                           InLineTemplate |  
                           ComponentRef |  
                           Minus  
 
/* STATIC SEMANTICS - When the corresponding formal parameter is not of template type the 
TemplateInstance production shall resolve to one or more SingleExpressions i.e. equivalent to the 
Expression production */  
166.FunctionActualParAssignment ::= TemplateInstanceAssignment |  
                                     ComponentRefAssignment |  
                                     ArrayIdentifierRefAssignment  
167.ArrayIdentifierRefAssignment ::= Identifier ":=" ArrayIdentifierRef  
// A.1.6.1.5 Signature d efinitions 
168.SignatureDef ::= SignatureKeyword Identifier "(" [SignatureFormalParList]    
                      ")" [ReturnType | NoBlockKeyword] [ExceptionSpec]  
169.SignatureKeyword ::= "signature"  
170.SignatureFormalParList ::= FormalValuePar {"," FormalValuePar}  
171.ExceptionSpec ::= ExceptionKeyword "(" TypeList ")"  
172.ExceptionKeyword ::= "exception"  
173.Signature ::= ExtendedIdentifier  
174.NoBlockKeyword ::= "noblock"  
 
 
// A.1.6.1.6 Testcase d efinitions 
175.TestcaseDef ::= TestcaseKeyword Identifier "(" [TemplateOrValueFormalParList]    
                     ")" ConfigSpec StatementBlock  
176.TestcaseKeyword ::= "testcase"  
177.ConfigSpec ::= RunsOnSpec [SystemSpec]  
178.SystemSpec ::= SystemKeyword ComponentType  
179.SystemKeyword ::= "system"  
180.TestcaseInstance ::= ExecuteKeyword "(" ExtendedIdentifier "(" [TestcaseActualParList]    
                          ")" ["," (Expression | Minus) ["," SingleExpression]]    
                          ")"  
181.ExecuteKeyword ::= "execute"  
182.TestcaseActualParList ::= (TemplateInstanceActualPar {"," TemplateInstanceActualPar}) |  
                               (TemplateInstanceAssignment {"," TemplateInstanceAssignment})  
 
/* STATIC SEMANTICS - When the corresponding formal parameter is not of template type the 
TemplateInstance production shall resolve to one or more SingleExpressions i.e. equivalent to the 
Expression production */  
// A.1.6.1.7 Altstep d efinitions 
183.AltstepDef ::= AltstepKeyword Identifier "(" [FunctionFormalParList]    
                    ")" [RunsOnSpec] "{" AltstepLocalDefList AltGuardList    
                    "}"  
184.AltstepKeyword ::= "altstep"  
185.AltstepLocalDefList ::= {AltstepLocalDef [SemiColon]}  
186.AltstepLocalDef ::= VarInstance |  
                         TimerInstance |  
                         ConstDef |  
                         TemplateDef  
187.AltstepInstance ::= ExtendedIdentifier "(" [FunctionActualParList]    
                         ")"  
// A.1.6.1.8 Import d efinitions 
188.ImportDef ::= ImportKeyword ImportFromSpec (AllWithExcepts | ("{"    
                                                                   ImportSpec    
                                                                   "}"))  
189.ImportKeyword ::= "import"  
190.AllWithExcepts ::= AllKeyword [ExceptsDef]  
191.ExceptsDef ::= ExceptKeyword "{" ExceptSpec "}"  
192.ExceptKeyword ::= "except"  
193.ExceptSpec ::= {ExceptElement [SemiColon]}  
194.ExceptElement ::= ExceptGroupSpec |  
                       ExceptTypeDefSpec |  
                       ExceptTemplateSpec |  
                       ExceptConstSpec |  
                       ExceptTestcaseSpec |  
                       ExceptAltstepSpec |  
                       ExceptFunctionSpec |  
                       ExceptSignatureSpec |  
                       ExceptModuleParSpec  
195.ExceptGroupSpec ::= GroupKeyword (FullGroupIdentifierList | AllKeyword)  
196.IdentifierListOrAll ::= IdentifierList | AllKeyword  
197.ExceptTypeDefSpec ::= TypeDefKeyword IdentifierListOrAll  
198.ExceptTemplateSpec ::= TemplateKeyword IdentifierListOrAll  
199.ExceptConstSpec ::= ConstKeyword IdentifierListOrAll  
200.ExceptTestcaseSpec ::= TestcaseKeyword IdentifierListOrAll  
201.ExceptAltstepSpec ::= AltstepKeyword IdentifierListOrAll  
202.ExceptFunctionSpec ::= FunctionKeyword IdentifierListOrAll  
203.ExceptSignatureSpec ::= SignatureKeyword IdentifierListOrAll  
204.ExceptModuleParSpec ::= ModuleParKeyword IdentifierListOrAll  
205.ImportSpec ::= {ImportElement [SemiColon]}  
206.ImportElement ::= ImportGroupSpec |  
                       ImportTypeDefSpec |  
                       ImportTemplateSpec |  
                       ImportConstSpec |  
                       ImportTestcaseSpec |  
                       ImportAltstepSpec |  
                       ImportFunctionSpec |  
                       ImportSignatureSpec |  
                       ImportModuleParSpec |  
                       ImportImportSpec  
207.ImportFromSpec ::= FromKeyword ModuleId [RecursiveKeyword]  
208.RecursiveKeyword ::= "recursive"  
209.ImportGroupSpec ::= GroupKeyword (GroupRefListWithExcept | AllGroupsWithExcept)  
210.GroupRefListWithExcept ::= FullGroupIdentifierWithExcept {"," FullGroupIdentifierWithExcept}  
 
 
211.AllGroupsWithExcept ::= AllKeyword [ExceptKeyword FullGroupIdentifierList]  
212.FullGroupIdentifier ::= Identifier {Dot Identifier}  
213.FullGroupIdentifierWithExcept ::= FullGroupIdentifier [ExceptsDef]  
214.IdentifierListOrAllWithExcept ::= IdentifierList | AllWithExcept  
215.ImportTypeDefSpec ::= TypeDefKeyword IdentifierListOrAllWithExcept  
216.AllWithExcept ::= AllKeyword [ExceptKeyword IdentifierList]  
217.ImportTemplateSpec ::= TemplateKeyword IdentifierListOrAllWithExcept  
218.ImportConstSpec ::= ConstKeyword IdentifierListOrAllWithExcept  
219.ImportAltstepSpec ::= AltstepKeyword IdentifierListOrAllWithExcept  
220.ImportTestcaseSpec ::= TestcaseKeyword IdentifierListOrAllWithExcept  
221.ImportFunctionSpec ::= FunctionKeyword IdentifierListOrAllWithExcept  
222.ImportSignatureSpec ::= SignatureKeyword IdentifierListOrAllWithExcept  
223.ImportModuleParSpec ::= ModuleParKeyword IdentifierListOrAllWithExcept  
224.ImportImportSpec ::= ImportKeyword AllKeyword  
// A.1.6.1.9 Group d efinitions 
225.GroupDef ::= GroupKeyword Identifier "{" [ModuleDefinitionsList] "}"  
226.GroupKeyword ::= "group"  
// A.1.6.1.10  External function definitions 
227.ExtFunctionDef ::= ExtKeyword FunctionKeyword Identifier "(" [FunctionFormalParList]    
                        ")" [ReturnType]  
228.ExtKeyword ::= "external"  
// A.1.6.1.11 External c onstant d efinitions 
229.ExtConstDef ::= ExtKeyword ConstKeyword Type IdentifierList  
// A.1.6.1.12 Module p arameter d efinitions 
230.ModuleParDef ::= ModuleParKeyword (ModulePar | ("{" MultitypedModuleParList    
                                                     "}"))  
231.ModuleParKeyword ::= "modulepar"  
232.MultitypedModuleParList ::= {ModulePar [SemiColon]}  
233.ModulePar ::= Type ModuleParList  
234.ModuleParList ::= Identifier [AssignmentChar ConstantExpression] {","    
                                                                       Identifier    
                                                                       [AssignmentChar    
                                                                       ConstantExpression]}  
// A.1.6.1.13  Friend module definitions 
235.FriendModuleDef ::= "friend" "module" IdentifierList [SemiColon]  
// A.1.6.2 Control part 
236.ModuleControlPart ::= ControlKeyword "{" ModuleControlBody "}" [WithStatement]    
                           [SemiColon]  
237.ControlKeyword ::= "control"  
238.ModuleControlBody ::= [ControlStatementOrDefList]  
239.ControlStatementOrDefList ::= {ControlStatementOrDef [SemiColon]}+  
240.ControlStatementOrDef ::= FunctionLocalDef |  
                               FunctionLocalInst |  
                               ControlStatement  
241.ControlStatement ::= TimerStatements |  
                          BasicStatements |  
                          BehaviourStatements |  
                          SUTStatements |  
                          StopKeyword  
// A.1.6.3 Local definitions 
// A.1.6.3.1 Variable in stantiation 
242.VarInstance ::= VarKeyword ((Type VarList) | ((TemplateKeyword | RestrictedTemplate)    
                                                   Type TempVarList))  
243.VarList ::= SingleVarInstance {"," SingleVarInstance}  
244.SingleVarInstance ::= Identifier [ArrayDef] [AssignmentChar Expression]  
245.VarKeyword ::= "var"  
246.TempVarList ::= SingleTempVarInstance {"," SingleTempVarInstance}  
247.SingleTempVarInstance ::= Identifier [ArrayDef] [AssignmentChar TemplateBody]  
248.VariableRef ::= Identifier [ExtendedFieldReference]  
 
 
// A.1.6.3.2 Timer in stantiation 
249.TimerInstance ::= TimerKeyword VarList  
250.TimerKeyword ::= "timer"  
251.ArrayIdentifierRef ::= Identifier {ArrayOrBitRef}  
// A.1.6.4 Operations 
// A.1.6.4.1 Component o perations 
252.ConfigurationStatements ::= ConnectStatement |  
                                 MapStatement |  
                                 DisconnectStatement |  
                                 UnmapStatement |  
                                 DoneStatement |  
                                 KilledStatement |  
                                 StartTCStatement |  
                                 StopTCStatement |  
                                 KillTCStatement  
253.ConfigurationOps ::= CreateOp |  
                          SelfOp |  
                          SystemKeyword |  
                          MTCKeyword |  
                          RunningOp |  
                          AliveOp  
254.CreateOp ::= ComponentType Dot CreateKeyword ["(" (SingleExpression |  
                                                        Minus) ["," SingleExpression]    
                                                   ")"] [AliveKeyword]  
255.SelfOp ::= "self"  
256.DoneStatement ::= ComponentId Dot DoneKeyword  
257.KilledStatement ::= ComponentId Dot KilledKeyword  
258.ComponentId ::= ComponentOrDefaultReference | (AnyKeyword | AllKeyword)    
                     ComponentKeyword  
259.DoneKeyword ::= "done"  
260.KilledKeyword ::= "killed"  
261.RunningOp ::= ComponentId Dot RunningKeyword  
262.RunningKeyword ::= "running"  
263.AliveOp ::= ComponentId Dot AliveKeyword  
264.CreateKeyword ::= "create"  
265.AliveKeyword ::= "alive"  
266.ConnectStatement ::= ConnectKeyword SingleConnectionSpec  
267.ConnectKeyword ::= "connect"  
268.SingleConnectionSpec ::= "(" PortRef "," PortRef ")"  
269.PortRef ::= ComponentRef Colon ArrayIdentifierRef  
270.ComponentRef ::= ComponentOrDefaultReference |  
                      SystemKeyword |  
                      SelfOp |  
                      MTCKeyword  
271.ComponentRefAssignment ::= Identifier ":=" ComponentRef  
272.DisconnectStatement ::= DisconnectKeyword [SingleOrMultiConnectionSpec]  
273.SingleOrMultiConnectionSpec ::= SingleConnectionSpec |  
                                     AllConnectionsSpec |  
                                     AllPortsSpec |  
                                     AllCompsAllPortsSpec  
274.AllConnectionsSpec ::= "(" PortRef ")"  
275.AllPortsSpec ::= "(" ComponentRef ":" AllKeyword PortKeyword ")"  
276.AllCompsAllPortsSpec ::= "(" AllKeyword ComponentKeyword ":" AllKeyword    
                              PortKeyword ")"  
277.DisconnectKeyword ::= "disconnect"  
278.MapStatement ::= MapKeyword SingleConnectionSpec [ParamKeyword FunctionActualParList]  
279.MapKeyword ::= "map"  
280.UnmapStatement ::= UnmapKeyword [SingleOrMultiConnectionSpec] [ParamKeyword    
                                                                    FunctionActualParList]  
281.UnmapKeyword ::= "unmap"  
282.StartTCStatement ::= ComponentOrDefaultReference Dot StartKeyword    
                          "(" FunctionInstance ")"  
283.StartKeyword ::= "start"  
284.StopTCStatement ::= StopKeyword | (ComponentReferenceOrLiteral | AllKeyword    
                                        ComponentKeyword) Dot StopKeyword  
285.ComponentReferenceOrLiteral ::= ComponentOrDefaultReference |  
                                     MTCKeyword |  
                                     SelfOp  
286.KillTCStatement ::= KillKeyword | ((ComponentReferenceOrLiteral |  
                                         AllKeyword ComponentKeyword) Dot    
                                        KillKeyword)  
287.ComponentOrDefaultReference ::= VariableRef | FunctionInstance  
 
 
288.KillKeyword ::= "kill"  
// A.1.6.4.2 Port o perations 
289.CommunicationStatements ::= SendStatement |  
                                 CallStatement |  
                                 ReplyStatement |  
                                 RaiseStatement |  
                                 ReceiveStatement |  
                                 TriggerStatement |  
                                 GetCallStatement |  
                                 GetReplyStatement |  
                                 CatchStatement |  
                                 CheckStatement |  
                                 ClearStatement |  
                                 StartStatement |  
                                 StopStatement |  
                                 HaltStatement  
290.SendStatement ::= ArrayIdentifierRef Dot PortSendOp  
291.PortSendOp ::= SendOpKeyword "(" InLineTemplate ")" [ToClause]  
292.SendOpKeyword ::= "send"  
293.ToClause ::= ToKeyword (InLineTemplate |  
                             AddressRefList |  
                             AllKeyword ComponentKeyword  
                            )  
294.AddressRefList ::= "(" InLineTemplate {"," InLineTemplate} ")"  
295.ToKeyword ::= "to"  
296.CallStatement ::= ArrayIdentifierRef Dot PortCallOp [PortCallBody]  
297.PortCallOp ::= CallOpKeyword "(" CallParameters ")" [ToClause]  
298.CallOpKeyword ::= "call"  
299.CallParameters ::= InLineTemplate ["," CallTimerValue]  
300.CallTimerValue ::= Expression | NowaitKeyword  
301.NowaitKeyword ::= "nowait"  
302.PortCallBody ::= "{" CallBodyStatementList "}"  
303.CallBodyStatementList ::= {CallBodyStatement [SemiColon]}+  
304.CallBodyStatement ::= CallBodyGuard StatementBlock  
305.CallBodyGuard ::= AltGuardChar CallBodyOps  
306.CallBodyOps ::= GetReplyStatement | CatchStatement  
307.ReplyStatement ::= ArrayIdentifierRef Dot PortReplyOp  
308.PortReplyOp ::= ReplyKeyword "(" InLineTemplate [ReplyValue] ")" [ToClause]  
309.ReplyKeyword ::= "reply"  
310.ReplyValue ::= ValueKeyword Expression  
311.RaiseStatement ::= ArrayIdentifierRef Dot PortRaiseOp  
312.PortRaiseOp ::= RaiseKeyword "(" Signature "," InLineTemplate ")"    
                     [ToClause]  
313.RaiseKeyword ::= "raise"  
314.ReceiveStatement ::= PortOrAny Dot PortReceiveOp  
315.PortOrAny ::= ArrayIdentifierRef | AnyKeyword PortKeyword  
316.PortReceiveOp ::= ReceiveOpKeyword ["(" InLineTemplate ")"] [FromClause]    
                       [PortRedirect]  
317.ReceiveOpKeyword ::= "receive"  
318.FromClause ::= FromKeyword (InLineTemplate |  
                                 AddressRefList |  
                                 AnyKeyword ComponentKeyword  
                                )  
319.FromKeyword ::= "from"  
320.PortRedirect ::= PortRedirectSymbol (ValueSpec [SenderSpec] | SenderSpec)  
321.PortRedirectSymbol ::= "->"  
322.ValueSpec ::= ValueKeyword (VariableRef | ("(" SingleValueSpec {","    
                                                                     SingleValueSpec}    
                                                ")"))  
323.SingleValueSpec ::= VariableRef [AssignmentChar FieldReference ExtendedFieldReference]  
 
/*STATIC SEMANTICS  FieldReference shall not be ParRef and ExtendedFieldReference shall not be 
TypeDefIdentifier*/  
324.ValueKeyword ::= "value"  
325.SenderSpec ::= SenderKeyword VariableRef  
326.SenderKeyword ::= "sender"  
327.TriggerStatement ::= PortOrAny Dot PortTriggerOp  
328.PortTriggerOp ::= TriggerOpKeyword ["(" InLineTemplate ")"] [FromClause]    
                       [PortRedirect]  
329.TriggerOpKeyword ::= "trigger"  
330.GetCallStatement ::= PortOrAny Dot PortGetCallOp  
331.PortGetCallOp ::= GetCallOpKeyword ["(" InLineTemplate ")"] [FromClause]    
                       [PortRedirectWithParam]  
332.GetCallOpKeyword ::= "getcall"  
333.PortRedirectWithParam ::= PortRedirectSymbol RedirectWithParamSpec  
334.RedirectWithParamSpec ::= ParamSpec [SenderSpec] | SenderSpec  
 
 
335.ParamSpec ::= ParamKeyword ParamAssignmentList  
336.ParamKeyword ::= "param"  
337.ParamAssignmentList ::= "(" (AssignmentList | VariableList) ")"  
338.AssignmentList ::= VariableAssignment {"," VariableAssignment}  
339.VariableAssignment ::= VariableRef AssignmentChar Identifier  
340.VariableList ::= VariableEntry {"," VariableEntry}  
341.VariableEntry ::= VariableRef | Minus  
342.GetReplyStatement ::= PortOrAny Dot PortGetReplyOp  
343.PortGetReplyOp ::= GetReplyOpKeyword ["(" InLineTemplate [ValueMatchSpec]    
                                           ")"] [FromClause] [PortRedirectWithValueAndParam]  
344.PortRedirectWithValueAndParam ::= PortRedirectSymbol RedirectWithValueAndParamSpec  
345.RedirectWithValueAndParamSpec ::= ValueSpec [ParamSpec] [SenderSpec] |  
                                       RedirectWithParamSpec  
346.GetReplyOpKeyword ::= "getreply"  
347.ValueMatchSpec ::= ValueKeyword InLineTemplate  
348.CheckStatement ::= PortOrAny Dot PortCheckOp  
349.PortCheckOp ::= CheckOpKeyword ["(" CheckParameter ")"]  
350.CheckOpKeyword ::= "check"  
351.CheckParameter ::= CheckPortOpsPresent |  
                        FromClausePresent |  
                        RedirectPresent  
352.FromClausePresent ::= FromClause [PortRedirectSymbol SenderSpec]  
353.RedirectPresent ::= PortRedirectSymbol SenderSpec  
354.CheckPortOpsPresent ::= PortReceiveOp |  
                             PortGetCallOp |  
                             PortGetReplyOp |  
                             PortCatchOp  
355.CatchStatement ::= PortOrAny Dot PortCatchOp  
356.PortCatchOp ::= CatchOpKeyword ["(" CatchOpParameter ")"] [FromClause]    
                     [PortRedirect]  
357.CatchOpKeyword ::= "catch"  
358.CatchOpParameter ::= Signature "," InLineTemplate | TimeoutKeyword  
359.ClearStatement ::= PortOrAll Dot ClearOpKeyword  
360.PortOrAll ::= ArrayIdentifierRef | AllKeyword PortKeyword  
361.ClearOpKeyword ::= "clear"  
362.StartStatement ::= PortOrAll Dot StartKeyword  
363.StopStatement ::= PortOrAll Dot StopKeyword  
364.StopKeyword ::= "stop"  
365.HaltStatement ::= PortOrAll Dot HaltKeyword  
366.HaltKeyword ::= "halt"  
367.AnyKeyword ::= "any"  
// A.1.6.4.3 Timer o perations 
368.TimerStatements ::= StartTimerStatement |  
                         StopTimerStatement |  
                         TimeoutStatement  
369.TimerOps ::= ReadTimerOp | RunningTimerOp  
370.StartTimerStatement ::= ArrayIdentifierRef Dot StartKeyword ["(" Expression    
                                                                  ")"]  
371.StopTimerStatement ::= TimerRefOrAll Dot StopKeyword  
372.TimerRefOrAll ::= ArrayIdentifierRef | AllKeyword TimerKeyword  
373.ReadTimerOp ::= ArrayIdentifierRef Dot ReadKeyword  
374.ReadKeyword ::= "read"  
375.RunningTimerOp ::= TimerRefOrAny Dot RunningKeyword  
376.TimeoutStatement ::= TimerRefOrAny Dot TimeoutKeyword  
377.TimerRefOrAny ::= ArrayIdentifierRef | (AnyKeyword TimerKeyword)  
378.TimeoutKeyword ::= "timeout"  
// A.1.6.4.4 Testcase o peration 
379.TestcaseOperation ::= TestcaseKeyword "." StopKeyword ["(" {(FreeText |  
                                                                  InLineTemplate)    
                                                                 [","]}    
                                                            ")"]  
// A.1.6.5 Type 
380.Type ::= PredefinedType | ReferencedType  
381.PredefinedType ::= BitStringKeyword |  
                        BooleanKeyword |  
                        CharStringKeyword |  
                        UniversalCharString |  
                        IntegerKeyword |  
                        OctetStringKeyword |  
                        HexStringKeyword |  
                        VerdictTypeKeyword |  
                        FloatKeyword |  
 
 
                        AddressKeyword |  
                        DefaultKeyword |  
                        AnyTypeKeyword  
382.BitStringKeyword ::= "bitstring"  
383.BooleanKeyword ::= "boolean"  
384.IntegerKeyword ::= "integer"  
385.OctetStringKeyword ::= "octetstring"  
386.HexStringKeyword ::= "hexstring"  
387.VerdictTypeKeyword ::= "verdicttype"  
388.FloatKeyword ::= "float"  
389.AddressKeyword ::= "address"  
390.DefaultKeyword ::= "default"  
391.AnyTypeKeyword ::= "anytype"  
392.CharStringKeyword ::= "charstring"  
393.UniversalCharString ::= UniversalKeyword CharStringKeyword  
394.UniversalKeyword ::= "universal"  
395.ReferencedType ::= ExtendedIdentifier [ExtendedFieldReference]  
396.TypeReference ::= Identifier  
397.ArrayDef ::= {"[" SingleExpression [".." SingleExpression] "]"}+  
 
/* STATIC SEMANTICS - ArrayBounds will resolve to a non negative value of integer type */  
// A.1.6.6 Value 
398.Value ::= PredefinedValue | ReferencedValue  
399.PredefinedValue ::= Bstring |  
                         BooleanValue |  
                         CharStringValue |  
                         Number | /* IntegerValue */  
                         Ostring |  
                         Hstring |  
                         VerdictTypeValue |  
                         Identifier | /* EnumeratedValue */  
                         FloatValue |  
                         AddressValue |  
                         OmitKeyword  
400.BooleanValue ::= "true" | "false"  
401.VerdictTypeValue ::= "pass" |  
                          "fail" |  
                          "inconc" |  
                          "none" |  
                          "error"  
402.CharStringValue ::= Cstring | Quadruple  
403.Quadruple ::= CharKeyword "(" Number "," Number "," Number "," Number    
                   ")"  
404.CharKeyword ::= "char"  
405.FloatValue ::= FloatDotNotation |  
                    FloatENotation |  
                    NaNKeyword  
406.NaNKeyword ::= "not_a_number"  
407.FloatDotNotation ::= Number Dot DecimalNumber  
408.FloatENotation ::= Number [Dot DecimalNumber] Exponential [Minus]    
                        Number  
409.Exponential ::= "E"  
410.ReferencedValue ::= ExtendedIdentifier [ExtendedFieldReference]  
411.Number ::= (NonZeroNum {Num}) | "0"  
412.NonZeroNum ::= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"  
413.DecimalNumber ::= {Num}+  
414.Num ::= "0" | NonZeroNum  
415.Bstring ::= "'" {Bin} "'" "B"  
416.Bin ::= "0" | "1"  
417.Hstring ::= "'" {Hex} "'" "H"  
418.Hex ::= Num | "A" | "B" | "C" | "D" | "E" | "F" | "a" | "b" | "c" |  
             "d" | "e" | "f"  
419.Ostring ::= "'" {Oct} "'" "O"  
420.Oct ::= Hex Hex  
421.Cstring ::= """ {Char} """  
422.Char ::= /* REFERENCE - A character defined by the relevant CharacterString type. For charstring 
a character from the character set defined in ITU-T T.50. For universal charstring a character from 
any character set defined in ISO/IEC 10646 */  
423.Identifier ::= Alpha {AlphaNum | Underscore}  
424.Alpha ::= UpperAlpha | LowerAlpha  
425.AlphaNum ::= Alpha | Num  
426.UpperAlpha ::= "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" |  
                    "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" |  
                    "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z"  
427.LowerAlpha ::= "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" |  
                    "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" |  
 
 
                    "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"  
428.ExtendedAlphaNum ::= /* REFERENCE - A graphical character from the BASIC LATIN or from the 
LATIN-1 SUPPLEMENT character sets defined in ISO/IEC 10646 (characters from char (0,0,0,32) to char 
(0,0,0,126), from char (0,0,0,161) to char (0,0,0,172) and from char (0,0,0,174) to char (0,0,0,255) 
*/  
429.FreeText ::= """ {ExtendedAlphaNum} """  
430.AddressValue ::= "null"  
431.OmitKeyword ::= "omit"  
// A.1.6.7 Parameterization 
432.InParKeyword ::= "in"  
433.OutParKeyword ::= "out"  
434.InOutParKeyword ::= "inout"  
435.FormalValuePar ::= [(InParKeyword |  
                          InOutParKeyword |  
                          OutParKeyword  
                         )] Type Identifier [":=" (Expression | Minus)]  
436.FormalPortPar ::= [InOutParKeyword] Identifier Identifier  
 
/* The first Identifier refers to the port type. The second Identifier refers to the port parameter 
identifier */  
437.FormalTimerPar ::= [InOutParKeyword] TimerKeyword Identifier  
438.FormalTemplatePar ::= [(InParKeyword |  
                             OutParKeyword |  
                             InOutParKeyword  
                            )] (TemplateKeyword | RestrictedTemplate) Type    
                           Identifier [":=" (InLineTemplate | Minus)]  
439.RestrictedTemplate ::= OmitKeyword | (TemplateKeyword TemplateRestriction)  
440.TemplateRestriction ::= "(" (OmitKeyword |  
                                  ValueKeyword |  
                                  PresentKeyword  
                                 ) ")"  
// A.1.6.8 Statements 
// A.1.6.8.1 With st atement 
441.WithStatement ::= WithKeyword WithAttribList  
442.WithKeyword ::= "with"  
443.WithAttribList ::= "{" MultiWithAttrib "}"  
444.MultiWithAttrib ::= {SingleWithAttrib [SemiColon]}  
445.SingleWithAttrib ::= AttribKeyword [OverrideKeyword] [AttribQualifier]    
                          FreeText  
446.AttribKeyword ::= EncodeKeyword |  
                       VariantKeyword |  
                       DisplayKeyword |  
                       ExtensionKeyword |  
                       OptionalKeyword  
447.EncodeKeyword ::= "encode"  
448.VariantKeyword ::= "variant"  
449.DisplayKeyword ::= "display"  
450.ExtensionKeyword ::= "extension"  
451.OverrideKeyword ::= "override"  
452.AttribQualifier ::= "(" DefOrFieldRefList ")"  
453.DefOrFieldRefList ::= DefOrFieldRef {"," DefOrFieldRef}  
454.DefOrFieldRef ::= DefinitionRef |  
                       (FieldReference [ExtendedFieldReference]) |  
                       ("[" Minus | SingleExpression "]") |  
                       AllRef  
455.DefinitionRef ::= Identifier FullGroupIdentifier  
456.AllRef ::= (GroupKeyword AllKeyword [ExceptKeyword "{" FullGroupIdentifierList    
                                          "}"]) | ((TypeDefKeyword |  
                                                   TemplateKeyword |  
                                                   ConstKeyword |  
                                                   AltstepKeyword |  
                                                   TestcaseKeyword |  
                                                   FunctionKeyword |  
                                                   SignatureKeyword |  
                                                   ModuleParKeyword  
                                                  ) AllKeyword [ExceptKeyword    
                                                                "{" IdentifierList    
                                                                "}"])  
 
 
// A.1.6.8.2 Behaviour st atements 
457.BehaviourStatements ::= TestcaseInstance |  
                             FunctionInstance |  
                             ReturnStatement |  
                             AltConstruct |  
                             InterleavedConstruct |  
                             LabelStatement |  
                             GotoStatement |  
                             RepeatStatement |  
                             DeactivateStatement |  
                             AltstepInstance |  
                             ActivateOp |  
                             BreakStatement |  
                             ContinueStatement  
458.SetLocalVerdict ::= SetVerdictKeyword "(" SingleExpression {"," LogItem}    
                         ")"  
459.SetVerdictKeyword ::= "setverdict"  
460.GetLocalVerdict ::= "getverdict"  
461.SUTStatements ::= ActionKeyword "(" ActionText {StringOp ActionText}    
                       ")"  
462.ActionKeyword ::= "action"  
463.ActionText ::= FreeText | Expression  
464.ReturnStatement ::= ReturnKeyword [Expression | InLineTemplate]  
 
/* STATIC SEMANTICS - Expression shall evaluate to a value of a type compatible with the return type 
for functions returning a value. It shall evaluate to a value, template (literal or template 
instance), or a matching mechanism compatible with the return type for functions returning a 
template. */  
465.AltConstruct ::= AltKeyword "{" AltGuardList "}"  
466.AltKeyword ::= "alt"  
467.AltGuardList ::= {GuardStatement | ElseStatement [SemiColon]}  
468.GuardStatement ::= AltGuardChar (AltstepInstance [StatementBlock] |  
                                      GuardOp StatementBlock)  
469.ElseStatement ::= "[" ElseKeyword "]" StatementBlock  
470.AltGuardChar ::= "[" [BooleanExpression] "]"  
471.GuardOp ::= TimeoutStatement |  
                 ReceiveStatement |  
                 TriggerStatement |  
                 GetCallStatement |  
                 CatchStatement |  
                 CheckStatement |  
                 GetReplyStatement |  
                 DoneStatement |  
                 KilledStatement  
472.InterleavedConstruct ::= InterleavedKeyword "{" InterleavedGuardList    
                              "}"  
473.InterleavedKeyword ::= "interleave"  
474.InterleavedGuardList ::= {InterleavedGuardElement [SemiColon]}+  
475.InterleavedGuardElement ::= InterleavedGuard StatementBlock  
476.InterleavedGuard ::= "[" "]" GuardOp  
477.LabelStatement ::= LabelKeyword Identifier  
478.LabelKeyword ::= "label"  
479.GotoStatement ::= GotoKeyword Identifier  
480.GotoKeyword ::= "goto"  
481.RepeatStatement ::= "repeat"  
482.ActivateOp ::= ActivateKeyword "(" AltstepInstance ")"  
483.ActivateKeyword ::= "activate"  
484.DeactivateStatement ::= DeactivateKeyword ["(" ComponentOrDefaultReference    
                                                ")"]  
485.DeactivateKeyword ::= "deactivate"  
486.BreakStatement ::= "break"  
487.ContinueStatement ::= "continue"  
// A.1.6.8.3 Basic st atements 
488.BasicStatements ::= Assignment |  
                         LogStatement |  
                         LoopConstruct |  
                         ConditionalConstruct |  
                         SelectCaseConstruct |  
                         StatementBlock  
489.Expression ::= SingleExpression | CompoundExpression  
490.CompoundExpression ::= FieldExpressionList | ArrayExpression  
 
/* STATIC SEMANTICS - Within CompoundExpression the ArrayExpression can be used for Arrays, record, 
record of and set of types. */  
491.FieldExpressionList ::= "{" FieldExpressionSpec {"," FieldExpressionSpec}    
 
 
                             "}"  
492.FieldExpressionSpec ::= FieldReference AssignmentChar NotUsedOrExpression  
493.ArrayExpression ::= "{" [ArrayElementExpressionList] "}"  
494.ArrayElementExpressionList ::= NotUsedOrExpression {"," NotUsedOrExpression}  
495.NotUsedOrExpression ::= Expression | Minus  
496.ConstantExpression ::= SingleExpression | CompoundConstExpression  
497.BooleanExpression ::= SingleExpression  
 
/* STATIC SEMANTICS - BooleanExpression shall resolve to a Value of type Boolean */  
498.CompoundConstExpression ::= FieldConstExpressionList | ArrayConstExpression  
 
/* STATIC SEMANTICS - Within CompoundConstExpression the ArrayConstExpression can be used for 
arrays, record, record of and set of types. */  
499.FieldConstExpressionList ::= "{" FieldConstExpressionSpec {"," FieldConstExpressionSpec}    
                                  "}"  
500.FieldConstExpressionSpec ::= FieldReference AssignmentChar ConstantExpression  
501.ArrayConstExpression ::= "{" [ArrayElementConstExpressionList] "}"  
502.ArrayElementConstExpressionList ::= ConstantExpression {"," ConstantExpression}  
503.Assignment ::= VariableRef AssignmentChar (Expression | TemplateBody)  
 
/* STATIC SEMANTICS - The Expression on the right hand side of Assignment shall evaluate to an 
explicit value of a type compatible with the type of the left hand side for value variables and 
shall evaluate to an explicit value, template (literal or a template instance) or a matching 
mechanism compatible with the type of the left hand side for template variables. */  
504.SingleExpression ::= XorExpression {"or" XorExpression}  
 
/* STATIC SEMANTICS - If more than one XorExpression exists, then the XorExpressions shall evaluate 
to specific values of compatible types */  
505.XorExpression ::= AndExpression {"xor" AndExpression}  
 
/* STATIC SEMANTICS - If more than one AndExpression exists, then the AndExpressions shall evaluate 
to specific values of compatible types */  
506.AndExpression ::= NotExpression {"and" NotExpression}  
 
/* STATIC SEMANTICS - If more than one NotExpression exists, then the NotExpressions shall evaluate 
to specific values of compatible types */  
507.NotExpression ::= ["not"] EqualExpression  
 
/* STATIC SEMANTICS - Operands of the not operator shall be of type boolean or derivatives of type 
Boolean. */  
508.EqualExpression ::= RelExpression {EqualOp RelExpression}  
 
/* STATIC SEMANTICS - If more than one RelExpression exists, then the RelExpressions shall evaluate 
to specific values of compatible types */  
509.RelExpression ::= ShiftExpression [RelOp ShiftExpression]  
 
/* STATIC SEMANTICS - If both ShiftExpressions exist, then each ShiftExpression shall evaluate to a 
specific integer, Enumerated or float Value or derivatives of these types */  
510.ShiftExpression ::= BitOrExpression {ShiftOp BitOrExpression}  
 
/* STATIC SEMANTICS - Each Result shall resolve to a specific Value. If more than one Result exists 
the right-hand operand shall be of type integer or derivatives and if the shift op is "<<" or ">>" 
then the left-hand operand shall resolve to either bitstring, hexstring or octetstring type or 
derivatives of these types. If the shift op is "  
511.BitOrExpression ::= BitXorExpression {"or4b" BitXorExpression}  
 
/* STATIC SEMANTICS - If more than one BitXorExpression exists, then the BitXorExpressions shall 
evaluate to specific values of compatible types */  
512.BitXorExpression ::= BitAndExpression {"xor4b" BitAndExpression}  
 
/* STATIC SEMANTICS - If more than one BitAndExpression exists, then the BitAndExpressions shall 
evaluate to specific values of compatible types */  
513.BitAndExpression ::= BitNotExpression {"and4b" BitNotExpression}  
 
/* STATIC SEMANTICS - If more than one BitNotExpression exists, then the BitNotExpressions shall 
evaluate to specific values of compatible types */  
514.BitNotExpression ::= ["not4b"] AddExpression  
 
/* STATIC SEMANTICS - If the not4b operator exists, the operand shall be of type bitstring, 
octetstring or hexstring or derivatives of these types. */  
515.AddExpression ::= MulExpression {AddOp MulExpression}  
 
/* STATIC SEMANTICS - Each MulExpression shall resolve to a specific Value. If more than one 
MulExpression exists and the AddOp resolves to StringOp then the MulExpressions shall be valid 
operands for StringOp. If more than one MulExpression exists and the AddOp does not resolve to 
StringOp then the MulExpression shall both resolve to type integer or float or derivatives of these 
types.*/  
 
 
516.MulExpression ::= UnaryExpression {MultiplyOp UnaryExpression}  
 
/* STATIC SEMANTICS - Each UnaryExpression shall resolve to a specific Value. If more than one 
UnaryExpression exists then the UnaryExpressions shall resolve to type integer or float or 
derivatives of these types. */  
517.UnaryExpression ::= [UnaryOp] Primary  
 
/* STATIC SEMANTICS - Primary shall resolve to a specific Value of type integer or float or 
derivatives of these types.*/  
518.Primary ::= OpCall |  
                 Value |  
                 "(" SingleExpression ")"  
519.ExtendedFieldReference ::= {(Dot Identifier) |  
                                 ArrayOrBitRef |  
                                 ("[" Minus "]")  
                                }+  
 
/* STATIC SEMANTIC - The Identifier refers to a type definition if the type of the VarInstance or 
ReferencedValue in which the ExtendedFieldReference is used is anytype. ArrayOrBitRef shall be used 
when referencing elements of values or arrays. The square brackets with dash shall be used when 
referencing inner types of a record of or set of type. */  
520.OpCall ::= ConfigurationOps |  
                GetLocalVerdict |  
                TimerOps |  
                TestcaseInstance |  
                (FunctionInstance [ExtendedFieldReference]) |  
                (TemplateOps [ExtendedFieldReference]) |  
                ActivateOp  
521.AddOp ::= "+" |  
               "-" |  
               StringOp  
 
/* STATIC SEMANTICS - Operands of the "+" or "-" operators shall be of type integer or float or 
derivations of integer or float (i.e. subrange) */  
522.MultiplyOp ::= "*" | "/" | "mod" | "rem"  
 
/* STATIC SEMANTICS - Operands of the "*", "/", rem or mod operators shall be of type integer or 
float or derivations of integer or float (i.e. subrange) */  
523.UnaryOp ::= "+" | "-"  
 
/* STATIC SEMANTICS - Operands of the "+" or "-" operators shall be of type integer or float or 
derivations of integer or float (i.e. subrange) */  
524.RelOp ::= "<" | ">" | ">=" | "<="  
 
/* STATIC SEMANTICS - the precedence of the operators is defined in Table 6 */  
525.EqualOp ::= "==" | "!="  
526.StringOp ::= "&"  
 
/* STATIC SEMANTICS - Operands of the list operator shall be bitstring, hexstring, octetstring, 
(universal) character string, record of, set of, or array types, or derivates of these types */  
527.ShiftOp ::= "<<" | ">>" | "<@" | "@>"  
528.LogStatement ::= LogKeyword "(" LogItem {"," LogItem} ")"  
529.LogKeyword ::= "log"  
530.LogItem ::= FreeText | InLineTemplate  
531.LoopConstruct ::= ForStatement |  
                       WhileStatement |  
                       DoWhileStatement  
532.ForStatement ::= ForKeyword "(" Initial SemiColon BooleanExpression    
                      SemiColon Assignment ")" StatementBlock  
533.ForKeyword ::= "for"  
534.Initial ::= VarInstance | Assignment  
535.WhileStatement ::= WhileKeyword "(" BooleanExpression ")" StatementBlock  
536.WhileKeyword ::= "while"  
537.DoWhileStatement ::= DoKeyword StatementBlock WhileKeyword "(" BooleanExpression    
                          ")"  
538.DoKeyword ::= "do"  
539.ConditionalConstruct ::= IfKeyword "(" BooleanExpression ")" StatementBlock    
                              {ElseIfClause} [ElseClause]  
540.IfKeyword ::= "if"  
541.ElseIfClause ::= ElseKeyword IfKeyword "(" BooleanExpression ")" StatementBlock  
542.ElseKeyword ::= "else"  
543.ElseClause ::= ElseKeyword StatementBlock  
544.SelectCaseConstruct ::= SelectKeyword "(" SingleExpression ")" SelectCaseBody  
545.SelectKeyword ::= "select"  
546.SelectCaseBody ::= "{" {SelectCase}+ "}"  
547.SelectCase ::= CaseKeyword ("(" InLineTemplate {"," InLineTemplate}    
                                 ")" | ElseKeyword) StatementBlock  
548.CaseKeyword ::= "case"  
 
 
549.ExtendedIdentifier ::= [Identifier Dot] Identifier  
550.IdentifierList ::= Identifier {"," Identifier}  
551.FullGroupIdentifierList ::= FullGroupIdentifier {"," FullGroupIdentifier}  
// A.1.6.9 Miscellaneous productions 
552.Dot ::= "."  
553.Minus ::= "-"  
554.SemiColon ::= ";"  
555.Colon ::= ":"  
556.Underscore ::= "_"  
557.AssignmentChar ::= ":="  
