My understanding of X681 9.8 quoted there:

-----------------------------
A "VariableTypeValueFieldSpec" specifies that the field is a variable-type
value field (see 3.4.21):
        VariableTypeValueFieldSpec ::=
                valuefieldreference
                FieldName
                ValueOptionalitySpec?

The name of the field is "valuefieldreference". The "FieldName" (see 9.14),
which is relative to the class being specified, shall be that of a type
field; the type field which is either in the same information object as the
value field, or is linked by the chain of object fields whose references
appear in the "FieldName", will contain the type of the value. (All link
fields whose field references appear in the "FieldName" shall be object
fields.) The "ValueOptionalitySpec", if present, specifies that the value
may be omitted in an information object definition, or, in the DEFAULT case,
that omission produces the following "Value". The "ValueOptionalitySpec"
shall be such that:
a)      if the type field denoted by the "FieldName" has a "TypeOptionalitySpec"
of OPTIONAL, then the "ValueOptionalitySpec" shall also be OPTIONAL; and
b)      if the "ValueOptionalitySpec" is "DEFAULT Value", then the type field
denoted by the "FieldName" shall have a "TypeOptionalitySpec" of "DEFAULT
Type", and "Value" shall be a value of that type.
-----------------------------

is that in the case of :

&ResultType DEFAULT NULL,
&result-if-error &ResultType DEFAULT NULL,

is the right writing according to b) above since NULL is the value of NULL
type. I don't see why adding "NULL" or " : NULL".

Comments?

Bruno KONIK - uniGone
Tel : +33 (0)1 60 12 77 64
Fax : +33 (0)1 60 12 77 65
41-43 rue de Cronstadt - 75015 PARIS FRANCE
mailto:[EMAIL PROTECTED]
URL : http://www.unigone.com

-- uniGone provides a complete environment for ASN.1 users : JAVA/C# ASN.1
compiler, ASN.1 protocols analyzer... contact us for more information... --

> -----Message d'origine-----
> De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de Olivier
> Dubuisson
> Envoyé : mercredi 23 juillet 2003 14:38
> À : [EMAIL PROTECTED]
> Objet : Re: [ASN.1] Unexpected error
>
>
> Bancroft Scott wrote:
> > On Tue, 22 Jul 2003, Murali wrote:
> >
> >
> >>Hi,
> >>
> >>Attached is the asn specs, which gives the error :
> >>line 22 (InfObj4): A0120E: Parsing error: expecting NULL but found ','.
> >> &result-if-error &ResultType DEFAULT NULL,  --variable type value field
> >>
> >>But when one more NULL is added as it is says in the error message, it
> >>compiles successfully.
> >>(line 22 is changed to &result-if-error &ResultType DEFAULT NULL NULL,)
> >>
> >>Is it a compiler bug or the usage was wrong?
> >
> >
> > The variable type value field defines an open type, and the open type
> > value notation is "Type : Value".  As such, the correct syntax is
> > "&result-if-error &ResultType DEFAULT NULL : NULL".  X.681 will be
> > changed to make it clearer that the presence of "DEFAULT" does not
> > affect the value notation.
>
> IMHO X.681 makes it clear that the default value for the variable-type
> value field is of the default type applied to the corresponding type
> field. As a consequence, I see no need for the ":" notation in such a
> context.
> --
> Olivier DUBUISSON
> france telecom R&D
>
> DTL/TAL - 22307 Lannion Cedex - France
> t: +33 2 96 05 38 50 - f: +33 2 96 05 39 45 - http://asn1.elibel.tm.fr/
>

Reply via email to