Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: scope rule of ENUMERATION

scope rule of ENUMERATION 27 Sep 2004 09:13 #6765

Hi all,
Rule 6.3.4 said:enumeration identifier shall not be used for identifiers
of local or global visibility at the same or a lower level of the same branch of
the scope hierarchy.

But, what's the lower level of an enumeration identifier?

e.g.

type enumerated enum{
e1
}

function f(){
var integer e1; //ILLEGAL??
}

thanks!







Best Regards
Xiangdong Ji
Huawei Co. Ltd
The administrator has disabled public write access.

scope rule of ENUMERATION 27 Sep 2004 10:19 #6766

If supposing that the two definitions are in the same module than yes, illegal.

The whole sentence is: "Enumeration identifiers shall only be reused within
other structured type definitions and shall not be used for identifiers of local
or global visibility at the same or a lower level of the same branch of the
scope hierarchy (see scope hierarchy in clause 5.4.0)." (btw. the correct
reference is 5.3.0)

The scope for the enumeration type is a module definitions part, so an
enumeration name shall not be used as name of other types, var, const, timer
name in component types, local var, const. timers in testcases, functions,
altsteps or the control part etc. IN THE SAME MODULE. But may be re-used in
another module.

If looking at figure 2 a lower level of hierarchy e.g. a "block of statements".

Gyorgy

>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.]On Behalf Of jixiangdong
> Sent: Monday, September 27, 2004 11:13 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: scope rule of ENUMERATION
>
>
> Hi all,
> Rule 6.3.4 said:enumeration identifier shall not be
> used for identifiers of local or global visibility at the
> same or a lower level of the same branch of the scope hierarchy.
>
> But, what's the lower level of an enumeration identifier?
>
> e.g.
>
> type enumerated enum{
> e1
> }
>
> function f(){
> var integer e1; //ILLEGAL??
> }
>
> thanks!
>
>
>
>
>
>
>
> Best Regards
> Xiangdong Ji
> Huawei Co. Ltd
>
The administrator has disabled public write access.

scope rule of ENUMERATION 28 Sep 2004 02:17 #6769

Thanks Gyorgy!

Is there the same restrictions on structured type's fields, that is ,the name of
record/set/union fields
can only be reused within other structured type.


======= 2004-09-27 12:19:00=======
> Gyorgy wrote:

>If supposing that the two definitions are in the same module than yes, illegal.
>
>The whole sentence is: "Enumeration identifiers shall only be reused within
other structured type definitions and shall not be used for identifiers of local
or global visibility at the same or a lower level of the same branch of the
scope hierarchy (see scope hierarchy in clause 5.4.0)." (btw. the correct
reference is 5.3.0)
>
>The scope for the enumeration type is a module definitions part, so an
enumeration name shall not be used as name of other types, var, const, timer
name in component types, local var, const. timers in testcases, functions,
altsteps or the control part etc. IN THE SAME MODULE. But may be re-used in
another module.
>
>If looking at figure 2 a lower level of hierarchy e.g. a "block of statements".
>
>Gyorgy
>
>>
Original Message
>> From: active_ttcn3 : mts stf133 ttcn version 3 - active
>> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.]On Behalf Of jixiangdong
>> Sent: Monday, September 27, 2004 11:13 AM
>> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
>> Subject: scope rule of ENUMERATION
>>
>>
>> Hi all,
>> Rule 6.3.4 said:enumeration identifier shall not be
>> used for identifiers of local or global visibility at the
>> same or a lower level of the same branch of the scope hierarchy.
>>
>> But, what's the lower level of an enumeration identifier?
>>
>> e.g.
>>
>> type enumerated enum{
>> e1
>> }
>>
>> function f(){
>> var integer e1; //ILLEGAL??
>> }
>>
>> thanks!
>>
>>
>>
>>
>>
>>
>>
>> Best Regards
>> Xiangdong Ji
>> Huawei Co. Ltd
>>

= = = = = = = = = = = = = = = = = = = =

Best Regards
Xiangdong Ji
Huawei Co. Ltd
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin