[Main Page]

Technical Documentation:Go4IT BNF

From Go4IT project

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy

Contents

A.1.0 General

This document is derived from the normative Annex A part of the TTCN3 Standard (Methods For Testing and Specification (MTS) - TTCN-3 - Part1: TTCN-3 Core language - ETSI ES 201 873-1 v3.1.1 (2005-06) ). This version defines the language subset which is supported by the Go4IT platform.


This annex defines the syntax of TTCN-3 using extended BNF (henceforth just called BNF).

A.1.1 Conventions for the syntax description

Table A.1 defines the metanotation used to specify the extended BNF grammar for TTCN-3.


Table A.1: The syntactic metanotation
::= is defined to be
abc xyz abc followed by xyz
alternative
[abc] 0 or 1 instances of abc
{abc} 0 or more instances of abc
{abc}+ 1 or more instances of abc
(...) textual grouping
Abc the non-terminal symbol abc
"abc" a terminal symbol abc

Go4IT grammar is defined as a subset of the TTCN-3 grammar. The keywords and that will not be implemented in Go4IT is red marked.

A.1.2 Statement terminator symbols

In general all TTCN-3 language constructs (i.e. definitions, declarations, statements and operations) are terminated with a semi-colon (;). The semi-colon is optional if the language construct ends with a right-hand curly brace (}) or the following symbol is a right-hand curly brace (}), i.e. the language construct is the last statement in a block of statements, operations and declarations.

A.1.3 Identifiers

TTCN-3 identifiers are case sensitive and may only contain lowercase letters (a-z) uppercase letters (A-Z) and numeric digits (0-9). Use of the underscore ( _ ) symbol is also allowed. An identifier shall begin with a letter (i.e. not a number and not an underscore).

A.1.4 Comments

Comments written in free text may appear anywhere in a TTCN-3 specification. Block comments shall be opened by the symbol pair /* and closed by the symbol pair */.

EXAMPLE 1:

 /* This is a block comment 
    spread over two lines */

Block comments shall not be nested.

/* This is not /* a legal */ comment */

Line comments shall be opened by the symbol pair // and closed by a <_newline_>.

EXAMPLE 2:

// This is a line comment
// spread over two lines

Line comments may follow TTCN-3 program statements but they shall not be embedded in a statement.

EXAMPLE 3:

// The following is not legal
const // This is MyConst integer MyConst := 1;
// The following is legal
const integer MyConst := 1; // This is MyConst

A.1.5 TTCN-3 terminals

TTCN-3 terminal symbols and reserved words are listed in tables A.2 and A.3.


Table A.2: List of TTCN-3 special terminal symbols
Begin/end block symbols { }
Begin/end list symbols ( )
Alternative symbols [ ]
To symbol (in a range) ..
Line comments and Block comments /* */ //
Line/statement terminator symbol ;
Arithmetic operator symbols + / -
String concatenation operator symbol &
Equivalence operator symbols != == >= <=
String enclosure symbols " '
Wildcard/matching symbols ? *
Assignment symbol :=
Communication operation assignment ->
Bitstring, hexstring and Octetstring values B H O
Float exponent E

The predefined function identifiers defined in table 10 and described in annex C shall also be treated as reserved words.

  • All “black character” keywords and associated rules and mechanisms are part of the Go4IT platform
  • All “red character” keywords and associated rules will not be developed in Go4IT platform (not needed by the supported test suites)
Table A.3: List of TTCN-3 terminals which are reserved words (red marked are the TTCN-3 keywords not used in Go4IT)

action, activate, address, alive, all, alt, altstep, and, and4b, any, anytype

bitstring, boolean

case, call, catch, char, charstring, check, clear, complement, component, connect, const, control, create

deactivate, default, disconnect, display, do, done

else, encode, enumerated, error, except, exception, execute, extends, extension, external

fail, false, float, for, from, function

getverdict, getcall, getreply, goto, group

hexstring

if, ifpresent, import, in, inconc, infinity, inout, integer, interleave

kill, killed

label, language, length, log

map, match, message, mixed, mod, modifies, module, modulepar, mtc

noblock, none, not, not4b, nowait, null

octetstring, of, omit, on, optional, or, or4b, out, override

param, pass, pattern, port, procedure, permutation

raise, read, receive, record, recursive (deprecated), rem, repeat, reply, return, running, runs

select, self, send, sender, set, setverdict, signature, start, stop, subset, superset, system

template, testcase, timeout, timer, to, trigger, true, type

union, universal, unmap

value, valueof, var, variant, verdicttype

while, with

xor, xor4b

The TTCN-3 terminals listed in table A.3 shall not be used as identifiers in a TTCN-3 module. These terminals shall be written in all lowercase letters.

A.1.6 TTCN-3 syntax BNF productions

Retrieved from "http://www.go4-it.eu/modules/mediawiki/index.php/Technical_Documentation:Go4IT_BNF"

This page has been accessed 4,558 times. This page was last modified 12:49, 13 October 2006. Content is available under Go4IT project.


© 2005-2008 - Eu FP6 - INFRA 7 - Go4IT project