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

ID | Project | Category | View Status | Date Submitted | Last Update
0005084 | Part 01: TTCN-3 Core Language | Clarification | public | 16-04-2009 14:12 | 15-07-2009 14:29

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.2.1 (published 2010-07) | Fixed in Version | v4.2.1 (published 2010-07) |
Clause Reference(s) | 5.2, D.4
Source (company - Author) |

Summary | 0005084: Use of the __SCOPE__ macro

Description

As currently defined, the __SCOPE__ TTCN-3 macro shall return the identifyer of the named scope unit it is used in. However, it raises the problem of using the macro in global templates. Global parameterized templates behave like scope units as formal parameter names are local names obeying to scoping rules. But parameterized templates are not defined as scope units today.
As a consequence it is not possible to get the template name with the __SCOPE__ macro. See the example below:
template myType t_MyTemplate (charstring p_char := __SCOPE__) { f1 := p_char,...}
The module name can be obtained by using __MODULE__, therefore it would be practical if __SCOPE__ returned the name of the template and not the module name.
Proposal: define (at least parameterized) templates as scope units and add templates to $D.4 as
"...basic scope units of TTCN-3 are module definitions part, module control part, component types, functions, altsteps, test cases, statement blocks and templates. ...
(g) a template name, if the lowest named scope is a template definition."

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

Relationships

related to | 0005268 | closed | Ina Schieferdecker | Definition prepocessing macro: __DEFINITION__

Attached Files

CR5084_SCOPE_macro.doc (26,624) 22-04-2009 16:06
http://oldforge.etsi.org/mantis/file_download.php?file_id=2112&type=bug
CR5084_SCOPE_macro_v2.doc (247,296) 03-07-2009 15:07
http://oldforge.etsi.org/mantis/file_download.php?file_id=2162&type=bug
CR5084_SCOPE_macro_v3.doc (260,096) 06-07-2009 12:49
http://oldforge.etsi.org/mantis/file_download.php?file_id=2168&type=bug
CR5084_SCOPE_macro_Figure.ppt (43,520) 08-07-2009 10:00
http://oldforge.etsi.org/mantis/file_download.php?file_id=2182&type=bug
scope.ttcn3 (1,359) 08-07-2009 17:20
http://oldforge.etsi.org/mantis/file_download.php?file_id=2194&type=bug
def.ttcn3 (1,371) 08-07-2009 17:21
http://oldforge.etsi.org/mantis/file_download.php?file_id=2195&type=bug
scope_v2.ttcn3 (1,848) 10-07-2009 12:30
http://oldforge.etsi.org/mantis/file_download.php?file_id=2208&type=bug
CR5084_SCOPE_macro_v4.doc (295,936) 10-07-2009 12:36
http://oldforge.etsi.org/mantis/file_download.php?file_id=2209&type=bug
CR5084_SCOPE_macro_Figure_v2.ppt (31,232) 10-07-2009 12:36
http://oldforge.etsi.org/mantis/file_download.php?file_id=2210&type=bug
CR5084_SCOPE_macro_v5.doc (298,496) 10-07-2009 14:44
http://oldforge.etsi.org/mantis/file_download.php?file_id=2212&type=bug

