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

ID | Project | Category | View Status | Date Submitted | Last Update
0005601 | Part 01: TTCN-3 Core Language | Clarification | public | 12-07-2010 12:17 | 15-12-2010 00:07

Reporter | Gyorgy Rethy |
Assigned To | Ina Schieferdecker |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version |  |
Target Version | v4.3.1 (published 2011-06) | Fixed in Version | v4.3.1 (published 2011-06) |
Clause Reference(s) | 15.7.4
Source (company - Author) | L.M.Ericsson

Summary | 0005601: Erroneous example on matching attributes

Description

The example in $15.7.4:
type record R {
record of integer ri optional
}
template R r:=
{
ri := * length (1 .. 6) ifpresent // any value containing 1, 2, 3, 4,
// 5 or 6 provided it is present
}
is not correct:
- according to the BNF length and ifpresent cannot be applied together;
- not the numbers 1..6 but lists of 1..6 elements are allowed;
The example should be changed to:
template R r:=
{
ri := { * length (1 .. 6) } ifpresent // any value containing 1, 2, 3, 4, 5 or 6 elements, provided it is present
}

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files |

Issue History
Date Modified | Username | Field | Change
12-07-2010 12:17 | Gyorgy Rethy | New Issue |
12-07-2010 12:17 | Gyorgy Rethy | Clause Reference(s) | => 15.7.4
12-07-2010 12:17 | Gyorgy Rethy | Source (company - Author) | => L.M.Ericsson
12-07-2010 16:32 | Gyorgy Rethy | Project | TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
12-07-2010 16:33 | Gyorgy Rethy | Target Version | => Edition 4.3.1 (not yet published)
30-08-2010 11:51 | Gyorgy Rethy | Status | new => assigned
30-08-2010 11:51 | Gyorgy Rethy | Assigned To | => Benjamin Zeiss
31-08-2010 11:41 | Benjamin Zeiss | Note Added: 0009662 |
01-09-2010 10:56 | Benjamin Zeiss | Assigned To | Benjamin Zeiss => Jacob Wieland - Spirent
01-09-2010 11:22 | Jacob Wieland - Spirent | Note Added: 0009672 |
01-09-2010 17:07 | Benjamin Zeiss | Note Added: 0009683 |
01-09-2010 17:08 | Benjamin Zeiss | Status | assigned => resolved
01-09-2010 17:08 | Benjamin Zeiss | Resolution | open => fixed
01-09-2010 17:09 | Benjamin Zeiss | Assigned To | Jacob Wieland - Spirent => Ina Schieferdecker
01-09-2010 17:09 | Benjamin Zeiss | Status | resolved => feedback
01-09-2010 17:09 | Benjamin Zeiss | Resolution | fixed => reopened
01-09-2010 17:10 | Benjamin Zeiss | Status | feedback => resolved
01-09-2010 17:10 | Benjamin Zeiss | Resolution | reopened => fixed
14-12-2010 14:29 | Ina Schieferdecker | Note Added: 0009964 |
14-12-2010 14:46 | Ina Schieferdecker | Note Added: 0009965 |
14-12-2010 14:47 | Ina Schieferdecker | Note Deleted: 0009965 |
14-12-2010 14:48 | Ina Schieferdecker | Note Deleted: 0009964 |
15-12-2010 00:06 | Ina Schieferdecker | Note Edited: 0009672 |
15-12-2010 00:07 | Ina Schieferdecker | Note Added: 0009975 |
15-12-2010 00:07 | Ina Schieferdecker | Status | resolved => closed
15-12-2010 00:07 | Ina Schieferdecker | Fixed in Version | => Edition 4.3.1 (not yet published)

Notes

(0009662)
Benjamin Zeiss
31-08-2010 11:41

Actually, I don't see why this example should be erroneous. Taking the 4.2.2 EBNF as reference, the template definition is derived from rule 93. TemplateDef. If we take
template R r:=
{
ri := * length (1 .. 6) ifpresent // any value containing 1, 2, 3, 4,
// 5 or 6 provided it is present
}
it can be derived as follows (skipping a few unimportant steps):
TemplateDef ->
TemplateKeyword BaseTemplate AssignmentChar TemplateBody
Let's concentrate on the TemplateBody.
TemplateBody ->
FieldSpecList ->
"{" FieldSpec "}" ->
"{" FieldReference AssignmentChar TemplateBody "}"
Let's concentrate on the right TemplateBody as FieldReference AssignmentChar will derive to "ri := " - I think we can agree on that.
TemplateBody ->
SimpleSpec ExtraMatchingAttributes ->
SingleValueOrAttrib ExtraMatchingAttributes ->
MatchingSymbol ExtraMatchingAttributes ->
AnyOrOmit ExtraMatchingAttributes ->
"*" ExtraMatchingAttributes ->
"*" (LengthMatch IfPresentMatch) ->
"*" StringLength "ifpresent" ->
"*" "length" "(" SingleConstExpression [".." UpperBound] ")" "ifpresent"
-> ...
I think now it should be clear that the sentence is derivable if I did not make any bad mistake. Just in case, I have tested the syntactical snippet in the TRex parser and it accepts it as well.
To summarize: length and ifpresent can be applied together, because the third alternative in rule
117. ExtraMatchingAttributes ::= LengthMatch | IfPresentMatch | (LengthMatch IfPresentMatch)
allows it in exactly the notation specified in the example.
If the person reviewing this does not find a mistake here, I suggest to close as resolved.

(0009672)
Jacob Wieland - Spirent
01-09-2010 11:22 (edited on: 15-12-2010 00:06)

You are correct, the BNF allows this. But, the example still should be changed as the comment does not match the code: // any value containing 1, 2, 3, 4, // 5 or 6 provided it is present should be changed to // any value containing 1, 2, 3, 4, // 5 or 6 elements, provided it is present

(0009683)
Benjamin Zeiss
01-09-2010 17:07

I agree. Changing to resolved and assigning to Ina.

(0009975)
Ina Schieferdecker
15-12-2010 00:07

Comment changed as proposed