ETSI's Bug Tracker - Part 06: TTCN-3 Control Interface
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0002589 | Part 06: TTCN-3 Control Interface | Clarification | public | 07-12-2007 10:09 | 12-12-2008 13:08

Reporter | Thomas DeiÃŸ |
Assigned To | Ina Schieferdecker |
Priority | normal | Severity | major | Reproducibility | N/A
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | v3.2.1 (published 2007-02) |
Target Version | v4.1.1 (published 2009-06) | Fixed in Version | v4.1.1 (published 2009-06) |
Clause Reference(s) | 6.2.7
Source (company - Author) |

Summary | 0002589: Arrays as types

Description

There is a contradiction:
Clause 6.2.7 states: In common with many programming languages, arrays are not considered to be types in TTCNâ€‘3. Instead, they may be specified at the point of a variable declaration.
But the BNF states
48. SubTypeDef ::= Type (SubTypeIdentifier | AddressKeyword) [ArrayDef] [SubTypeSpec]
It is unclear whether the
module m {
type integer I[2];
}
is correct or not.
This has been discussed within STF 337 and it is proposed to consider arrays as types and that this should be introduced as shorthand notation for record of.

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

Attached Files

CR_2589_Arrays_as_types_solution_part1_01.doc (1,803,264) 25-04-2008 12:54
http://oldforge.etsi.org/mantis/file_download.php?file_id=1458&type=bug
CR_2589_Arrays_as_types_solution_part6_01.doc (136,192) 25-04-2008 12:55
http://oldforge.etsi.org/mantis/file_download.php?file_id=1459&type=bug
record_of_with_offset.pdf (141,217) 25-04-2008 12:55
http://oldforge.etsi.org/mantis/file_download.php?file_id=1460&type=bug
CR_2589_Arrays_as_types_solution_part1_02.doc (1,805,824) 15-08-2008 10:46
http://oldforge.etsi.org/mantis/file_download.php?file_id=1609&type=bug
CR_2589_Arrays_as_types_solution_part6_02.doc (250,880) 25-11-2008 09:59
http://oldforge.etsi.org/mantis/file_download.php?file_id=1767&type=bug
CR_2589_Arrays_as_types_solution_part6_03.doc (389,632) 25-11-2008 10:17
http://oldforge.etsi.org/mantis/file_download.php?file_id=1769&type=bug
CR_2589_Arrays_as_types_solution_part1_03.doc (1,809,408) 10-12-2008 15:41
http://oldforge.etsi.org/mantis/file_download.php?file_id=1883&type=bug

Issue History
Date Modified | Username | Field | Change
07-12-2007 10:09 | Thomas DeiÃŸ | New Issue |
07-12-2007 10:09 | Thomas DeiÃŸ | Status | new => assigned
07-12-2007 10:09 | Thomas DeiÃŸ | Assigned To | => Ina Schieferdecker
07-12-2007 10:09 | Thomas DeiÃŸ | Clause Reference(s) | => 6.2.7
07-12-2007 10:09 | Thomas DeiÃŸ | Source (company - Author) | =>
07-12-2007 10:10 | Thomas DeiÃŸ | Assigned To | Ina Schieferdecker => Thomas DeiÃŸ
07-12-2007 10:10 | Thomas DeiÃŸ | Target Version | => Edition 4.1.1 (not yet published)
25-04-2008 12:54 | Thomas DeiÃŸ | File Added: CR_2589_Arrays_as_types_solution_part1_01.doc |
25-04-2008 12:55 | Thomas DeiÃŸ | File Added: CR_2589_Arrays_as_types_solution_part6_01.doc |
25-04-2008 12:55 | Thomas DeiÃŸ | File Added: record_of_with_offset.pdf |
25-04-2008 12:57 | Thomas DeiÃŸ | Note Added: 0005577 |
25-04-2008 12:57 | Thomas DeiÃŸ | Assigned To | Thomas DeiÃŸ => Gyorgy Rethy
15-08-2008 10:46 | Gyorgy Rethy | File Added: CR_2589_Arrays_as_types_solution_part1_02.doc |
15-08-2008 10:46 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Thomas DeiÃŸ
15-08-2008 10:47 | Gyorgy Rethy | Note Added: 0006541 |
29-09-2008 06:48 | Thomas DeiÃŸ | Note Added: 0006919 |
25-11-2008 09:59 | Thomas DeiÃŸ | File Added: CR_2589_Arrays_as_types_solution_part6_02.doc |
25-11-2008 10:00 | Thomas DeiÃŸ | Note Added: 0007399 |
25-11-2008 10:00 | Thomas DeiÃŸ | Assigned To | Thomas DeiÃŸ => Ina Schieferdecker
25-11-2008 10:17 | Thomas DeiÃŸ | File Added: CR_2589_Arrays_as_types_solution_part6_03.doc |
25-11-2008 10:18 | Thomas DeiÃŸ | Note Added: 0007401 |
10-12-2008 15:30 | Ina Schieferdecker | Note Added: 0007641 |
10-12-2008 15:31 | Ina Schieferdecker | Resolution | open => fixed
10-12-2008 15:31 | Ina Schieferdecker | Fixed in Version | => Edition 4.1.1 (not yet published)
10-12-2008 15:36 | Ina Schieferdecker | Note Edited: 0007641 |
10-12-2008 15:41 | Ina Schieferdecker | File Added: CR_2589_Arrays_as_types_solution_part1_03.doc |
10-12-2008 15:41 | Ina Schieferdecker | Assigned To | Ina Schieferdecker => Thomas DeiÃŸ
11-12-2008 10:37 | Thomas DeiÃŸ | Note Added: 0007649 |
11-12-2008 10:37 | Thomas DeiÃŸ | Assigned To | Thomas DeiÃŸ => Ina Schieferdecker
12-12-2008 07:42 | Ina Schieferdecker | Note Added: 0007664 |
12-12-2008 07:43 | Ina Schieferdecker | Status | assigned => resolved
12-12-2008 07:43 | Ina Schieferdecker | Note Added: 0007665 |
12-12-2008 07:43 | Ina Schieferdecker | Project | Part 01: TTCN-3 Core Language => Part 06: TTCN-3 Control Interface
12-12-2008 13:08 | Ina Schieferdecker | Note Added: 0007682 |
12-12-2008 13:08 | Ina Schieferdecker | Status | resolved => closed

