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

ID | Project | Category | View Status | Date Submitted | Last Update
0008006 | Part 01: TTCN-3 Core Language | New Feature | public | 17-02-2021 12:55 | 23-11-2021 14:57

Reporter | Jacob Wieland - Spirent |
Assigned To | Jens Grabowski |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version |  | Fixed in Version | 4.13.1 (ongoing) |
Clause Reference(s) | 15.6.1
Source (company - Author) | Spirent - Jacob Wieland

Summary | 0008006: Unnecessary Restriction 15.6.1 should be removed.

Description

The completely arbitrary restriction
15.6.1 Referencing individual string elements
It is not allowed to reference individual string elements inside templates or template fields. Instead, the substr
function (see clause C.4.2) shall be used.
should be removed from the standard. The index notation is problematic in the same cases as the substr function would be problematic (i.e. if there are matching mechanisms inside the template before the given index or index-range), so why would one be allowed and one not?
This is just a confusing rule and should be removed as it serves no purpose.

Steps To Reproduce |
Additional Information |
Tags | No tags attached.

Relationships

related to | 0008067 | closed | Jens Grabowski | Postfix value notation for templates

Attached Files

CR8006-210907.docx (72,608) 07-09-2021 14:39
http://oldforge.etsi.org/mantis/file_download.php?file_id=4004&type=bug
CR8006-2.docx (100,024) 09-09-2021 09:15
http://oldforge.etsi.org/mantis/file_download.php?file_id=4008&type=bug
CR8006-3.docx (111,431) 10-11-2021 07:52
http://oldforge.etsi.org/mantis/file_download.php?file_id=4046&type=bug
CR8006-4.docx (138,520) 11-11-2021 12:47
http://oldforge.etsi.org/mantis/file_download.php?file_id=4054&type=bug
CR8006-5.docx (104,805) 11-11-2021 15:00
http://oldforge.etsi.org/mantis/file_download.php?file_id=4056&type=bug
CR8006-6.docx (145,910) 12-11-2021 10:39
http://oldforge.etsi.org/mantis/file_download.php?file_id=4059&type=bug

Issue History
Date Modified | Username | Field | Change
17-02-2021 12:55 | Jacob Wieland - Spirent | New Issue |
23-03-2021 16:16 | Jens Grabowski | Project | TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
27-04-2021 12:57 | sekaw | Note Added: 0015928 |
06-09-2021 10:09 | Jens Grabowski | Note Added: 0015936 |
06-09-2021 10:09 | Jens Grabowski | Assigned To | => Jens Grabowski
06-09-2021 10:09 | Jens Grabowski | Status | new => assigned
07-09-2021 14:38 | Jens Grabowski | Note Added: 0015947 |
07-09-2021 14:39 | Jens Grabowski | File Added: CR8006-210907.docx |
07-09-2021 14:41 | Jens Grabowski | Note Added: 0015948 |
07-09-2021 14:41 | Jens Grabowski | Assigned To | Jens Grabowski => Tomas Urban
09-09-2021 09:15 | Tomas Urban | File Added: CR8006-2.docx |
09-09-2021 09:26 | Tomas Urban | Note Added: 0015962 |
09-09-2021 09:26 | Tomas Urban | Assigned To | Tomas Urban => Jacob Wieland - Spirent
09-09-2021 09:26 | Tomas Urban | Status | assigned => confirmed
09-09-2021 10:58 | Jacob Wieland - Spirent | Note Added: 0015964 |
09-09-2021 11:09 | Jacob Wieland - Spirent | Note Added: 0015965 |
09-09-2021 11:48 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Tomas Urban
09-09-2021 11:48 | Jacob Wieland - Spirent | Status | confirmed => assigned
10-09-2021 08:44 | Tomas Urban | Note Added: 0015974 |
10-09-2021 14:24 | Jens Grabowski | Note Added: 0015980 |
10-09-2021 14:25 | Jens Grabowski | Note Added: 0015981 |
10-09-2021 14:27 | Jens Grabowski | Note Added: 0015982 |
08-11-2021 13:16 | Tomas Urban | Relationship added | related to 0008067
10-11-2021 07:52 | Tomas Urban | File Added: CR8006-3.docx |
10-11-2021 07:52 | Tomas Urban | Assigned To | Tomas Urban => Jacob Wieland - Spirent
10-11-2021 07:55 | Tomas Urban | Note Added: 0016048 |
10-11-2021 14:57 | Jacob Wieland - Spirent | Note Added: 0016056 |
10-11-2021 14:58 | Jacob Wieland - Spirent | Note Edited: 0016056 | bug_revision_view_page.php?bugnote_id=16056#r568
10-11-2021 14:58 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Tomas Urban
11-11-2021 12:47 | Tomas Urban | File Added: CR8006-4.docx |
11-11-2021 12:52 | Tomas Urban | Note Added: 0016063 |
11-11-2021 12:52 | Tomas Urban | Status | assigned => confirmed
11-11-2021 12:52 | Tomas Urban | Assigned To | Tomas Urban => Jacob Wieland - Spirent
11-11-2021 15:00 | Jacob Wieland - Spirent | File Added: CR8006-5.docx |
11-11-2021 15:00 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Tomas Urban
11-11-2021 15:00 | Jacob Wieland - Spirent | Status | confirmed => assigned
11-11-2021 15:02 | Jacob Wieland - Spirent | Note Added: 0016067 |
12-11-2021 10:39 | Tomas Urban | File Added: CR8006-6.docx |
12-11-2021 10:40 | Tomas Urban | Note Added: 0016073 |
12-11-2021 10:40 | Tomas Urban | Assigned To | Tomas Urban => Jacob Wieland - Spirent
12-11-2021 10:40 | Tomas Urban | Status | assigned => confirmed
12-11-2021 15:38 | Jacob Wieland - Spirent | Status | confirmed => resolved
12-11-2021 15:38 | Jacob Wieland - Spirent | Fixed in Version | => 4.13.1 (ongoing)
12-11-2021 15:38 | Jacob Wieland - Spirent | Resolution | open => fixed
12-11-2021 15:38 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Jens Grabowski
23-11-2021 14:57 | Jens Grabowski | Note Added: 0016097 |
23-11-2021 14:57 | Jens Grabowski | Status | resolved => closed

