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

TOPIC: order of language elements inside component type definitions

order of language elements inside component type definitions 25 May 2011 15:06 #7746

Dear list members,
it seems to be nowhere specified how the order of definitions/declarations
must be inside component type definitions.
In clause 5.3 of ETSI ES 201 873-1 V4.2.1 (2010-07) one can find only following
text:

Declarations in the module definitions part may be made in any order.
However inside the module control part, test case definitions, functions,
altsteps, and statement blocks, all required declarations must be given
beforehand. This means in particular, local variables, local timers, and local
constants shall never be used before they are declared. The only exception to
this rule are labels. Forward references to a label may be used in goto
statements before the label occurs (see clause 19.8).


In my opinion the text should be altered into:
However inside the module control part, test case definitions, functions,
altsteps, statement blocks and component type definitions, all required
declarations must be given beforehand.


//Such that
type component C1 {
const integer myConst := 12;
var integer myInt1 := myInt2; // -> error
var integer myInt2 := myConst; // -> ok }


What is your opinion about this?

BR.,

Uwe Truetsch
The administrator has disabled public write access.

order of language elements inside component type definitions 26 May 2011 07:42 #7747

Hello Jacob,
you are right, as only initial values are allowed there is only a constant
relationship in between the variables and constants declared/defined in the
component type body.
Nevertheless it could be stated in the spec:
" Declarations in the module definitions part and in the component type
definition may be made in any order.

BR.,
Uwe

ext Jacob Wieland wrote:
> In my opinion, it should not be disallowed for component types because
>
> a) it does no harm in them - there is no textual evaluation order
> implied inside component types.
> The only restriction is that they shall not reference each other
> cycicly - same as in the module definitions part.
> b) backward compatibility for those tools that only introduced the
> restriction where it was explicitly stated.
>
> BR, Jacob Wieland, Testing Technologies
>
Last Edit: 06 Aug 2013 13:23 by Dirk Tepelmann. Reason: original text in reply
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin