TTCN-3 Grammar

Abstract

This is the DocBook/XML version of the TTCN-3 BNF taken from ETSI standard ETSI ES 201 873-1 V2.2.1 (2003-02) Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 1: TTCN-3 Core Language


0 TTCN module
[1]TTCN3Module::=TTCN3ModuleKeyword TTCN3ModuleId BeginChar [ModuleDefinitionsPart] [ModuleControlPart] EndChar [WithStatement] 
[2]TTCN3ModuleKeyword::="module" 
[3]TTCN3ModuleId::=ModuleIdentifier [DefinitiveIdentifier] 
[4]ModuleIdentifier::=Identifier 
[5]DefinitiveIdentifier::=Dot ObjectIdentifierKeyword "{" DefinitiveObjIdComponentList "}" 
[6]DefinitiveObjIdComponentList::={DefinitiveObjIdComponent}+ 
[7]DefinitiveObjIdComponent::=NameForm |
DefinitiveNumberForm |
DefinitiveNameAndNumberForm
 
[8]DefinitiveNumberForm::=Number 
[9]DefinitiveNameAndNumberForm::=Identifier "(" DefinitiveNumberForm ")" 
1 Module definitions part - 1.0 General
[10]ModuleDefinitionsPart::=ModuleDefinitionsList 
[11]ModuleDefinitionsList::={ModuleDefinition [SemiColon]}+ 
[12]ModuleDefinition::=(TypeDef |
ConstDef |
TemplateDef |
ModuleParDef |
FunctionDef |
SignatureDef |
TestcaseDef |
AltstepDef |
ImportDef |
GroupDef |
ExtFunctionDef |
ExtConstDef) [WithStatement]
 
1.1 Typedef definitions
[13]TypeDef::=TypeDefKeyword TypeDefBody 
[14]TypeDefBody::=StructuredTypeDef |
SubTypeDef
 
[15]TypeDefKeyword::="type" 
[16]StructuredTypeDef::=RecordDef |
UnionDef |
SetDef |
RecordOfDef |
SetOfDef |
EnumDef |
PortDef |
ComponentDef
 
[17]RecordDef::=RecordKeyword StructDefBody 
[18]RecordKeyword::="record" 
[19]StructDefBody::=(StructTypeIdentifier [StructDefFormalParList] |
AddressKeyword) BeginChar [StructFieldDef {"," StructFieldDef}] EndChar
 
[20]StructTypeIdentifier::=Identifier 
[21]StructDefFormalParList::="(" StructDefFormalPar {"," StructDefFormalPar} ")" 
[22]StructDefFormalPar::=FormalValuePar /* Static semantics: FormalValuePar shall resolve to an in parameter */
[23]StructFieldDef::=Type StructFieldIdentifier [ArrayDef] [SubTypeSpec] [OptionalKeyword] 
[24]StructFieldIdentifier::=Identifier 
[25]OptionalKeyword::="optional" 
[26]UnionDef::=UnionKeyword UnionDefBody 
[27]UnionKeyword::="union" 
[28]UnionDefBody::=(StructTypeIdentifier [StructDefFormalParList] |
AddressKeyword) BeginChar UnionFieldDef {"," UnionFieldDef} EndChar
 
[29]UnionFieldDef::=Type StructFieldIdentifier [ArrayDef] [SubTypeSpec] 
[30]SetDef::=SetKeyword StructDefBody 
[31]SetKeyword::="set" 
[32]RecordOfDef::=RecordKeyword [StringLength] OfKeyword StructOfDefBody 
[33]OfKeyword::="of" 
[34]StructOfDefBody::=Type (StructTypeIdentifier |
AddressKeyword) [SubTypeSpec]
 
[35]SetOfDef::=SetKeyword [StringLength] OfKeyword StructOfDefBody 
[36]EnumDef::=EnumKeyword (EnumTypeIdentifier |
AddressKeyword) BeginChar EnumerationList EndChar
 
[37]EnumKeyword::="enumerated" 
[38]EnumTypeIdentifier::=Identifier 
[39]EnumerationList::=Enumeration {"," Enumeration} 
[40]Enumeration::=EnumerationIdentifier ["(" Number ")"] 
[41]EnumerationIdentifier::=Identifier 
[42]SubTypeDef::=Type (SubTypeIdentifier |
AddressKeyword) [ArrayDef] [SubTypeSpec]
 
[43]SubTypeIdentifier::=Identifier 
[44]SubTypeSpec::=AllowedValues |
StringLength
/* Static semantics: AllowedValues shall be of the same type as the field being subtyped */
[45]AllowedValues::="(" ValueOrRange {"," ValueOrRange} ")" 
[46]ValueOrRange::=RangeDef |
SingleConstExpression
/* Static semantics: RangeDef production shall only be used with integer, char, universal char, 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 */
[47]RangeDef::=LowerBound ".." UpperBound 
[48]StringLength::=LengthKeyword "(" SingleConstExpression [".." UpperBound] ")" /* Static semantics: StringLength shall only be used with String types or to limit set of and record of. SingleConstExpression and UpperBound shall evaluate to non-negative integer values (in case of UpperBound including infinity) */
[49]LengthKeyword::="length" 
[50]PortType::=[GlobalModuleId Dot] PortTypeIdentifier 
[51]PortDef::=PortKeyword PortDefBody 
[52]PortDefBody::=PortTypeIdentifier PortDefAttribs 
[53]PortKeyword::="port" 
[54]PortTypeIdentifier::=Identifier 
[55]PortDefAttribs::=MessageAttribs |
ProcedureAttribs |
MixedAttribs
 
[56]MessageAttribs::=MessageKeyword BeginChar {MessageList [SemiColon]}+ EndChar 
[57]MessageList::=Direction AllOrTypeList 
[58]Direction::=InParKeyword |
OutParKeyword |
InOutParKeyword
 
[59]MessageKeyword::="message" 
[60]AllOrTypeList::=AllKeyword |
TypeList
 
[61]AllKeyword::="all" 
[62]TypeList::=Type {"," Type} 
[63]ProcedureAttribs::=ProcedureKeyword BeginChar {ProcedureList [SemiColon]}+ EndChar 
[64]ProcedureKeyword::="procedure" 
[65]ProcedureList::=Direction AllOrSignatureList 
[66]AllOrSignatureList::=AllKeyword |
SignatureList
 
[67]SignatureList::=Signature {"," Signature} 
[68]MixedAttribs::=MixedKeyword BeginChar {MixedList [SemiColon]}+ EndChar 
[69]MixedKeyword::="mixed" 
[70]MixedList::=Direction ProcOrTypeList 
[71]ProcOrTypeList::=AllKeyword |
(ProcOrType {"," ProcOrType})
 
[72]ProcOrType::=Signature |
Type
 
[73]ComponentDef::=ComponentKeyword ComponentTypeIdentifier BeginChar [ComponentDefList] EndChar 
[74]ComponentKeyword::="component" 
[75]ComponentType::=[GlobalModuleId Dot] ComponentTypeIdentifier 
[76]ComponentTypeIdentifier::=Identifier 
[77]ComponentDefList::={ComponentElementDef [SemiColon]} 
[78]ComponentElementDef::=PortInstance |
VarInstance |
TimerInstance |
ConstDef
 