Issue History
Date Modified | Username | Field | Change
16-04-2009 14:12 | Gyorgy Rethy | New Issue |
16-04-2009 14:12 | Gyorgy Rethy | Clause Reference(s) | => 5.2, D.4
16-04-2009 14:12 | Gyorgy Rethy | Source (company - Author) | =>
20-04-2009 11:29 | Ina Schieferdecker | Note Added: 0008511 |
20-04-2009 11:30 | Ina Schieferdecker | Project | TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
20-04-2009 11:30 | Ina Schieferdecker | Assigned To | => Tibor CsÃ¶ndes
20-04-2009 11:30 | Ina Schieferdecker | Status | new => assigned
20-04-2009 11:30 | Ina Schieferdecker | Category | TTCN-3 Core Language => Clarification
20-04-2009 11:30 | Ina Schieferdecker | Target Version | => Edition 4.2.1 (not yet published)
22-04-2009 16:06 | Tibor CsÃ¶ndes | File Added: CR5084_SCOPE_macro.doc |
22-04-2009 16:09 | Tibor CsÃ¶ndes | Note Added: 0008543 |
03-07-2009 15:07 | Tibor CsÃ¶ndes | File Added: CR5084_SCOPE_macro_v2.doc |
03-07-2009 15:10 | Tibor CsÃ¶ndes | Note Added: 0008833 |
03-07-2009 15:10 | Tibor CsÃ¶ndes | Assigned To | Tibor CsÃ¶ndes => Gyorgy Rethy
06-07-2009 12:49 | Gyorgy Rethy | Note Added: 0008841 |
06-07-2009 12:49 | Gyorgy Rethy | File Added: CR5084_SCOPE_macro_v3.doc |
06-07-2009 12:49 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Tibor CsÃ¶ndes
08-07-2009 09:59 | Tibor CsÃ¶ndes | Note Added: 0008858 |
08-07-2009 10:00 | Tibor CsÃ¶ndes | File Added: CR5084_SCOPE_macro_Figure.ppt |
08-07-2009 13:20 | Tibor CsÃ¶ndes | File Added: CR5084_SCOPE.ttcn |
08-07-2009 13:22 | Tibor CsÃ¶ndes | Note Added: 0008868 |
08-07-2009 15:08 | Ina Schieferdecker | Note Added: 0008874 |
08-07-2009 15:08 | Ina Schieferdecker | File Added: CR5084_scope.ttcn3 |
08-07-2009 16:46 | Ina Schieferdecker | File Deleted: CR5084_scope.ttcn3 |
08-07-2009 16:48 | Ina Schieferdecker | File Added: scope.ttcn3 |
08-07-2009 17:02 | Tibor CsÃ¶ndes | Relationship added | related to 0005268
08-07-2009 17:13 | Ina Schieferdecker | File Deleted: scope.ttcn3 |
08-07-2009 17:20 | Tibor CsÃ¶ndes | File Deleted: CR5084_SCOPE.ttcn |
08-07-2009 17:20 | Tibor CsÃ¶ndes | File Added: scope.ttcn3 |
08-07-2009 17:21 | Tibor CsÃ¶ndes | File Added: def.ttcn3 |
08-07-2009 17:21 | Tibor CsÃ¶ndes | Note Added: 0008877 |
09-07-2009 09:33 | Ina Schieferdecker | Note Deleted: 0008868 |
09-07-2009 09:33 | Ina Schieferdecker | Note Deleted: 0008874 |
10-07-2009 12:30 | Tibor CsÃ¶ndes | Note Added: 0008888 |
10-07-2009 12:30 | Tibor CsÃ¶ndes | File Added: scope_v2.ttcn3 |
10-07-2009 12:35 | Tibor CsÃ¶ndes | Note Edited: 0008888 |
10-07-2009 12:36 | Tibor CsÃ¶ndes | File Added: CR5084_SCOPE_macro_v4.doc |
10-07-2009 12:36 | Tibor CsÃ¶ndes | File Added: CR5084_SCOPE_macro_Figure_v2.ppt |
10-07-2009 12:39 | Tibor CsÃ¶ndes | Assigned To | Tibor CsÃ¶ndes => Gyorgy Rethy
10-07-2009 14:08 | Gyorgy Rethy | Note Added: 0008890 |
10-07-2009 14:09 | Gyorgy Rethy | File Added: CR5084_SCOPE_macro_v5.doc |
10-07-2009 14:09 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Tibor CsÃ¶ndes
10-07-2009 14:09 | Gyorgy Rethy | Resolution | open => fixed
10-07-2009 14:44 | Gyorgy Rethy | File Deleted: CR5084_SCOPE_macro_v5.doc |
10-07-2009 14:44 | Gyorgy Rethy | File Added: CR5084_SCOPE_macro_v5.doc |
10-07-2009 14:46 | Tibor CsÃ¶ndes | Note Added: 0008891 |
10-07-2009 14:46 | Tibor CsÃ¶ndes | Assigned To | Tibor CsÃ¶ndes => Ina Schieferdecker
10-07-2009 14:46 | Tibor CsÃ¶ndes | Status | assigned => resolved
15-07-2009 14:29 | Ina Schieferdecker | Status | resolved => closed
15-07-2009 14:29 | Ina Schieferdecker | Fixed in Version | => Edition 4.2.1 (not yet published)

Notes

(0008511)
Ina Schieferdecker
20-04-2009 11:29

One could also think about types as scope units. All potential scope units need to be checked.

(0008543)
Tibor CsÃ¶ndes
22-04-2009 16:09

Changes uploaded based on the proposal. Correct, standalone example: template charstring t_MyTemplate (charstring p_char := __SCOPE__) := p_char;

(0008833)
Tibor CsÃ¶ndes
03-07-2009 15:10

Version 2 uploaded. Templates and structured types included as a new scope unit. Figure, "Hierarchy of scope units" redraw, examples included into __SCOPE__ macro section.

(0008841)
Gyorgy Rethy
06-07-2009 12:49

I'm at figure 1. Thinking about what to draw below Templates and Types. Template fields may be of structured typed as well but are they scope units? For conssitency they should be (though at this moment I cannot see a practical consequence, except more clarity).
A structured type can be defined embedded within other structured types, this shall be drawn on the figure (just an embedded structured type below structured type, embedded structured type below embedded structured type, dashed line.
Textual description of templates and types as scope units is missing from above the figure.
See the rest in CR5084_SCOPE_macro_v3.doc.
I noticed that the figure cannot be edited if embedded this way. This may be a pro or a cons. If we find a good place to store it for next editions, it is a pro. If not, they should be embedded as Powerpoint objects.

(0008858)
Tibor CsÃ¶ndes
08-07-2009 09:59

It is possible to edit the figure because this is an embedded .ppt object: right click on the object -> Presentation Object -> Edit. In addition I have uploaded the original PowerPoint slide.

(0008877)
Tibor CsÃ¶ndes
08-07-2009 17:21

Uploaded scope.ttcn3 and def.ttcn3 are working examples for __SCOPE__ and __DEF__ macro.

(0008888)
Tibor CsÃ¶ndes
10-07-2009 12:30 (edited on: 10-07-2009 12:35)

After our discussion the decision is the following:
- do not introduce __DEF__ macro only __SCOPE__
- we will use unqualified names (only "control" and not "modulename.control")
- new scope units: templates and user-defined types, i.e. basic types like integer, charstring are not scope units, but type restrictions of a basic type shall be a scope unit.
Based on our discussion new examples (scope_v2.ttcn3) created and uploaded.
New version (CR5084_SCOPE_macro_v4.doc) also uploaded.

(0008890)
Gyorgy Rethy
10-07-2009 14:08

CR5084_SCOPE_macro_v5.doc: Note 2 of D.4 deleted, Example 2 is extended to show also a default value of a formal parameter, plus a few editorials. Otherwise OK with me.

(0008891)
Tibor CsÃ¶ndes
10-07-2009 14:46

It's OK with me!