Notes

(0015928)
sekaw
27-04-2021 12:57

I appreciate this proposal !!

(0015936)
Jens Grabowski
06-09-2021 10:09

STF discussion: Restriction should be removed.

(0015947)
Jens Grabowski
07-09-2021 14:38

Clause 15.6.1 deleted.

(0015948)
Jens Grabowski
07-09-2021 14:41

Tomas you can confirm that deleting is sufficient for resolving this CR.

(0015962)
Tomas Urban
09-09-2021 09:26

I was not happy with just removing the rules as it gave no guidance what to do when the template contains something different than a specific value. So I changed the section in a similar way how the substr function works.
But it would cernainly be possible to do more than that, e.g. index applied to AnyValue could yield '?'B or pattern "?". We could also return a template instead of a value (e.g. var hexstring v_hex := 'AB?CD'H; return v_hex[2]; would return '?'H), various metacharacters matching a single value (such as \s, \n etc.) could count as a single item allowing us to return a pattern.
Please let me know if the proposed changes are sufficient or we need something more elaborate.

(0015964)
Jacob Wieland - Spirent
09-09-2021 10:58

I like the idea of being able to deconstruct string patterns element-wise. Maybe it would be less restrictive if the result of accessing a pattern element would also yield a pattern and that all concatenable matching elements are seen as a single element:
- meta characters count as a single element and are mapped to their character.
- AnyValue and AnyValueOrNone count as a single element
- character groups ([a-z]) count as a single elemnet and are mapped to a pattern containing them
- repeated elements (X#(a,b)) count as a single element
- disjunction elements (X|Y) count as a single element
- reference elements ({<name>}) count as a single element

(0015965)
Jacob Wieland - Spirent
09-09-2021 11:09

It would also be nice to have a function which converts a pattern into its string representation (unpattern operator, so to speak),i.e. (unpattern pattern X) == X

(0015974)
Tomas Urban
10-09-2021 08:44

I think we should discuss the details first. This kind of a change would probably require a change of the rules for the substr function (and maybe the replace function) so that they would use the same set of rules.
My proposal should be changed anyway as I realized that the rules are written just for the RHS of an assignment (without actually saying that!) and we would need guidance for the LHS as well.
As regards the "unpattern" operation, I generally agree that is would be a useful feature. I think we could overload the valuof operation, in which case we wouldn't need any changes on the syntax level and new keywords. But we should create a separate CR for that.

(0015980)
Jens Grabowski
10-09-2021 14:24

STF discussion: Proposal to be prepared.

(0015981)
Jens Grabowski
10-09-2021 14:25

STF discussion: New CR for value conversion required.

(0015982)
Jens Grabowski
10-09-2021 14:27

STF discussion: Index operator on string pattern should reference pattern elements and not on string elements.

(0016048)
Tomas Urban
10-11-2021 07:55

I uploaded a modified proposal that includes indexing of metacharacters and matching symbols inside templates for binary strings. The proposal doesn't include any substr and replace function modifications and examples as I think we should first agree if the proposed changes are suitable. Please check.

(0016056)
Jacob Wieland - Spirent
10-11-2021 14:57 (edited on: 10-11-2021 14:58)

1) right-hand-side rule b is just a special case of c (the number of added ? is 0)
2) Why is appending a specific character to a value-template not allowed? (in the proposal, it would have to be changed into a pattern first before appending acc. to rule e))
3) Again, rule g) is just a special case of rule h)
4) Rule m) should be reformulated to an If ... construction like the other rules.
5) Why not treat AnyValueOrNone like AnyValue ifpresent? i.e. the result will be an ifpresent template where the AnyValue has been replaced with the appropriate string?
6) In the EXAMPLE, the result for the character group shall be pattern "[a-z]"
7) IN the table in the indexing column, the 3 cases of Without the preceding expression need to be changed to Including the preceding expression (as #n, #() and + constructions on their own do not constitute a proper pattern element without the expression they are applied to)
8) In rule e) the to-pattern conversion should add escape backslashes for all special characters contained in the value before adding the pattern keyword.
There also are some typos: 3 times ispresent instead of ifpresent

(0016063)
Tomas Urban
11-11-2021 12:52

I made corrections according to Jacob's feedback and changed several predefined functions to use similar rules for string templates as indexing does. Please check. I haven't added any examples yet, so please feel free to do so. But if you don't find any time for it I can add them once the rule changes are accepted.

(0016067)
Jacob Wieland - Spirent
11-11-2021 15:02

I have made some corrections to the text. Please review and then add the examples.

(0016073)
Tomas Urban
12-11-2021 10:40

Examples added. Please check.

(0016097)
Jens Grabowski
23-11-2021 14:57

implemented