[79]PortInstance::=PortKeyword PortType PortElement {"," PortElement} 
[80]PortElement::=PortIdentifier [ArrayDef] 
[81]PortIdentifier::=Identifier 
1.2 Constant definitions
[82]ConstDef::=ConstKeyword Type ConstList 
[83]ConstList::=SingleConstDef {"," SingleConstDef} 
[84]SingleConstDef::=ConstIdentifier [ArrayDef] AssignmentChar ConstantExpression /* Static semantics: The Value of the ConstantExpression shall be of the same type as the stated type for the constants */
[85]ConstKeyword::="const" 
[86]ConstIdentifier::=Identifier 
1.3 Template definitions
[87]TemplateDef::=TemplateKeyword BaseTemplate [DerivedDef] AssignmentChar TemplateBody 
[88]BaseTemplate::=(Type |
Signature) TemplateIdentifier ["(" TemplateFormalParList ")"]
 
[89]TemplateKeyword::="template" 
[90]TemplateIdentifier::=Identifier 
[91]DerivedDef::=ModifiesKeyword TemplateRef 
[92]ModifiesKeyword::="modifies" 
[93]TemplateFormalParList::=TemplateFormalPar {"," TemplateFormalPar} 
[94]TemplateFormalPar::=FormalValuePar |
FormalTemplatePar
/* Static semantics: FormalValuePar shall resolve to an in parameter */
[95]TemplateBody::=SimpleSpec |
FieldSpecList |
ArrayValueOrAttrib
/* Static semantics: Within TemplateBody the ArrayValueOrAttrib can be used for array, record, record of and set of types. */
[96]SimpleSpec::=SingleValueOrAttrib 
[97]FieldSpecList::="{"[FieldSpec {"," FieldSpec}] "}" 
[98]FieldSpec::=FieldReference AssignmentChar TemplateBody 
[99]FieldReference::=StructFieldRef |
ArrayOrBitRef |
ParRef
 
[100]StructFieldRef::=StructFieldIdentifier 
[101]ParRef::=SignatureParIdentifier /* Operational semantics: SignatureParIdentifier shall be a formal parameter Identifier from the associated signature definition */
[102]SignatureParIdentifier::=ValueParIdentifier 
[103]ArrayOrBitRef::="[" FieldOrBitNumber "]" /* Static semantics: ArrayRef (ArrayOrBitRef?) shall be optionally used for array types and ASN.1 SET OF and SEQUENCE OF and TTCN record of and set of. The same notation can be used for a Bit reference inside an ASN.1 or TTCN bitstring type */
[104]FieldOrBitNumber::=SingleExpression /* Static semantics: SingleExpression will resolve to a value of integer type */
[105]SingleValueOrAttrib::=MatchingSymbol [ExtraMatchingAttributes] |
SingleExpression [ExtraMatchingAttributes] |
TemplateRefWithParList
/* Static semantics: VariableIdentifier (accessed via SingleExpression) may only be used in inline template definitions to reference variables in the current scope */
[106]ArrayValueOrAttrib::="{" ArrayElementSpecList "}" 
[107]ArrayElementSpecList::=ArrayElementSpec {"," ArrayElementSpec} 
[108]ArrayElementSpec::=NotUsedSymbol |
TemplateBody
 
[109]NotUsedSymbol::=Dash 
[110]MatchingSymbol::=Complement |
AnyValue |
AnyOrOmit |
ValueOrAttribList |
Range |
BitStringMatch |
HexStringMatch |
OctetStringMatch |
CharStringMatch |
SubsetMatch |
SupersetMatch
 
[111]ExtraMatchingAttributes::=LengthMatch |
IfPresentMatch |
LengthMatch IfPresentMatch
 
[112]BitStringMatch::="'" {BinOrMatch} "'" "B" 
[113]BinOrMatch::=Bin |
AnyValue |
AnyOrOmit
 
[114]HexStringMatch::="'" {HexOrMatch} "'" "H" 
[115]HexOrMatch::=Hex |
AnyValue |
AnyOrOmit
 
[116]OctetStringMatch::="'" {OctOrMatch} "'" "O" 
[117]OctOrMatch::=Oct |
AnyValue |
AnyOrOmit
 
[118]CharStringMatch::=PatternKeyword Cstring 
[119]PatternKeyword::="pattern" 
[120]Complement::=ComplementKeyword ValueList 
[121]ComplementKeyword::="complement" 
[122]ValueList::="(" ConstantExpression {"," ConstantExpression} ")" 
[123]SubsetMatch::=SubsetKeyword ValueList /* Static semantics: Subset matching shall only be used with the set of type */
[124]SubsetKeyword::="subset" 
[125]SupersetMatch::=SupersetKeyword ValueList /* Static semantics: Superset matching shall only be used with the set of type */
[126]SupersetKeyword::="superset" 
[127]AnyValue::="?" 
[128]AnyOrOmit::="*" 
[129]ValueOrAttribList::="(" TemplateBody {"," TemplateBody}+ ")" 
[130]LengthMatch::=StringLength 
[131]IfPresentMatch::=IfPresentKeyword 
[132]IfPresentKeyword::="ifpresent" 
[133]Range::="(" LowerBound ".." UpperBound ")" 
[134]LowerBound::=SingleConstExpression |
Minus InfinityKeyword
 
[135]UpperBound::=SingleConstExpression |
InfinityKeyword
/* Static semantics: LowerBound and UpperBound shall evaluate to types integer, char, universal char or float. In case LowerBound or UpperBound evaluates to types char or universal char, only SingleConstExpression may be present */
[136]InfinityKeyword::="infinity" 
[137]TemplateInstance::=InLineTemplate 
[138]TemplateRefWithParList::=[GlobalModuleId Dot] TemplateIdentifier [TemplateActualParList] |
TemplateParIdentifier
 
[139]TemplateRef::=[GlobalModuleId Dot] TemplateIdentifier |
TemplateParIdentifier
 
[140]InLineTemplate::=[(Type |
Signature) Colon] [DerivedDef AssignmentChar] TemplateBody
/* Static semantics: The type field may only be omitted when the type is implicitly unambigous */
[141]TemplateActualParList::="(" TemplateActualPar {"," TemplateActualPar} ")" 
[142]TemplateActualPar::=TemplateInstance /* Static semantics: When the corresponding formal parameter is not of template type the TemplateInstance production shall resolve to one or more SingleExpressions */
[143]TemplateOps::=MatchOp |
ValueofOp
 
[144]MatchOp::=MatchKeyword "(" Expression "," TemplateInstance")" /* Static semantics: The type of the value returned by the expression must be the same as the template type and each field of the template shall resolve to a single value */
[145]MatchKeyword::="match" 
[146]ValueofOp::=ValueofKeyword "(" TemplateInstance")" 
[147]ValueofKeyword::="valueof" 
1.4 Function definitions
[148]FunctionDef::=FunctionKeyword FunctionIdentifier "("[FunctionFormalParList] ")" [RunsOnSpec] [ReturnType] StatementBlock 
[149]FunctionKeyword::="function" 
[150]FunctionIdentifier::=Identifier 
[151]FunctionFormalParList::=FunctionFormalPar {"," FunctionFormalPar} 
[152]FunctionFormalPar::=FormalValuePar |
FormalTimerPar |
FormalTemplatePar |
FormalPortPar
 
[153]ReturnType::=ReturnKeyword Type 
[154]ReturnKeyword::="return" 
[155]RunsOnSpec::=RunsKeyword OnKeyword ComponentType 
[156]RunsKeyword::="runs" 
[157]OnKeyword::="on" 
[158]MTCKeyword::="mtc" 
[159]StatementBlock::=BeginChar [FunctionStatementOrDefList] EndChar 
[160]FunctionStatementOrDefList::={FunctionStatementOrDef [SemiColon]}+ 
[161]FunctionStatementOrDef::=FunctionLocalDef |
FunctionLocalInst |
FunctionStatement
 
[162]FunctionLocalInst::=VarInstance |
TimerInstance
 
