ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details
0003945Part 01: TTCN-3 Core LanguageTechnicalpublic11-08-2008 11:0114-08-2008 12:51
Gyorgy Rethy 
Ina Schieferdecker 
normalminoralways
closedfixed 
 
v4.1.1 (published 2009-06)v4.1.1 (published 2009-06) 
BNF rules 171-173
L.M.Ericsson
0003945: Empty statement blocks shall be allowed by BNF
In fact two issues are raised by the CR:
1) The current BNF rule

172. FunctionStatementOrDefList ::= {FunctionStatementOrDef [SemiColon]}+

disallows empty statement blocks, while it is not forbidden by the text, see for example note 3 to clause 5.2:
"NOTE 3: Statement blocks may include declarations. They may occur as stand-alone statement blocks, embedded in another statement block or within compound statements, e.g. as body of a while loop."

2) In clause 5.3 the textual part mandates that
"Inside a statement block, such as a function body or a branch of an
if-else statement, all declarations (if any), shall be made at the
beginning of the statement block only."

This rule is not reflected in the bnf:
171. StatementBlock ::= "{" [FunctionStatementOrDefList] "}"
172. FunctionStatementOrDefList ::= {FunctionStatementOrDef [SemiColon]}+
173. FunctionStatementOrDef ::= FunctionLocalDef |
                                FunctionLocalInst |
                                FunctionStatement
It is proposed to increase the clarity and usability of the standard by changing the bnf that it also indicates the above rule.
Proposed new bnf productions:

171. StatementBlock ::= "{" [FunctionDefList] [FunctionStatementList] "}"
172. FunctionDefList ::= {(FunctionLocalDef | FunctionLocalInst) [SemiColon]}
173. FunctionStatementList ::= {FunctionStatement [SemiColon]}
No tags attached.
doc CR_EmptyStatementBlock.doc (25,088) 13-08-2008 15:47
http://oldforge.etsi.org/mantis/file_download.php?file_id=1592&type=bug
Issue History
11-08-2008 11:01Gyorgy RethyNew Issue
11-08-2008 11:01Gyorgy RethyStatusnew => assigned
11-08-2008 11:01Gyorgy RethyAssigned To => Ina Schieferdecker
11-08-2008 11:01Gyorgy RethyClause Reference(s) => BNF rules 171-173
11-08-2008 11:01Gyorgy RethySource (company - Author) => L.M.Ericsson
13-08-2008 15:46Ina SchieferdeckerNote Added: 0006514
13-08-2008 15:47Ina SchieferdeckerFile Added: CR_EmptyStatementBlock.doc
13-08-2008 15:48Ina SchieferdeckerAssigned ToIna Schieferdecker => Gyorgy Rethy
13-08-2008 15:48Ina SchieferdeckerResolutionopen => fixed
13-08-2008 16:08Gyorgy RethyAssigned ToGyorgy Rethy => Ina Schieferdecker
13-08-2008 16:08Gyorgy RethyStatusassigned => resolved
14-08-2008 12:51Ina SchieferdeckerStatusresolved => closed
14-08-2008 12:51Ina SchieferdeckerFixed in Version => Edition 4.1.1 (not yet published)
14-08-2008 12:51Ina SchieferdeckerTarget Version => Edition 4.1.1 (not yet published)

Notes
(0006514)
Ina Schieferdecker   
13-08-2008 15:46   
In fact, statement blocks can be empty:
171. StatementBlock ::= "{" [FunctionStatementOrDefList] "}"

The ordering of definitions before statements should be added - see slight change in BNF proposal