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

ID | Project | Category | View Status | Date Submitted | Last Update
0006237 | Part 01: TTCN-3 Core Language | Editorial | public | 01-08-2012 09:23 | 08-08-2012 09:38

Reporter | Tomas Urban |
Assigned To | Tomas Urban |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | won't fix |
Platform |  | OS |  | OS Version |
Product Version | v4.4.1 (published 2012-04) |
Target Version | v4.5.1 (published 2013-04) | Fixed in Version |  |
Clause Reference(s) | 10
Source (company - Author) | Elvior

Summary | 0006237: Expressions in constant declarations

Description

The syntactical structure for constant declaration in chapter 10 and rule 78 in the BNF refer to "ConstantExpression". ConstantExpression is defined in the BNF rule 496, but is in fact syntactically equal to the rule 489 (Expression). The BNF doesn't contain any other semantic restrictions on "ConstantExpression" that would make it different from a common expression. Since the general tendency in the last revisions of the standard was removal of syntactically identical rules, I propose to remove the rule 496 and 506 and replace all references to ConstantExpression with a reference to Expression.
I would also appreciate if the chapter 10 contained an example of a constant initialized with a runtime-resolved expression (e.g. const float MyConst3 := rnd();) to demonstrate the runtime character of constants in TTCN-3, because this is quite unusual behaviour comparing to commonly used programming languages (C++, C#).

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | CR6237_resolution_v1.doc (74,752) 07-08-2012 17:38 http://oldforge.etsi.org/mantis/file_download.php?file_id=2708&type=bug

Issue History
Date Modified | Username | Field | Change
01-08-2012 09:23 | Tomas Urban | New Issue |
01-08-2012 09:23 | Tomas Urban | Clause Reference(s) | => 10
01-08-2012 09:23 | Tomas Urban | Source (company - Author) | => Elvior
06-08-2012 13:05 | Tomas Urban | Note Added: 0010975 |
07-08-2012 16:57 | Gyorgy Rethy | Status | new => assigned
07-08-2012 16:57 | Gyorgy Rethy | Assigned To | => Gyorgy Rethy
07-08-2012 17:36 | Gyorgy Rethy | Note Added: 0010986 |
07-08-2012 17:38 | Gyorgy Rethy | File Added: CR6237_resolution_v1.doc |
07-08-2012 17:39 | Gyorgy Rethy | Note Edited: 0010986 |
07-08-2012 17:39 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Tomas Urban
08-08-2012 09:38 | Gyorgy Rethy | Status | assigned => closed
08-08-2012 09:38 | Gyorgy Rethy | Resolution | open => won't fix
08-08-2012 09:38 | Gyorgy Rethy | Target Version | => Edition 4.5.1

Notes

(0010975)
Tomas Urban
06-08-2012 13:05

I am sorry for misleading second part of the message. I got this issue from one of our developers and forgot to verify all the facts. In fact, C++ constants are runtime constants and C# constant approach is quite unique, since it supports two types of constants (compile-time resolved const and runtime resolved readonly).

(0010986)
Gyorgy Rethy
07-08-2012 17:36 (edited on: 07-08-2012 17:39)

Regarding the BNF question: in fact constant and variable definitions differ in one case, in constants no "unchanged" (dash) can be used for a field or element, in variables it can be used:
502. ArrayElementExpressionList ::= NotUsedOrExpression {"," NotUsedOrExpression}
503. NotUsedOrExpression ::= Expression | Minus
510. ArrayElementConstExpressionList ::= ConstantExpression {"," ConstantExpression}
So, I propose not to chanhe the BNF.
Regarding the example:
I have added one, see the file CR6237_resolution_v1.doc.
Pls. check if this is OK with you.