Notes

(0005577)
Thomas DeiÃŸ
25-04-2008 12:57

initial proposal, to be crosschecked. Some arguments _not_ to introduce offset notation for record of/set of. Part 6: Just state that an array is of type class RECORD_OF

(0006541)
Gyorgy Rethy
15-08-2008 10:47

Checked, there are some changes/comments to be cross-checked

(0006919)
Thomas DeiÃŸ
29-09-2008 06:48

Gyorgy's comments are fine for me.
Following comment regarding part 6 received from TestingTech (Valentin):
"Regarding the TCI, we think that the difference mentioned before should be visible also at this level, i.e. we would prefer to introduce a different type class for arrays. In addition, the interface RecordOfValue should provide a
getOffset() method to access the offset in case of arrays. In case the value is a record of/set of, the method must return 0. Such a method is necessary for example for a logging implementation which wants to log arrays together with their indexes like they exist in TTCN-3. The two methods
getField()/setField() may use for all 3 type classes indexes (RECORD_OF, SET_OF and ARRAY) from 0 to length-1, as proposed."

(0007399)
Thomas DeiÃŸ
25-11-2008 10:00

part 6 updated according to feedback by TestingTechnologies: separate type class for arrays introduced, operator getOffset for recordof, setof, array introduced. v02 uploaded.

(0007401)
Thomas DeiÃŸ
25-11-2008 10:18

new operation and new type class added to language mappings in part6. Needs to be done also for C++ language mapping. uploaded v03

(0007641)
Ina Schieferdecker
10-12-2008 15:30 (edited on: 10-12-2008 15:36)

Corrected example in 6.2.7:
"type record length (3) of integer MyRecordOfType1"
etc.
Extending the example with some compatibility hints:
" type integer MyArrayType1[3]; // A type with 3 integer elements
type record length (3) of integer MyRecordOfType1; // The corresponding record of
var MyArrayType1 a1;
var MyRecordOfType1 r1:= a1; // MyArrayType1 and MyRecordOfType1 are compatible
var integer myArray1[3]:= r1; // Instantiates an integer array of 3 elements
// with the index 0 to 2
// being compatible to MyArrayType1 and MyRecordOfType1
"
Array type definition not needed as already included in SubTypeDef rule.
Please check

(0007649)
Thomas DeiÃŸ
11-12-2008 10:37

Regarding the example: I suggest to add an initial value to the variable in the example. var MyArrayType1 a1 := { 7, 8, 9 }; In the next line after the variable declaration, the variable a1 is used on the right hand side. This might raise questions if a1 is not initialized. Regarding the grammar: Without the specific rule there will be no nested array definitions. But this would be fine for me.

(0007664)
Ina Schieferdecker
12-12-2008 07:42

Also nested arrays are possible like in type record NR{ integer f1[3], record {boolean b1, boolean b2} f2[5], enumerated {red,blue} f3[10] } See 23. StructFieldDef ::= (Type | NestedTypeDef) StructFieldIdentifier [ArrayDef] [SubTypeSpec] [OptionalKeyword] Hence, we do not need an additional definition for arrays.

(0007665)
Ina Schieferdecker
12-12-2008 07:43

Resolved in part 1, to be resolved also in part 6

(0007682)
Ina Schieferdecker
12-12-2008 13:08

One correction for part 6: the Java mapping for the offset is public int getOffset() ; Added also the definition for the C++ mapping virtual Tindex getOffset() const =0; And array constant for type class TciTypeClass TCI_ARRAY Type safe enumerated TCI_ARRAY