[163]FunctionLocalDef::=ConstDef 
[164]FunctionStatement::=ConfigurationStatements |
TimerStatements |
CommunicationStatements |
BasicStatements |
BehaviourStatements |
VerdictStatements |
SUTStatements
 
[165]FunctionInstance::=FunctionRef "(" [FunctionActualParList] ")" 
[166]FunctionRef::=[GlobalModuleId Dot] (FunctionIdentifier |
ExtFunctionIdentifier ) |
PreDefFunctionIdentifier
 
[167]PreDefFunctionIdentifier::=Identifier /* Static semantics: The Identifier will be one of the predefined TTCN-3 Function Identifiers. */
[168]FunctionActualParList::=FunctionActualPar {"," FunctionActualPar} 
[169]FunctionActualPar::=TimerRef |
TemplateInstance |
Port |
ComponentRef
/* 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 */
1.5 Signature definitions
[170]SignatureDef::=SignatureKeyword SignatureIdentifier "("[SignatureFormalParList] ")" [ReturnType |
NoBlockKeyword] [ExceptionSpec]
 
[171]SignatureKeyword::="signature" 
[172]SignatureIdentifier::=Identifier 
[173]SignatureFormalParList::=SignatureFormalPar {"," SignatureFormalPar} 
[174]SignatureFormalPar::=FormalValuePar 
[175]ExceptionSpec::=ExceptionKeyword "(" ExceptionTypeList ")" 
[176]ExceptionKeyword::="exception" 
[177]ExceptionTypeList::=Type {"," Type} 
[178]NoBlockKeyword::="noblock" 
[179]Signature::=[GlobalModuleId Dot] SignatureIdentifier 
1.6 Testcase definitions
[180]TestcaseDef::=TestcaseKeyword TestcaseIdentifier "("[TestcaseFormalParList] ")" ConfigSpec StatementBlock 
[181]TestcaseKeyword::="testcase" 
[182]TestcaseIdentifier::=Identifier 
[183]TestcaseFormalParList::=TestcaseFormalPar {"," TestcaseFormalPar} 
[184]TestcaseFormalPar::=FormalValuePar |
FormalTemplatePar
 
[185]ConfigSpec::=RunsOnSpec [SystemSpec] 
[186]SystemSpec::=SystemKeyword ComponentType 
[187]SystemKeyword::="system" 
[188]TestcaseInstance::=ExecuteKeyword "(" TestcaseRef "(" [TestcaseActualParList] ")" ["," TimerValue] ")" 
[189]ExecuteKeyword::="execute" 
[190]TestcaseRef::=[GlobalModuleId Dot] TestcaseIdentifier 
[191]TestcaseActualParList::=TestcaseActualPar {"," TestcaseActualPar} 
[192]TestcaseActualPar::=TemplateInstance /* 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 */
1.7 Altstep definitions
[193]AltstepDef::=AltstepKeyword AltstepIdentifier "("[AltstepFormalParList] ")" [RunsOnSpec] BeginChar AltstepLocalDefList AltGuardList EndChar 
[194]AltstepKeyword::="altstep" 
[195]AltstepIdentifier::=Identifier 
[196]AltstepFormalParList::=FunctionFormalParList /* Static semantics: all formal parameter must be value parameters i.e., in parameters */
[197]AltstepLocalDefList::={AltstepLocalDef [SemiColon]} 
[198]AltstepLocalDef::=VarInstance |
TimerInstance |
ConstDef
 
[199]AltstepInstance::=AltstepRef "(" [FunctionActualParList] ")" 
[200]AltstepRef::=[GlobalModuleId Dot] AltstepIdentifier 
1.8 Import definitions
[201]ImportDef::=ImportKeyword ImportFromSpec (AllWithExcepts |
(BeginChar ImportSpec EndChar))
 
[202]ImportKeyword::="import" 
[203]AllWithExcepts::=AllKeyword [ExceptsDef] 
[204]ExceptsDef::=ExceptKeyword BeginChar ExceptSpec EndChar 
[205]ExceptKeyword::="except" 
[206]ExceptSpec::={ExceptElement [SemiColon]} /* Static semantics: Any of the production components (ExceptGroupSpec, ExceptTypeDefSpec etc.) may be present only once in the ExceptSpec production */
[207]ExceptElement::=ExceptGroupSpec |
ExceptTypeDefSpec |
ExceptTemplateSpec |
ExceptConstSpec |
ExceptTestcaseSpec |
ExceptAltstepSpec |
ExceptFunctionSpec |
ExceptSignatureSpec |
ExceptModuleParSpec
 
[208]ExceptGroupSpec::=GroupKeyword (ExceptGroupRefList |
AllKeyword)
 
[209]ExceptTypeDefSpec::=TypeDefKeyword (TypeRefList |
AllKeyword)
 
[210]ExceptTemplateSpec::=TemplateKeyword (TemplateRefList |
AllKeyword)
 
[211]ExceptConstSpec::=ConstKeyword (ConstRefList |
AllKeyword)
 
[212]ExceptTestcaseSpec::=TestcaseKeyword (TestcaseRefList |
AllKeyword)
 
[213]ExceptAltstepSpec::=AltstepKeyword (AltstepRefList |
AllKeyword)
 
[214]ExceptFunctionSpec::=FunctionKeyword (FunctionRefList |
AllKeyword)
 
[215]ExceptSignatureSpec::=SignatureKeyword (SignatureRefList |
AllKeyword)
 
[216]ExceptModuleParSpec::=ModuleParKeyword (ModuleParRefList |
AllKeyword)
 
[217]ImportSpec::={ImportElement [SemiColon]} 
[218]ImportElement::=ImportGroupSpec |
ImportTypeDefSpec |
ImportTemplateSpec |
ImportConstSpec |
ImportTestcaseSpec |
ImportAltstepSpec |
ImportFunctionSpec |
ImportSignatureSpec |
ImportModuleParSpec
 
[219]ImportFromSpec::=FromKeyword ModuleId [RecursiveKeyword] 
[220]ModuleId::=GlobalModuleId [LanguageSpec] /* Static semantics: LanguageSpec may only be omitted if the referenced module contains TTCN-3 notation */
[221]LanguageKeyword::="language" 
[222]LanguageSpec::=LanguageKeyword FreeText 
[223]GlobalModuleId::=ModuleIdentifier [Dot ObjectIdentifierValue] 
[224]RecursiveKeyword::="recursive" 
[225]ImportGroupSpec::=GroupKeyword (GroupRefList |
AllGroupsWithExcept)
 
[226]GroupRefList::=FullGroupIdentifier {"," FullGroupIdentifier} 
[227]AllGroupsWithExcept::=AllKeyword [ExceptKeyword GroupRefList] 
[228]FullGroupIdentifier::=GroupIdentifier {Dot GroupIdentifier} [ExceptsDef] 
[229]ExceptGroupRefList::=ExceptFullGroupIdentifier {"," ExceptFullGroupIdentifier} 
[230]ExceptFullGroupIdentifier::=GroupIdentifier {Dot GroupIdentifier} 
[231]ImportTypeDefSpec::=TypeDefKeyword (TypeRefList |
AllTypesWithExcept)
 
[232]TypeRefList::=TypeDefIdentifier {"," TypeDefIdentifier} 
[233]AllTypesWithExcept::=AllKeyword [ExceptKeyword TypeRefList] 
[234]TypeDefIdentifier::=StructTypeIdentifier |
EnumTypeIdentifier |
PortTypeIdentifier |
ComponentTypeIdentifier |
SubTypeIdentifier
 
[235]ImportTemplateSpec::=TemplateKeyword (TemplateRefList |
AllTemplsWithExcept)
 
