Ramaswamy wrote:
I have been going thru the ITU-T doc on parameterization and the following seemed unclear to me. It is stated that in a ParameterList the DummyReference may stand for a "Type" or "DefinedObjectClass". But since DefinedObjectClass also includes UsefulObjectClassReference (TYPE-IDENTIFIER and ABSTRACT-SYNTAX), does this imply that occurrences of these in the scope of the parameterized entity must be replaced by the actual parameter? Please provide more clarity on this. Bye.
It would help if you could post an example of what you mean, but I'll have a stab at it.
TYPE-IDENTIFIER is just a reference to a pre-defined class:
TYPE-IDENTIFIER ::= CLASS {
&id OBJECT IDENTIFIER UNIQUE,
&Type
}
WITH SYNTAX {&Type IDENTIFIED BY &id}(X.681 (2002), Annex A, Sec. A.2)
This reference is available within a module without the need to import it (that is, it has pervasive scope), but is still subject to the normal scoping rules. If you redefine the name locally, then the pervasive defininition is lost.
For example:
-- redefine pervasive type TYPE-IDENTIFIER TYPE-IDENTIFIER ::= INTEGER
-- will use local definition here v TYPE-IDENTIFIER ::= 1
Parameterization defines a new scope, and parameters take precedence over any identifiers declared in the enclosing module or pervasive scopes:
X ::= INTEGER
v1 X ::= 1
T2{X} ::= SEQUENCE OF X -- this 'X' is a parameter, not an INTEGER
v2 T2{BOOLEAN} ::= {TRUE, FALSE} -- 'X' defined to be BOOLEAN
Since TYPE-IDENTIFIER is just a reference, it can be redefined locally:
-- "TYPE-IDENTIFIER" below is a local parameter, and is just -- a name. T3{TYPE-IDENTIFIER} ::= SEQUENCE { -- "TYPE-IDENTIFIER" below is a reference to the parameter, -- and not the pervasive type from X.681 a TYPE-IDENTIFIER }
-- substitute INTEGER for any occurrence of "TYPE-IDENTIFIER"
-- in "SEQUENCE { a TYPE-IDENTIFIER }".
v3 T3{INTEGER} ::= {a 1} -- Back in the module scope, and "TYPE-IDENTIFIER" is
-- now a reference to the type defined in X.681
v4 TYPE-IDENTIFIER ::= { INTEGER IDENTIFIED BY {1 2 3}}The same reasoning applies to ABSTRACT-SYNTAX.
Hope that helps.
Cheers, Geoff
