CONTENTS

 1     Scope 
 2     References 
 3     Definitions and abbreviations        
        3.1     Definitions 
        3.2     Definitions from ITU-T Rec. X.290 and ISO/IEC 9646-1  
        3.3     Definitions from ITU-T Rec. X.292 and ISO/IEC 9646-3  
        3.4     Abbreviations        
 4     Introduction      
        4.1     The core language and presentation formats
 5     Basic language elements   
        5.1     Definitions, instances and declarations        
        5.2     Ordering of language elements        
                  5.2.1     Forward references          
        5.3     Parameterization    
                  5.3.1     Parameter passing by reference and by value         
                  5.3.2     Formal and actual parameter lists  
                  5.3.3     Empty formal parameter list           
                  5.3.4     Nested parameter lists      
        5.4     Scope rules           
                  5.4.1     Scope and overloading of identifiers          
                  5.4.2     Scope of formal parameters          
        5.5     Identifiers and keywords    
 6     Types and values 
        6.1     Basic types and values       
                  6.1.1     Basic string types and values         
                  6.1.2     Accessing individual string elements           
        6.2     User-defined subtypes and values  
                  6.2.1     Lists of values       
                  6.2.2     Ranges     
                  6.2.3     String length restrictions    
        6.3     Structured types and values
                  6.3.1     Record type and values     
                  6.3.2     Set type and values           
                  6.3.3     Records and sets of single types    
                  6.3.4     Enumerated type and values          
                  6.3.5     Unions      
        6.4     Arrays    
        6.5     Recursive types     
        6.6     Type parameterization        
        6.7     Type compatibility 
                  6.7.1     Type conversion   
 7     Modules    
        7.1     Naming of modules
        7.2     Parameterization of modules           
                  7.2.1     Default values for module parameters        
        7.3     Module definitions part      
                  7.3.1     Groups of definitions         
        7.4     Module control part           
        7.5     Importing from modules     
                  7.5.1     Rules on using Import       
                  7.5.2     Importing single definitions
                  7.5.3     Importing all definitions of a module           
                  7.5.4     Importing groups  
                  7.5.5     Importing definitions of the same kind        
                  7.5.6     Recursive import of complex definitions     
                  7.5.7     Handling name clashes on import   
                  7.5.8     Handling multiple references to the same definition 
                  7.5.9     Import and module parameters      
                  7.5.10     Import definitions from non-TTCN modules        
 8     Test configurations           
        8.1     Port communication model 
        8.2     Abstract test system interface         
        8.3     Defining communication port types 
                  8.3.1     Mixed ports          
        8.4     Defining component types  
                  8.4.1     Declaring local variables and timers in a component           
                  8.4.2     Defining components with arrays of ports  
        8.5     Addressing entities inside the SUT  
        8.6     Component references       
        8.7     Defining the test system interface    
 9     Declaring constants          
10     Declaring variables          
11     Declaring timers  
       11.1     Timers as parameters        
12     Declaring messages         
       12.1     Optional message fields     
13     Declaring procedure signatures    
       13.1     Omitting actual parameters
       13.2     Specifying exceptions        
14     Declaring templates         
       14.1     Declaring message templates         
                  14.1.1     Templates for sending messages  
                  14.1.2     Templates for receiving messages
       14.2     Declaring signature templates        
                  14.2.1     Templates for calling procedures 
                  14.2.2     Templates for accepting procedure calls  
       14.3     Template matching mechanisms     
       14.4     Parameterization of templates        
                  14.4.1     Parameterization with matching attributes 
       14.5     Passing templates as parameters    
       14.6     Modified templates           
                  14.6.1     Parameterization of modified templates    
                  14.6.2     In-line modified templates           
       14.7     Changing template fields    
       14.8     Match Operation  
       14.9     Valueof operation 
15     Operators 
       15.1     Arithmetic operators         
       15.2     String operators    
       15.3     Relational operators          
       15.4     Logical operators  
       15.5     Bitwise operators  
       15.6     Shift operators      
       15.7     Rotate operators   
16     Functions  
       16.1     Parameterization of Functions        
       16.2     Invoking functions 
       16.3     Predefined functions          
