Page 1 of 1

IDL Reverse errors on enum with assigned values

PostPosted: Wed Jul 23, 2014 12:50 pm

I am working with a large set of IDL files for my customer. I attempted to reverse a set of files and found a significant problem reversing any enum with assigned values. In the example below, I have two enums defined - one with values assigned, the other without. For the first enum, I get an error on Reverse.
Parsing failed (<path>\Common.idl) Encountered " "=" "= "" at line 13, column 21. Was expecting one of: "}" ... "," ...

I think the problem may be that this is not part of the OMG standard. I can live with that... but... is there a way to bend the rules or redefine them so that I can import an enum that is non-standard?

Example IDL:
Code: Select all
// bad enum
// reverse test
// does not like to see enum with NAME = <value>
#ifndef _BAD_ENUM_IDL_
#define _BAD_ENUM_IDL_
module bad_enum {
        enum WithEqualSign {
                QWE = 1,
                WER = 2,
                ERT = 4,
                RTY = 8,
                TYU = 16,
                YUI = 32,
                UIO = 64,
                IOP = 128
        enum WithoutEqualSign {

#endif /* #ifndef _BAD_ENUM_IDL_ */

Re: IDL Reverse errors on enum with assigned values

PostPosted: Thu Jul 24, 2014 2:40 am
by PauliusGrigaliunas

I checked Corba IDL parser and it can parse enum that follows this BNF:

<enum_type> ::= “enum” <identifier> “{” <enumerator> { “,” <enumerator> }∗ “}”
<enumerator> ::= <identifier>

and <identifier> = ["a"-"z","A"-"Z", "_"] (["a"-"z","A"-"Z","0"-"9","_"])*

Unfortunately I do not see how you could parse non standard enumerations.
Do not see any workarounds here except changing parser.

Kind regards,
Paulius Grigaliunas