Logo etsi

ETSI's Bug Tracker

Notice: information submitted on the ETSI issue Tracker may be incorporated in ETSI publication(s) and therefore subject to the ETSI IPR policy.

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008067Part 01: TTCN-3 Core LanguageTechnicalpublic08-11-2021 13:1420-12-2021 09:57
ReporterTomas Urban 
Assigned ToJens Grabowski 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0008067: Postfix value notation for templates
DescriptionThe valueof operation could be extended and support the following the features:
- it converts patterns into their textual representation: valueof (pattern "a?b") would yield "a?b"
- it removes matching attributes if the matching symbol that contains these attributes can be converted into a value: valueof ("abc" ifpresent) would yield "abc"
TagsNo tags attached.
Clause Reference(s)15.10
Source (company - Author)TTF T014
Attached Filesdocx file icon CR8067.docx [^] (181,714 bytes) 12-11-2021 15:15
docx file icon CR8067-2.docx [^] (208,894 bytes) 15-11-2021 07:35

- Relationships
related to 0008006closedJens Grabowski Unnecessary Restriction 15.6.1 should be removed. 
related to 0008032closedJens Grabowski BNF links and formatting 

-  Notes
(0016004)
Martin Hauch (reporter)
08-11-2021 14:07

This would change the semantic of valueof-operation. In my opinion the current version would cause an error for both examples above.
Further question: How should regular expressions be handled, e.g.
pattern "ab?#(1,1)"
pattern "ab\?#(1,1)"
(0016006)
Jacob Wieland - Spirent (reporter)
08-11-2021 15:05

Yes, this would change the semantics of the valueof operation for cases where at the moment it has no valid semantics, i.e. would cause a runtime-error.

So, this would not cause a backwards incompatible change.

In regard to your question, for the first expression the result would be "ab?#(1,1)" and for the second it would be "ab\?#(1,1)", following the idea that valueof(pattern X) == X.
(0016009)
Jacob Wieland - Spirent (reporter)
08-11-2021 15:26

What is problematic with this proposal is that the current relationship that isvalue(X) == true iff valueof(X) is a valid expression is not true anymore.

(but it is still true that if isvalue(X) is true, then valueof(X) == X)

Alternative proposal could be to allow .value as a dotted postif notation. The value keyword is already used in other places, so this does not introduce a new keyword.

It would then need to be defined for what kind of template expressions the .value operation would yield what.
(0016023)
Tomas Urban (developer)
09-11-2021 07:13
edited on: 09-11-2021 07:14

Jacob's proposal for using the postfix value notation for this functionality seems better than overloading the valueof function. I renamed the CR accordingly.

As regards Martin's question, the conversion would just remove the pattern keyword, thus the backslash character would be kept:

template charstring mw_tmp := pattern "ab\?#(1,1)";
var charstring v_str := mw_tmp.value; // v_str will be equal to "ab\?#(1,1)" after the assignment

(0016080)
Jacob Wieland - Spirent (reporter)
12-11-2021 15:16

please review
(0016083)
Tomas Urban (developer)
15-11-2021 07:39

I am fine with the proposed changes, but I added one additional rule concerning removal of matching attributes from patterns so that the following would work:

var template charstring v_pattern := pattern "[abc]+" length(3..5);
var charstring v_patternValue := v_pattern.value; // assigns "[abc]+"
v_pattern := pattern "[abc]+" ifpresent;
v_patternValue := v_pattern.value; // assigns "[abc]+"

Please review.
(0016084)
Martin Hauch (reporter)
15-11-2021 07:58

Question: Is ".value" only allowed for types charstring and universal charstring or also for other types (structured-types, union-types,other basic-types) ? Should ".value" always be the last element of an ExtendedFieldReference? If it's also allowed for structured types, I think an example might be helpful.
(0016129)
Jacob Wieland - Spirent (reporter)
30-11-2021 16:45

The ifpresent removal is also applicable to other types than charstring and universal charstring, therefore, the .value can appear anywhere inside an ExtendedFieldReference, the type of the operand to .value and the type of the resulting value are the same (just template-ness is removed).
(0016148)
Jens Grabowski (manager)
20-12-2021 09:57

Implemented

- Issue History
Date Modified Username Field Change
08-11-2021 13:14 Tomas Urban New Issue
08-11-2021 13:14 Tomas Urban Status new => assigned
08-11-2021 13:14 Tomas Urban Assigned To => Jacob Wieland - Spirent
08-11-2021 13:14 Tomas Urban Relationship added related to 0008017
08-11-2021 13:15 Tomas Urban Relationship deleted related to 0008017
08-11-2021 13:16 Tomas Urban Relationship added related to 0008006
08-11-2021 14:07 Martin Hauch Note Added: 0016004
08-11-2021 15:05 Jacob Wieland - Spirent Note Added: 0016006
08-11-2021 15:26 Jacob Wieland - Spirent Note Added: 0016009
09-11-2021 07:13 Tomas Urban Note Added: 0016023
09-11-2021 07:13 Tomas Urban Summary Extended functionality of the valuof operation => Postfix value notation for templates
09-11-2021 07:14 Tomas Urban Note Edited: 0016023 View Revisions
09-11-2021 07:14 Tomas Urban Note Edited: 0016023 View Revisions
12-11-2021 14:54 Jacob Wieland - Spirent File Added: CR8067.docx
12-11-2021 15:15 Jacob Wieland - Spirent File Deleted: CR8067.docx
12-11-2021 15:15 Jacob Wieland - Spirent File Added: CR8067.docx
12-11-2021 15:16 Jacob Wieland - Spirent Note Added: 0016080
12-11-2021 15:16 Jacob Wieland - Spirent Assigned To Jacob Wieland - Spirent => Tomas Urban
12-11-2021 15:16 Jacob Wieland - Spirent Status assigned => confirmed
15-11-2021 07:32 Tomas Urban File Added: CR8067-2.docx
15-11-2021 07:34 Tomas Urban File Deleted: CR8067-2.docx
15-11-2021 07:35 Tomas Urban File Added: CR8067-2.docx
15-11-2021 07:39 Tomas Urban Note Added: 0016083
15-11-2021 07:39 Tomas Urban Assigned To Tomas Urban => Jacob Wieland - Spirent
15-11-2021 07:58 Martin Hauch Note Added: 0016084
30-11-2021 16:45 Jacob Wieland - Spirent Note Added: 0016129
01-12-2021 07:39 Axel Rennoch Relationship added related to 0008032
09-12-2021 08:59 Jacob Wieland - Spirent Status confirmed => resolved
09-12-2021 08:59 Jacob Wieland - Spirent Resolution open => fixed
09-12-2021 08:59 Jacob Wieland - Spirent Assigned To Jacob Wieland - Spirent => Jens Grabowski
20-12-2021 09:57 Jens Grabowski Note Added: 0016148
20-12-2021 09:57 Jens Grabowski Status resolved => closed


MantisBT 1.2.14 [^]
Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker