ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0003945 | Part 01: TTCN-3 Core Language | Technical | public | 11-08-2008 11:01 | 14-08-2008 12:51

Reporter | Gyorgy Rethy |
Assigned To | Ina Schieferdecker |
Priority | normal | Severity | minor | Reproducibility | always
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version | v4.1.1 (published 2009-06) | Fixed in Version | v4.1.1 (published 2009-06) |
Clause Reference(s) | BNF rules 171-173
Source (company - Author) | L.M.Ericsson

Summary | 0003945: Empty statement blocks shall be allowed by BNF

Description

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.

Steps To Reproduce |
Additional Information | Proposed new bnf productions: 171. StatementBlock ::= "{" [FunctionDefList] [FunctionStatementList] "}" 172. FunctionDefList ::= {(FunctionLocalDef | FunctionLocalInst) [SemiColon]} 173. FunctionStatementList ::= {FunctionStatement [SemiColon]}
Tags | No tags attached.
Relationships |
Attached Files | 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
Date Modified | Username | Field | Change
11-08-2008 11:01 | Gyorgy Rethy | New Issue |
11-08-2008 11:01 | Gyorgy Rethy | Status | new => assigned
11-08-2008 11:01 | Gyorgy Rethy | Assigned To | => Ina Schieferdecker
11-08-2008 11:01 | Gyorgy Rethy | Clause Reference(s) | => BNF rules 171-173
11-08-2008 11:01 | Gyorgy Rethy | Source (company - Author) | => L.M.Ericsson
13-08-2008 15:46 | Ina Schieferdecker | Note Added: 0006514 |
13-08-2008 15:47 | Ina Schieferdecker | File Added: CR_EmptyStatementBlock.doc |
13-08-2008 15:48 | Ina Schieferdecker | Assigned To | Ina Schieferdecker => Gyorgy Rethy
13-08-2008 15:48 | Ina Schieferdecker | Resolution | open => fixed
13-08-2008 16:08 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Ina Schieferdecker
13-08-2008 16:08 | Gyorgy Rethy | Status | assigned => resolved
14-08-2008 12:51 | Ina Schieferdecker | Status | resolved => closed
14-08-2008 12:51 | Ina Schieferdecker | Fixed in Version | => Edition 4.1.1 (not yet published)
14-08-2008 12:51 | Ina Schieferdecker | Target 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