17     Test cases 
18     Program statements and operations         
19     Basic program statements    
19.1      Expressions     
19.1.1      Boolean expressions     
19.2      Assignments     
19.3      The Log statement     
19.4      The Label statement     
19.5      The Goto statement     
19.6      The If-else statement     
19.7      The For statement      
19.8      The While statement     
19.9      The Do-while statement     
19.10      The Stop execution statement     
20      Behavioural program statements     
20.1      Sequential behaviour     
20.2      Alternative behaviour     
20.2.1      Execution of alternative behaviour     
20.2.2      Selecting/deselecting an alternative     
20.2.3      Else branch in alternatives     
20.2.4      Declaring named alternatives     
20.2.5      Expanding alternatives with named alternatives     
20.2.6      Parameterization of named alternatives     
20.2.7      The Label statement in behaviour     
20.2.8      The Goto statement in behaviour     
20.3      Interleaved behaviour     
20.4      Default behaviour     
20.4.1      The Activate and Deactivate operations     
20.5      The Return statement     
21      Configuration operations     
21.1      The Create operation     
21.2      The Connect and Map operations     
21.2.1      Consistent connections     
21.3      The Disconnect and Unmap operations     
21.4      The MTC, System and Self operations     
21.5      The Start test component operation     
21.6      The Stop test component operation     
21.7      The Running operation     
21.8      The Done operation     
21.9      Using component arrays     
21.10      Use of Any and All with components     
22      Communication operations     
22.1      Sending operations     
22.1.1      General format of the sending operations     
22.1.2      The Send operation     
22.1.3      The Call operation     
22.1.4      The Reply operation     
22.1.5      The Raise operation     
22.2      Receiving operations     
22.2.1      General format of the receiving operations     
22.2.2      The Receive operation     
22.2.3      The Trigger operation     
22.2.4      The Getcall operation     
22.2.5      The Getreply operation     
22.2.6      The Catch operation     
22.2.7      The Check operation     
22.3      Controlling communication ports     
22.3.1      The Clear port operation     
22.3.2      The Start port operation     
22.3.3      The Stop port operation     
22.4      Use of any and all with ports     
23      Timer operations     
23.1      The Start timer operation     
23.2      The Stop timer operation     
23.3      The Read timer operation     
23.4      The Running timer operation     
23.5      The Timeout event     
23.6      Use of any and all with timers     
24      Test verdict operations     
24.1      Test case verdict     
24.2      Verdict values and overwriting rules     
24.2.1      Error verdict     
25      SUT operations     
26      Module control part     
26.1      Execution of test cases     
26.2      Termination of test cases     
26.3      Controlling execution of test cases     
26.4      Test case selection     
26.5      Use of timers in control     
27      Specifying attributes     
27.1      Display attributes     
27.2      Encoding attributes     
27.2.1      Invalid encodings      
27.3      Extension attributes     
27.4      Scope of attributes     
27.5      Overwriting rules for attributes     
27.6      Changing attributes of imported language elements     
Annex A - BNF and static semantics     
A.1      TTCN-3 BNF      
A.1.1      Conventions for the syntax description     
A.1.2      Statement terminator symbols     
A.1.3      Identifiers     
A.1.4      Comments     
A.1.5      TTCN-3 terminals     
A.1.6      TTCN-3 syntax BNF productions     
Annex B - Operational semantics     
B.1      Structure of this annex     
B.2      Replacement of shorthand notations and macro calls     
B.2.1      Order of replacement steps     
B.2.2      Adding stop and return operations in behaviour descriptions     
B.2.3      Replacement of global constants and module parameters     
B.2.4      Embedding single receiving operations into alt statements     
B.2.5      Macro expansion     
B.2.6      Replacement of the interleave construct     
B.2.7      Expansion of defaults     
B.2.8      Replacement of trigger operations     
B.2.9      Replacement of the keywords 'any' and 'all'     
B.3      Flow graph semantics of TTCN-3     
B.3.1      Flow graphs     
B.3.2      Flow Graph Representation of TTCN-3 behaviour     
B.3.3      State definitions for TTCN-3 modules     
B.3.4      Messages, procedure calls, replies and exceptions     
B.3.5      Call records for functions and test cases     
B.3.6      The evaluation procedure for a TTCN-3 module     
B.3.7      Flow graph segment definitions for TTCN-3 constructs     
B.3.8      Lists of operational semantic components     
Annex C - Matching incoming values     
C.1      Template matching mechanisms     
C.1.1      Matching specific values     
C.1.2      Matching mechanisms instead of values     
C.1.3      Matching mechanisms inside values     
C.1.4      Matching attributes of values     
C.1.5      Matching character pattern     
Annex D - Pre-defined TTCN-3 functions     
D.1      Pre-defined TTCN-3 functions     
D.1.1      Integer to character     
D.1.2      Character to integer     
D.1.3      Integer to universal character     
D.1.4      Universal character to integer     
D.1.5      Bitstring to integer     
D.1.6      Hexstring to integer     
D.1.7      Octetstring to integer     
D.1.8      Charstring to integer     
D.1.9      Integer to bitstring     
D.1.10      Integer to hexstring     
D.1.11      Integer to octetstring     
D.1.12      Integer to charstring     
D.1.13      Length of string type     
D.1.14      Number of elements in a structured type     
D.1.15      The IsPresent function     
D.1.16      The IsChosen function     
Annex E - Using other data types with TTCN-3     
E.1      Using ASN.1 with TTCN-3     
E.1.1      ASN.1 and TTCN-3 type equivalents     
E.1.2      ASN.1 data types and values     
E.1.3      Parameterization in ASN.1     
E.1.4      Defining message types with ASN.1     
E.1.5      Defining ASN.1 message templates     
E.1.6      Encoding information