[236]TemplateRefList::=TemplateIdentifier {"," TemplateIdentifier} 
[237]AllTemplsWithExcept::=AllKeyword [ExceptKeyword TemplateRefList] 
[238]ImportConstSpec::=ConstKeyword (ConstRefList |
AllConstsWithExcept)
 
[239]ConstRefList::=ConstIdentifier {"," ConstIdentifier} 
[240]AllConstsWithExcept::=AllKeyword [ExceptKeyword ConstRefList] 
[241]ImportAltstepSpec::=AltstepKeyword (AltstepRefList |
AllAltstepsWithExcept)
 
[242]AltstepRefList::=AltstepIdentifier {"," AltstepIdentifier} 
[243]AllAltstepsWithExcept::=AllKeyword [ExceptKeyword AltstepRefList] 
[244]ImportTestcaseSpec::=TestcaseKeyword (TestcaseRefList |
AllTestcasesWithExcept)
 
[245]TestcaseRefList::=TestcaseIdentifier {"," TestcaseIdentifier} 
[246]AllTestcasesWithExcept::=AllKeyword [ExceptKeyword TestcaseRefList] 
[247]ImportFunctionSpec::=FunctionKeyword (FunctionRefList |
AllFunctionsWithExcept)
 
[248]FunctionRefList::=FunctionIdentifier {"," FunctionIdentifier} 
[249]AllFunctionsWithExcept::=AllKeyword [ExceptKeyword FunctionRefList] 
[250]ImportSignatureSpec::=SignatureKeyword (SignatureRefList |
AllSignaturesWithExcept)
 
[251]SignatureRefList::=SignatureIdentifier {"," SignatureIdentifier} 
[252]AllSignaturesWithExcept::=AllKeyword [ExceptKeyword SignatureRefList] 
[253]ImportModuleParSpec::=ModuleParKeyword (ModuleParRefList |
AllModuleParWithExcept)
 
[254]ModuleParRefList::=ModuleParIdentifier {"," ModuleParIdentifier} 
[255]AllModuleParWithExcept::=AllKeyword [ExceptKeyword ModuleParRefList] 
1.9 Group definitions
[256]GroupDef::=GroupKeyword GroupIdentifier BeginChar [ModuleDefinitionsPart] EndChar 
[257]GroupKeyword::="group" 
[258]GroupIdentifier::=Identifier 
1.10 External function definitions
[259]ExtFunctionDef::=ExtKeyword FunctionKeyword ExtFunctionIdentifier "("[FunctionFormalParList] ")" [ReturnType] 
[260]ExtKeyword::="external" 
[261]ExtFunctionIdentifier::=Identifier 
1.11 External constant definitions
[262]ExtConstDef::=ExtKeyword ConstKeyword Type ExtConstIdentifier 
[263]ExtConstIdentifier::=Identifier 
1.12 Module parameter definitions
[264]ModuleParDef::=ModuleParKeyword "{" ModuleParList "}" 
[265]ModuleParKeyword::="modulepar" 
[266]ModuleParList::=ModulePar {SemiColon ModulePar} 
[267]ModulePar::=ModuleParType ModuleParIdentifier [AssignmentChar ConstantExpression] {"," ModuleParIdentifier [AssignmentChar ConstantExpression]} /* Static semantics: The Value of the ConstantExpression shall be of the same type as the stated type for the Parameter */
[268]ModuleParType::=Type 
[269]ModuleParIdentifier::=Identifier 
2 Control part - 2.0 General
[270]ModuleControlPart::=ControlKeyword BeginChar ModuleControlBody EndChar [WithStatement] [SemiColon] 
[271]ControlKeyword::="control" 
[272]ModuleControlBody::=[ControlStatementOrDefList] 
[273]ControlStatementOrDefList::={ControlStatementOrDef [SemiColon]}+ 
[274]ControlStatementOrDef::=FunctionLocalInst |
ControlStatement |
FunctionLocalDef
 
[275]ControlStatement::=TimerStatements |
BasicStatements |
BehaviourStatements |
SUTStatements
 
2.1 Variable instantiation
[276]VarInstance::=VarKeyword Type VarList 
[277]VarList::=SingleVarInstance {"," SingleVarInstance} 
[278]SingleVarInstance::=VarIdentifier [ArrayDef] [AssignmentChar VarInitialValue] 
[279]VarInitialValue::=Expression 
[280]VarKeyword::="var" 
[281]VarIdentifier::=Identifier 
[282]VariableRef::=(VarIdentifier |
ValueParIdentifier) [ExtendedFieldReference]
 
2.2 Timer instantiation
[283]TimerInstance::=TimerKeyword TimerList 
[284]TimerList::=SingleTimerInstance{"," SingleTimerInstance} 
[285]SingleTimerInstance::=TimerIdentifier [ArrayDef] [AssignmentChar TimerValue] 
[286]TimerKeyword::="timer" 
[287]TimerIdentifier::=Identifier 
[288]TimerValue::=Expression /* Static semantics: When Expression resolves to SingleExpression it must resolve to a value of type float. Expression shall only resolves to CompoundExpression in the initialiation in default timer value assignment for timer arrays */
[289]TimerRef::=TimerIdentifier [ArrayOrBitRef] |
TimerParIdentifier [ArrayOrBitRef]
 
2.3 Component operations
[290]ConfigurationStatements::=ConnectStatement |
MapStatement |
DisconnectStatement |
UnmapStatement |
DoneStatement |
StartTCStatement |
StopTCStatement
 
[291]ConfigurationOps::=CreateOp |
SelfOp |
SystemOp |
MTCOp |
RunningOp
 
[292]CreateOp::=ComponentType Dot CreateKeyword 
[293]SystemOp::=SystemKeyword 
[294]SelfOp::="self" 
[295]MTCOp::=MTCKeyword 
[296]DoneStatement::=ComponentId Dot DoneKeyword 
[297]ComponentId::=ComponentIdentifier |
(AnyKeyword |
AllKeyword) ComponentKeyword
 
[298]DoneKeyword::="done" 
[299]RunningOp::=ComponentId Dot RunningKeyword 
[300]RunningKeyword::="running" 
[301]CreateKeyword::="create" 
[302]ConnectStatement::=ConnectKeyword PortSpec 
[303]ConnectKeyword::="connect" 
[304]PortSpec::="(" PortRef "," PortRef ")" 
[305]PortRef::=ComponentRef Colon Port 
[306]ComponentRef::=ComponentIdentifier |
SystemOp |
SelfOp |
MTCOp
 
[307]DisconnectStatement::=DisconnectKeyword PortSpec 
[308]DisconnectKeyword::="disconnect" 
[309]MapStatement::=MapKeyword PortSpec 
[310]MapKeyword::="map" 
[311]UnmapStatement::=UnmapKeyword PortSpec 
[312]UnmapKeyword::="unmap" 
[313]StartTCStatement::=ComponentIdentifier Dot StartKeyword "(" FunctionInstance ")" /* Static semantics: the Function instance may only have in parameters */
/* Static semantics: the Function instance shall not have timer parameters */
[314]StartKeyword::="start" 
[315]StopTCStatement::=StopKeyword |
ComponentIdentifier Dot StopKeyword |
AllKeyword ComponentKeyword Dot StopKeyword
 
[316]ComponentIdentifier::=VariableRef |
FunctionInstance
/* Static semantics: the variable associated with VariableRef or the Return type associated with FunctionInstance must be of component type */
2.4 Port operations
[317]Port::=(PortIdentifier |
PortParIdentifier) [ArrayOrBitRef]
 
[318]CommunicationStatements::=SendStatement |
CallStatement |
ReplyStatement |
RaiseStatement |
ReceiveStatement |
TriggerStatement |
GetCallStatement |
GetReplyStatement |
CatchStatement |
CheckStatement |
ClearStatement |
StartStatement |
StopStatement
 
