ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details
0007766Part 01: TTCN-3 Core LanguageNew Featurepublic24-05-2018 12:4306-01-2019 08:58
Kristóf Szabados 
Gyorgy Rethy 
normalminorhave not tried
closedfixed 
 
4.11.1 (published 2019-05) 
6.2.4
L.M. Ericsson
0007766: enumeration items should accept any value that can be statically evaluated to an integer
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)
}
No tags attached.
docx CR_7766.docx (164,136) 17-07-2018 10:12
http://oldforge.etsi.org/mantis/file_download.php?file_id=3758&type=bug
docx 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
24-05-2018 12:43Kristóf SzabadosNew Issue
05-06-2018 14:57Jacob Wieland - SpirentNote Added: 0015108
16-07-2018 14:37Jens GrabowskiNote Added: 0015136
16-07-2018 14:37Jens GrabowskiAssigned To => Kristóf Szabados
16-07-2018 14:37Jens GrabowskiStatusnew => assigned
17-07-2018 10:12Kristóf SzabadosFile Added: CR_7766.docx
18-07-2018 08:05Kristóf SzabadosNote Added: 0015151
18-07-2018 08:05Kristóf SzabadosAssigned ToKristóf Szabados => Tomas Urban
18-07-2018 08:05Kristóf SzabadosStatusassigned => confirmed
19-07-2018 11:02Tomas UrbanFile Added: CR_7766-2.docx
19-07-2018 11:04Tomas UrbanNote Added: 0015172
19-07-2018 11:04Tomas UrbanStatusconfirmed => resolved
19-07-2018 11:04Tomas UrbanResolutionopen => fixed
19-07-2018 11:04Tomas UrbanAssigned ToTomas Urban => Gyorgy Rethy
06-01-2019 08:35Gyorgy RethyProjectTTCN-3 Change Requests => Part 01: TTCN-3 Core Language
06-01-2019 08:58Gyorgy RethyNote Added: 0015326
06-01-2019 08:58Gyorgy RethyStatusresolved => closed
06-01-2019 08:58Gyorgy RethyFixed 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