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

ID | Project | Category | View Status | Date Submitted | Last Update
0007766 | Part 01: TTCN-3 Core Language | New Feature | public | 24-05-2018 12:43 | 06-01-2019 08:58

Reporter | KristÃ³f Szabados |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version |  | Fixed in Version | 4.11.1 (published 2019-05) |
Clause Reference(s) | 6.2.4
Source (company - Author) | L.M. Ericsson

Summary | 0007766: enumeration items should accept any value that can be statically evaluated to an integer

Description

In the current standard enumeration items can have user specified values. But only integer numeric values.
Actually it would be possible and usefull for user, to allow using any value that can be evaluated and converted to an integer number statically.
For example:
const integer c_int := 45;
const bitstring c_bit := '10101111'B;
type enumerated MyEnum {
e_num (1),
e_bin ('10'B),
e_oct ('12'O),
e_hex ('AB'H),
e_bin_conv (bit2int('0111'B)),
e_oct_conv (oct2int('34'O)),
e_hex_conv (hex2int('AC'H)),
e_num_const (c_int),
e_bin_const (c_bit)
}

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | CR_7766.docx (164,136) 17-07-2018 10:12 http://oldforge.etsi.org/mantis/file_download.php?file_id=3758&type=bug CR_7766-2.docx (186,559) 19-07-2018 11:02 http://oldforge.etsi.org/mantis/file_download.php?file_id=3773&type=bug

Issue History
Date Modified | Username | Field | Change
24-05-2018 12:43 | KristÃ³f Szabados | New Issue |
05-06-2018 14:57 | Jacob Wieland - Spirent | Note Added: 0015108 |
16-07-2018 14:37 | Jens Grabowski | Note Added: 0015136 |
16-07-2018 14:37 | Jens Grabowski | Assigned To | => KristÃ³f Szabados
16-07-2018 14:37 | Jens Grabowski | Status | new => assigned
17-07-2018 10:12 | KristÃ³f Szabados | File Added: CR_7766.docx |
18-07-2018 08:05 | KristÃ³f Szabados | Note Added: 0015151 |
18-07-2018 08:05 | KristÃ³f Szabados | Assigned To | KristÃ³f Szabados => Tomas Urban
18-07-2018 08:05 | KristÃ³f Szabados | Status | assigned => confirmed
19-07-2018 11:02 | Tomas Urban | File Added: CR_7766-2.docx |
19-07-2018 11:04 | Tomas Urban | Note Added: 0015172 |
19-07-2018 11:04 | Tomas Urban | Status | confirmed => resolved
19-07-2018 11:04 | Tomas Urban | Resolution | open => fixed
19-07-2018 11:04 | Tomas Urban | Assigned To | Tomas Urban => Gyorgy Rethy
06-01-2019 08:35 | Gyorgy Rethy | Project | TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
06-01-2019 08:58 | Gyorgy Rethy | Note Added: 0015326 |
06-01-2019 08:58 | Gyorgy Rethy | Status | resolved => closed
06-01-2019 08:58 | Gyorgy Rethy | Fixed in Version | => 4.11.1 (published 2019-05)

Notes

(0015108)
Jacob Wieland - Spirent
05-06-2018 14:57

What is the benefit of this feature?
It just puts strain on the tool to be able to evaluate all these expressions at compile-time to ensure a) the consistency of the enumerated type (no number used twice) and b) the actual value of un-numbered enumerated values which are dependent on the values of numbered ones.
If at all, the only things I would allow would be usages of constant literals and calls, shift/rotate operators and predefined functions.
Otherwise, the boundary of what is still (feasibly) statically evaluatable is fuzzy and some tools would define that boundary differently than others.

(0015136)
Jens Grabowski
16-07-2018 14:37

STF discussion: ok, but only with the restrictions valid for type definintions and should be of type integer

(0015151)
KristÃ³f Szabados
18-07-2018 08:05

Please check.

(0015172)
Tomas Urban
19-07-2018 11:04

Review, no major issues found, I only corrected two capitalized identifiers. Ready to be added to the next version of the core language standard.

(0015326)
Gyorgy Rethy
06-01-2019 08:58

Added to draft v4.10.2