[319]SendStatement::=Port Dot PortSendOp 
[320]PortSendOp::=SendOpKeyword "(" SendParameter ")" [ToClause] 
[321]SendOpKeyword::="send" 
[322]SendParameter::=TemplateInstance 
[323]ToClause::=ToKeyword AddressRef 
[324]ToKeyword::="to" 
[325]AddressRef::=VariableRef |
FunctionInstance
/* Static semantics: VariableRef and FunctionInstance return must be of address or component type */
[326]CallStatement::=Port Dot PortCallOp [PortCallBody] 
[327]PortCallOp::=CallOpKeyword "(" CallParameters ")" [ToClause] 
[328]CallOpKeyword::="call" 
[329]CallParameters::=TemplateInstance ["," CallTimerValue] /* Static semantics: only out parameters may be omitted or specified with a matching attribute */
[330]CallTimerValue::=TimerValue |
NowaitKeyword
/* Static semantics: Value must be of type float */
[331]NowaitKeyword::="nowait" 
[332]PortCallBody::=BeginChar CallBodyStatementList EndChar 
[333]CallBodyStatementList::={CallBodyStatement [SemiColon]}+ 
[334]CallBodyStatement::=CallBodyGuard StatementBlock 
[335]CallBodyGuard::=AltGuardChar CallBodyOps 
[336]CallBodyOps::=GetReplyStatement |
CatchStatement
 
[337]ReplyStatement::=Port Dot PortReplyOp 
[338]PortReplyOp::=ReplyKeyword "(" TemplateInstance [ReplyValue]")" [ToClause] 
[339]ReplyKeyword::="reply" 
[340]ReplyValue::=ValueKeyword Expression 
[341]RaiseStatement::=Port Dot PortRaiseOp 
[342]PortRaiseOp::=RaiseKeyword "(" Signature "," TemplateInstance ")" [ToClause] 
[343]RaiseKeyword::="raise" 
[344]ReceiveStatement::=PortOrAny Dot PortReceiveOp 
[345]PortOrAny::=Port |
AnyKeyword PortKeyword
 
[346]PortReceiveOp::=ReceiveOpKeyword ["(" ReceiveParameter ")"] [FromClause] [PortRedirect] /* Static semantics: the PortRedirect option may only be present if the ReceiveParameter option is also present */
[347]ReceiveOpKeyword::="receive" 
[348]ReceiveParameter::=TemplateInstance 
[349]FromClause::=FromKeyword AddressRef 
[350]FromKeyword::="from" 
[351]PortRedirect::=PortRedirectSymbol (ValueSpec [SenderSpec] |
SenderSpec)
 
[352]PortRedirectSymbol::="->" 
[353]ValueSpec::=ValueKeyword VariableRef 
[354]ValueKeyword::="value" 
[355]SenderSpec::=SenderKeyword VariableRef /* Static semantics: VariableRef must be of address or component type */
[356]SenderKeyword::="sender" 
[357]TriggerStatement::=PortOrAny Dot PortTriggerOp 
[358]PortTriggerOp::=TriggerOpKeyword ["(" ReceiveParameter ")"] [FromClause] [PortRedirect] /* Static semantics: the PortRedirect option may only be present if the ReceiveParameter option is also present */
[359]TriggerOpKeyword::="trigger" 
[360]GetCallStatement::=PortOrAny Dot PortGetCallOp 
[361]PortGetCallOp::=GetCallOpKeyword ["(" ReceiveParameter ")"] [FromClause] [PortRedirectWithParam] /* Static semantics: the PortRedirectWithParam option may only be present if the ReceiveParameter option is also present */
[362]GetCallOpKeyword::="getcall" 
[363]PortRedirectWithParam::=PortRedirectSymbol RedirectSpec 
[364]RedirectSpec::=ValueSpec [ParaSpec] [SenderSpec] |
ParaSpec [SenderSpec] |
SenderSpec
 
[365]ParaSpec::=ParaKeyword ParaAssignmentList 
[366]ParaKeyword::="param" 
[367]ParaAssignmentList::="(" (AssignmentList |
VariableList) ")"
 
[368]AssignmentList::=VariableAssignment {"," VariableAssignment} 
[369]VariableAssignment::=VariableRef AssignmentChar ParameterIdentifier /* Static semantics: the ParameterIdentifiers must be from the corresponding signature definition */
[370]ParameterIdentifier::=ValueParIdentifier |
TimerParIdentifier |
TemplateParIdentifier |
PortParIdentifier
 
[371]VariableList::=VariableEntry {"," VariableEntry} 
[372]VariableEntry::=VariableRef |
NotUsedSymbol
 
[373]GetReplyStatement::=PortOrAny Dot PortGetReplyOp 
[374]PortGetReplyOp::=GetReplyOpKeyword ["(" ReceiveParameter [ValueMatchSpec] ")"] [FromClause] [PortRedirectWithParam] /* Static semantics: the PortRedirectWithParam option may only be present if the ReceiveParameter option is also present */
[375]GetReplyOpKeyword::="getreply" 
[376]ValueMatchSpec::=ValueKeyword TemplateInstance 
[377]CheckStatement::=PortOrAny Dot PortCheckOp 
[378]PortCheckOp::=CheckOpKeyword ["(" CheckParameter ")"] 
[379]CheckOpKeyword::="check" 
[380]CheckParameter::=CheckPortOpsPresent |
FromClausePresent |
RedirectPresent
 
[381]FromClausePresent::=FromClause [PortRedirectSymbol SenderSpec] 
[382]RedirectPresent::=PortRedirectSymbol SenderSpec 
[383]CheckPortOpsPresent::=PortReceiveOp |
PortGetCallOp |
PortGetReplyOp |
PortCatchOp
 
[384]CatchStatement::=PortOrAny Dot PortCatchOp 
[385]PortCatchOp::=CatchOpKeyword ["("CatchOpParameter ")"] [FromClause] [PortRedirect] /* Static semantics: the PortRedirect option may only be present if the CatchOpParameter option is also present */
[386]CatchOpKeyword::="catch" 
[387]CatchOpParameter::=Signature "," TemplateInstance |
TimeoutKeyword
 
[388]ClearStatement::=PortOrAll Dot PortClearOp 
[389]PortOrAll::=Port |
AllKeyword PortKeyword
 
[390]PortClearOp::=ClearOpKeyword 
[391]ClearOpKeyword::="clear" 
[392]StartStatement::=PortOrAll Dot PortStartOp 
[393]PortStartOp::=StartKeyword 
[394]StopStatement::=PortOrAll Dot PortStopOp 
[395]PortStopOp::=StopKeyword 
[396]StopKeyword::="stop" 
[397]AnyKeyword::="any" 
2.5 Timer operations
[398]TimerStatements::=StartTimerStatement |
StopTimerStatement |
TimeoutStatement
 
[399]TimerOps::=ReadTimerOp |
RunningTimerOp
 
[400]StartTimerStatement::=TimerRef Dot StartKeyword ["(" TimerValue ")"] 
[401]StopTimerStatement::=TimerRefOrAll Dot StopKeyword 
[402]TimerRefOrAll::=TimerRef |
AllKeyword TimerKeyword
 
[403]ReadTimerOp::=TimerRef Dot ReadKeyword 
[404]ReadKeyword::="read" 
[405]RunningTimerOp::=TimerRefOrAny Dot RunningKeyword 
[406]TimeoutStatement::=TimerRefOrAny Dot TimeoutKeyword 
[407]TimerRefOrAny::=TimerRef |
AnyKeyword TimerKeyword
 
