[omniORB] Identifier `ValueType' clashes with keyword `valuetype'
Michael J. Davis Jr.
mjd@fnurt.net
Fri, 23 Feb 2001 15:05:44 -0000
However, the spec ALSO says that you can prepend an _ to a name that you
need/want to use that happens to clash with a keyword. According to the
spec, you could use _ValueType as the name, and when the CORBA 2.3 compliant
idl compiler sees that, it generates code for 'ValueType' (without the
leading _).
"Gary D. Duzan" <gdd0@gte.com> said:
> In Message <0vofvth3tg.fsf@cs.uni-magdeburg.de> ,
> Roland Jesse <jesse@mail.CS.Uni-Magdeburg.De> wrote:
>
> =>Hi,
> =>
> =>the following idl extract is compatible with current Mico but
> =>obviously not with omniORB:
> =>
> =>module Query {
> => enum ValueType {
> => TypeBoolean, TypeChar, TypeOctet, TypeShort, TypeUShort,
> => TypeLong, TypeULong, TypeFloat, TypeDouble, TypeString,
> => TypeObject, TypeAny, TypeSmallInt, TypeInteger, TypeReal,
> => TypeDoublePrecision, TypeCharacter, TypeDecimal, TypeNumeric,
> => TypeTuple, TypeNull
> => };
> =>};
> =>
> =>"omniidl -bcxx vt.idl" complains:
> =>vt.idl:2: Identifier `ValueType' clashes with keyword `valuetype'
> =>omniidl: 1 error.
> =>
> =>As "ValueType" is used inside the Query module it should never clash
> =>with any other valuetype definitions (which are a "Missing feature"
> =>regarding the User's Guide section 1.1.4 at least in omniORB 3.0.2
> =>anyway).
> =>
> =>Anyway around this error without renaming the enum?
> =>
> =>Pointers are appreciated.
> =>
> => Roland
> =>
>
> From the CORBA 2.3.1 spec:
>
> >From Section 3.2.3: Identifiers
>
> When comparing two identifiers to see if they collide:
> Upper- and lower-case letters are treated as the same letter.
> Table 3-2 on page 3-4 defines the equivalence mapping of upper-
> and lower-case letters.
>
> >From Section 3.2.4: Keywords
>
> Keywords must be written exactly as shown in the above list.
> Identifiers that collide with keywords (see Section 3.2.3,
> "Identifiers," on page 3-6) are illegal. For example, "boolean"
> is a valid keyword; "Boolean" and "BOOLEAN" are illegal identifiers.
>
> "valuetype" appears in table 3-6, so omniidl is right and MICO is
> being lax in enforcing this rule. In these cases, when in doubt
> omniidl is usually right. :-)
>
> Gary Duzan
> Verizon Laboratories
>
>
>
--