[408]TimeoutKeyword::="timeout" 
3 Type
[409]Type::=PredefinedType |
ReferencedType
 
[410]PredefinedType::=BitStringKeyword |
BooleanKeyword |
CharStringKeyword |
UniversalCharString |
CharKeyword |
UniversalChar |
IntegerKeyword |
OctetStringKeyword |
ObjectIdentifierKeyword |
HexStringKeyword |
VerdictTypeKeyword |
FloatKeyword |
AddressKeyword |
DefaultKeyword |
AnyTypeKeyword
 
[411]BitStringKeyword::="bitstring" 
[412]BooleanKeyword::="boolean" 
[413]IntegerKeyword::="integer" 
[414]OctetStringKeyword::="octetstring" 
[415]ObjectIdentifierKeyword::="objid" 
[416]HexStringKeyword::="hexstring" 
[417]VerdictTypeKeyword::="verdicttype" 
[418]FloatKeyword::="float" 
[419]AddressKeyword::="address" 
[420]DefaultKeyword::="default" 
[421]AnyTypeKeyword::="anytype" 
[422]CharStringKeyword::="charstring" 
[423]UniversalCharString::=UniversalKeyword CharStringKeyword 
[424]UniversalKeyword::="universal" 
[425]CharKeyword::="char" 
[426]UniversalChar::=UniversalKeyword CharKeyword 
[427]ReferencedType::=[GlobalModuleId Dot] TypeReference [ExtendedFieldReference] 
[428]TypeReference::=StructTypeIdentifier[TypeActualParList] |
EnumTypeIdentifier |
SubTypeIdentifier |
ComponentTypeIdentifier
 
[429]TypeActualParList::="(" TypeActualPar {"," TypeActualPar} ")" 
[430]TypeActualPar::=ConstantExpression 
[431]ArrayDef::={"[" ArrayBounds [".." ArrayBounds] "]"}+ 
[432]ArrayBounds::=SingleConstExpression /* Static semantics: ArrayBounds will resolve to a non negative value of integer type */
4 Value
[433]Value::=PredefinedValue |
ReferencedValue
 
[434]PredefinedValue::=BitStringValue |
BooleanValue |
CharStringValue |
IntegerValue |
OctetStringValue |
ObjectIdentifierValue |
HexStringValue |
VerdictTypeValue |
EnumeratedValue |
FloatValue |
AddressValue |
OmitValue
 
[435]BitStringValue::=Bstring 
[436]BooleanValue::="true" |
"false"
 
[437]IntegerValue::=Number 
[438]OctetStringValue::=Ostring 
[439]ObjectIdentifierValue::=ObjectIdentifierKeyword "{" ObjIdComponentList "}" /* ReferencedValue must be of type object identifier */
[440]ObjIdComponentList::={ObjIdComponent}+ 
[441]ObjIdComponent::=NameForm |
NumberForm |
NameAndNumberForm
 
[442]NumberForm::=Number |
ReferencedValue
/* Static semantics: ReferencedValue must be of type integer and have a non negative Value */
[443]NameAndNumberForm::=Identifier "(" NumberForm ")" 
[444]NameForm::=Identifier 
[445]HexStringValue::=Hstring 
[446]VerdictTypeValue::="pass" |
"fail" |
"inconc" |
"none" |
"error"
 
[447]EnumeratedValue::=EnumerationIdentifier 
[448]CharStringValue::=Cstring |
Quadruple
 
[449]Quadruple::=CharKeyword "(" Group "," Plane "," Row "," Cell ")" 
[450]Group::=Number 
[451]Plane::=Number 
[452]Row::=Number 
[453]Cell::=Number 
[454]FloatValue::=FloatDotNotation |
FloatENotation
 
[455]FloatDotNotation::=Number Dot DecimalNumber 
[456]FloatENotation::=Number [Dot DecimalNumber] Exponential [Minus] Number 
[457]Exponential::="E" 
[458]ReferencedValue::=ValueReference [ExtendedFieldReference] 
[459]ValueReference::=[GlobalModuleId Dot] (ConstIdentifier |
ExtConstIdentifier) |
ValueParIdentifier |
ModuleParIdentifier |
VarIdentifier
 
[460]Number::=(NonZeroNum {Num}) |
"0"
 
[461]NonZeroNum::="1" |
"2" |
"3" |
"4" |
"5" |
"6" |
"7" |
"8" |
"9"
 
[462]DecimalNumber::={Num}+ 
[463]Num::="0" |
NonZeroNum
 
[464]Bstring::="'" {Bin} "'" "B" 
[465]Bin::="0" |
"1"
 
[466]Hstring::="'" {Hex} "'" "H" 
[467]Hex::=Num |
"A" |
"B" |
"C" |
"D" |
"E" |
"F"|
"a" |
"b" |
"c" |
"d" |
"e" |
"f"
 
[468]Ostring::="'" {Oct} "'" "O" 
[469]Oct::=Hex Hex 
[470]Cstring::=""" {Char} """ 
[471]Char::=/* Reference: A character defined by the relevant CharacterString type. For charstring a character from the character set defined in ISO/IEC 646. For universal charstring a character from any character set defined in ISO/IEC 10646 */
[472]Identifier::=Alpha{AlphaNum |
Underscore}
 
[473]Alpha::=UpperAlpha |
LowerAlpha
 
[474]AlphaNum::=Alpha |
Num
 
[475]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"
 
[476]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"
 
[477]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,33) 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) */
[478]FreeText::=""" {ExtendedAlphaNum} """ 
[479]AddressValue::="null" 
[480]OmitValue::=OmitKeyword 
[481]OmitKeyword::="omit" 
5 Parameterization
[482]InParKeyword::="in" 
[483]OutParKeyword::="out" 
[484]InOutParKeyword::="inout" 
[485]FormalValuePar::=[(InParKeyword |
InOutParKeyword |
OutParKeyword)] Type ValueParIdentifier
 
[486]ValueParIdentifier::=Identifier 
[487]FormalPortPar::=[InOutParKeyword] PortTypeIdentifier PortParIdentifier 
[488]PortParIdentifier::=Identifier 
[489]FormalTimerPar::=[InOutParKeyword] TimerKeyword TimerParIdentifier 
[490]TimerParIdentifier::=Identifier 
[491]FormalTemplatePar::=[InParKeyword] TemplateKeyword Type TemplateParIdentifier 
[492]TemplateParIdentifier::=Identifier 
6 With statement
[493]WithStatement::=WithKeyword WithAttribList 
[494]WithKeyword::="with" 
[495]WithAttribList::="{" MultiWithAttrib "}" 
[496]MultiWithAttrib::={SingleWithAttrib [SemiColon]}+ 
[497]SingleWithAttrib::=AttribKeyword [OverrideKeyword] [AttribQualifier] AttribSpec 
[498]AttribKeyword::=EncodeKeyword |
VariationKeyword |
DisplayKeyword |
ExtensionKeyword
 
[499]EncodeKeyword::="encode" 
[500]VariationKeyword::="variant" 
[501]DisplayKeyword::="display" 
[502]ExtensionKeyword::="extension" 
[503]OverrideKeyword::="override" 
[504]AttribQualifier::="(" DefOrFieldRefList ")" 
[505]DefOrFieldRefList::=DefOrFieldRef {"," DefOrFieldRef} 
[506]DefOrFieldRef::=DefinitionRef |
FieldReference |
AllRef |
PredefinedType
/* Static semantics: the DefOrFieldRef must refer to a definition or field which is within the module, group or definition to which the with statement is associated */
[507]DefinitionRef::=StructTypeIdentifier |
EnumTypeIdentifier |
PortTypeIdentifier |
ComponentTypeIdentifier |
SubTypeIdentifier |
ConstIdentifier |
TemplateIdentifier |
AltstepIdentifier |
TestcaseIdentifier |
FunctionIdentifier |
SignatureIdentifier |
VarIdentifier |
TimerIdentifier |
PortIdentifier |
ModuleParIdentifier |
FullGroupIdentifier
 
[508]AllRef::=( GroupKeyword AllKeyword [ExceptKeyword BeginChar GroupRefList EndChar]) |
( TypeDefKeyword AllKeyword [ExceptKeyword BeginChar TypeRefList] EndChar) |
( TemplateKeyword AllKeyword [ExceptKeyword BeginChar TemplateRefList] EndChar) |
( ConstKeyword AllKeyword [ExceptKeyword BeginChar ConstRefList] EndChar) |
( AltstepKeyword AllKeyword [ExceptKeyword BeginChar AltstepRefList] EndChar) |
( TestcaseKeyword AllKeyword [ExceptKeyword BeginChar TestcaseRefList] EndChar) |
( FunctionKeyword AllKeyword [ExceptKeyword BeginChar FunctionRefList] EndChar) |
( SignatureKeyword AllKeyword [ExceptKeyword BeginChar SignatureRefList] EndChar) |
( ModuleParKeyword AllKeyword [ExceptKeyword BeginChar ModuleParRefList] EndChar)
 
[509]AttribSpec::=FreeText 
7 Behaviour statements
[510]BehaviourStatements::=TestcaseInstance |
FunctionInstance |
ReturnStatement |
AltConstruct |
InterleavedConstruct |
LabelStatement |
GotoStatement |
RepeatStatement |
DeactivateStatement |
AltstepInstance
/* Static semantics: TestcaseInstance shall not be called from within an existing executing testcase or function chain called from a testcase i.e., testcases can only be instantiated from the control part or from functions directly called from the control part */
[511]VerdictStatements::=SetLocalVerdict 
[512]VerdictOps::=GetLocalVerdict 
[513]SetLocalVerdict::=SetVerdictKeyword "(" SingleExpression ")" /* Static semantics: SingleExpression must resolve to a value of type verdict */
/* Static semantics: the SetLocalVerdict shall not be used to assign the Value error */
[514]SetVerdictKeyword::="setverdict" 
[515]GetLocalVerdict::="getverdict" 
[516]SUTStatements::=ActionKeyword "(" (FreeText |
TemplateRefWithParList) ")"
 
[517]ActionKeyword::="action" 
[518]ReturnStatement::=ReturnKeyword [Expression] 
[519]AltConstruct::=AltKeyword BeginChar AltGuardList EndChar 
[520]AltKeyword::="alt" 
[521]AltGuardList::={GuardStatement [SemiColon]}+ [ElseStatement [SemiColon]] 
[522]GuardStatement::=AltGuardChar (AltstepInstance |
GuardOp StatementBlock)
 
[523]ElseStatement::="["ElseKeyword "]" StatementBlock 
[524]AltGuardChar::="[" [BooleanExpression] "]" 
[525]GuardOp::=TimeoutStatement |
ReceiveStatement |
TriggerStatement |
GetCallStatement |
CatchStatement |
CheckStatement |
GetReplyStatement |
DoneStatement
/* Static semantics: GuardOp used within the module control part. May only contain the timeoutStatement */
[526]InterleavedConstruct::=InterleavedKeyword BeginChar InterleavedGuardList EndChar 
[527]InterleavedKeyword::="interleave" 
[528]InterleavedGuardList::={InterleavedGuardElement [SemiColon]}+ 
[529]InterleavedGuardElement::=InterleavedGuard InterleavedAction 
[530]InterleavedGuard::="[" "]" GuardOp 
[531]InterleavedAction::=StatementBlock /* Static semantics: the StatementBlock may not contain loop statements, goto, activate, deactivate, stop, return or calls to functions */
[532]LabelStatement::=LabelKeyword LabelIdentifier 
[533]LabelKeyword::="label" 
[534]LabelIdentifier::=Identifier 
[535]GotoStatement::=GotoKeyword LabelIdentifier 
[536]GotoKeyword::="goto" 
[537]RepeatStatement::="repeat" 
[538]ActivateOp::=ActivateKeyword "(" AltstepInstance ")" 
[539]ActivateKeyword::="activate" 
[540]DeactivateStatement::=DeactivateKeyword ["(" Expression ")"] /* Static semantics: Expression shall evaluate to a value of default type */
[541]DeactivateKeyword::="deactivate" 
8 Basic statements
[542]BasicStatements::=Assignment |
LogStatement |
LoopConstruct |
ConditionalConstruct
 
[543]Expression::=SingleExpression |
CompoundExpression
/* Static semantics: Expression shall not contain Configuration, activate operation or verdict operations within the module control part */
[544]CompoundExpression::=FieldExpressionList |
ArrayExpression
/* Static semantics: Within CompoundExpression the ArrayExpression can be used for Arrays, record, record of and set of types. */
[545]FieldExpressionList::="{" FieldExpressionSpec {"," FieldExpressionSpec} "}" 
[546]FieldExpressionSpec::=FieldReference AssignmentChar Expression 
[547]ArrayExpression::="{" [ArrayElementExpressionList] "}" 
[548]ArrayElementExpressionList::=NotUsedOrExpression {"," NotUsedOrExpression} 
[549]NotUsedOrExpression::=Expression |
NotUsedSymbol
 
[550]ConstantExpression::=SingleConstExpression |
CompoundConstExpression
 
[551]SingleConstExpression::=SingleExpression /* Static semantics: SingleConstExpression shall not contain Variables or Module parameters and shall resolve to a constant Value at compile time */
[552]BooleanExpression::=SingleExpression /* Static semantics: BooleanExpression shall resolve to a Value of type boolean */
[553]CompoundConstExpression::=FieldConstExpressionList |
ArrayConstExpression
/* Static semantics: Within CompoundConstExpression the ArrayConstExpression can be used for Arrays, record, record of and set of types. */
[554]FieldConstExpressionList::="{" FieldConstExpressionSpec {"," FieldConstExpressionSpec} "}" 
[555]FieldConstExpressionSpec::=FieldReference AssignmentChar ConstantExpression 
[556]ArrayConstExpression::="{" [ArrayElementConstExpressionList] "}" 
[557]ArrayElementConstExpressionList::=ConstantExpression {"," ConstantExpression} 
[558]Assignment::=VariableRef AssignmentChar Expression /* Operational semantics: The Expression on the RHS of Assignment shall evaluate to an explicit Value of the type of the LHS. */
[559]SingleExpression::=SimpleExpression {LogicalOp SimpleExpression} /* Operational semantics: If both SimpleExpressions and the LogicalOp exist then the SimpleExpressions shall evaluate to specific values of compatible types */
[560]SimpleExpression::=["not"] SubExpression /* Operational semantics: Operands of the not operator shall be of type boolean (TTCN or ASN.1) or derivatives of type boolean */
[561]SubExpression::=PartialExpression [RelOp PartialExpression] /* Operational semantics: If both PartialExpressions and the RelOp exist then the PartialExpressions shall evaluate to specific values of compatible types. */
/* Operational semantics: If RelOp is <, >, >=, or <= then each SubExpression shall evaluate to a specific integer, Enumerated or float Value (these values can either be TTCN or ASN.1 values) */
[562]PartialExpression::=Result [ShiftOp Result] /* Operational semantics: Each Result shall resolve to a specific Value. If more than one Result exists the right-hand operand shall be of type integer and if the ShiftOp is << or >> then the left-hand operand shall resolve to either bitstring, hexstring or octetstring type. If the shift op is <@ or @> then the left-hand operand shall be of type bitstring, hexstring, charstring or universal charstring */
[563]Result::=SubResult {BitOp SubResult} /* Operational semantics: If both SubResults and the BitOp exist then the SubResults shall evaluate to specific values of compatible types */
[564]SubResult::=["not4b"] Product /* Operational semantics: If the not4b operator exists, the operand shall be of type bitstring, octetstring or hexstring. */
[565]Product::=Term {AddOp Term} /* Operational semantics: Each Term shall resolve to a specific Value. If more than one Term exists and the AddOp resolves to StringOp then the terms shall resolve to same type which shall be of bitstring, hexstring, octetstring, charstring or universal charstring.If more than one Term exists and the AddOp does not resolve to StringOp then the Terms shall both resolve to type integer or float. */
[566]Term::=Factor {MultiplyOp Factor} /* Operational semantics: Each Factor shall resolve to a specific Value. If more than one Factor exists then the Factors shall resolve to type integer or float. */
[567]Factor::=[UnaryOp] Primary /* Operational semantics: The Primary shall resolve to a specific Value. If UnaryOp exists and is "not" then Primary shall resolve to type boolean if the UnaryOp is + or - then Primary shall resolve to type integer or float. If the UnaryOp resolves to not4b then the Primary shall resolve to the type bitstring, hexstring or octetstring. */
[568]Primary::=OpCall |
Value |
"(" SingleExpression ")"
 
[569]ExtendedFieldReference::={(Dot ( StructFieldIdentifier |
ArrayOrBitRef |
TypeDefIdentifier)) |
ArrayOrBitRef }+
/* Operational semantics: The TypeDefIdentifier shall be used only if the type of the VarInstance or ReferencedValue in which the ExtendedFieldReference is used is anytype. */
[570]OpCall::=ConfigurationOps |
VerdictOps |
TimerOps |
TestcaseInstance |
FunctionInstance |
TemplateOps |
ActivateOp
 
[571]AddOp::="+" |
"-" |
StringOp
/* Operational semantics: Operands of the + or - operators shall be of type integer or float (i.e., TTCN or ASN.1 predefined) or derivations of integer or float (i.e., subrange) */
[572]MultiplyOp::="*" |
"/" |
"mod" |
"rem"
/* Operational semantics: Operands of the *, /, rem or mod operators shall be of type integer or float (i.e., TTCN or ASN.1 predefined) or derivations of integer or float (i.e., subrange). */
[573]UnaryOp::="+" |
"-"
/* Operational semantics: Operands of the + or - operators shall be of type integer or float (i.e., TTCN or ASN.1 predefined) or derivations of integer or float (i.e., subrange). */
[574]RelOp::="==" |
"<" |
">" |
"!=" |
">=" |
"<="
/* Operational semantics: the precedence of the operators is defined here */
[575]BitOp::="and4b" |
"xor4b" |
"or4b"
/* Operational semantics: Operands of the and4b, or4b or xor4b operator shall be of type bitstring, hexstring or octetstring (TTCN or ASN.1) or derivatives of these types. */
[576]LogicalOp::="and" |
"xor" |
"or"
/* Operational semantics: Operands of the and, xor, or or operators shall be of type boolean (TTCN or ASN.1) or derivatives of type boolean. */
/* Operational semantics: the precedence of the operators is defined here */
[577]StringOp::="&" /* Operational semantics: Operands of the & operator shall be bitstring, hexstring, octetstring or character string */
[578]ShiftOp::="<<" |
">>" |
"<@" |
"@>"
 
[579]LogStatement::=LogKeyword "(" [FreeText] ")" 
[580]LogKeyword::="log" 
[581]LoopConstruct::=ForStatement |
WhileStatement |
DoWhileStatement
 
[582]ForStatement::=ForKeyword "(" Initial SemiColon Final SemiColon Step ")" StatementBlock 
[583]ForKeyword::="for" 
[584]Initial::=VarInstance |
Assignment
 
[585]Final::=BooleanExpression 
[586]Step::=Assignment 
[587]WhileStatement::=WhileKeyword "(" BooleanExpression ")" StatementBlock 
[588]WhileKeyword::="while" 
[589]DoWhileStatement::=DoKeyword StatementBlock WhileKeyword "(" BooleanExpression ")" 
[590]DoKeyword::="do" 
[591]ConditionalConstruct::=IfKeyword "(" BooleanExpression ")" StatementBlock {ElseIfClause} [ElseClause] 
[592]IfKeyword::="if" 
[593]ElseIfClause::=ElseKeyword IfKeyword "(" BooleanExpression ")" StatementBlock 
[594]ElseKeyword::="else" 
[595]ElseClause::=ElseKeyword StatementBlock 
9 Miscellaneous productions
[596]Dot::="." 
[597]Dash::="-" 
[598]Minus::=Dash 
[599]SemiColon::=";" 
[600]Colon::=":" 
[601]Underscore::="_" 
[602]BeginChar::="{" 
[603]EndChar::="}" 
[604]AssignmentChar::=":=" 

Table 1. Overview of TTCN-3 types

Class of typeKeywordSub-type
Simple basic typesintegerrange, list
charrange, list
universal charrange, list
floatrange, list
booleanlist
objidlist
verdicttypelist
Basic string typesbitstringlist, length
hexstringlist, length
octetstringlist, length
charstringrange, list, length
universal charstringrange, list, length
Structured typesrecordlist
record oflist, length
setlist
set oflist, length
enumeratedlist
unionlist
Special data typesanytypelist
Special configuration typesaddress 
port 
component 
Special default typesdefault 

Table 2. Precedence of operators

PriorityOperator typeOperator
highestUnary/Binary+, - *, /, mod, rem
 Binary+, -, &
 Unarynot4b
 Binaryand4b
 Binaryxor4b
 Binaryor4b
 Binary<<, >>, <@, @>
 Binary<, >, <=, >=
 Binary==, !=
 Unarynot
 Binaryand
 Binaryxor
lowestBinaryor

Table 3. TTCN-3 predefined functions

CategoryFunctionKeyword
Conversion functionsConvert integer value to char valueint2char
Convert integer value to universal char valueint2unichar
Convert integer value to bitstring valueint2bit
Convert integer value to hexstring valueint2hex
Convert integer value to octetstring valueint2oct
Convert integer value to charstring valueint2str
Convert integer value to float valueint2float
Convert float value to integer valuefloat2int
Convert char value to integer valuechar2int
Convert universal char value to integer valueunichar2int
Convert bitstring value to integer valuebit2int
Convert bitstring value to hexstring valuebit2hex
Convert bitstring value to octetstring valuebit2oct
Convert bitstring value to charstring valuebit2str
Convert hexstring value to integer valuehex2int
Convert hexstring value to bitstring valuehex2bit
Convert hexstring value to octetstring valuehex2oct
Convert hexstring value to charstring valuehex2str
Convert octetstring value to integer valueoct2int
Convert octetstring value to bitstring valueoct2bit
Convert octetstring value to hexstring valueoct2hex
Convert octetstring value to charstring valueoct2str
Convert charstring value to integer valuestr2int
Convert charstring value to octetstring valuestr2oct
Length/size functionsReturn the length of a value of any string typelengthof
Return the number of elements in a record, record of, template, set, set of or arraysizeof
Presence/choice functionsDetermine if an optional field in a record, record of, template, set or set of is presentispresent
Determine which choice has been made in a union typeischosen
String functionsReturns part of the input string matching the specified pattern descriptionregexp
Returns the specified portion of the input stringsubstr
Other functionsGenerate a random float numberrnd