IDL Reverse errors on enum with assigned values

General discussions about code engineering

Moderator: Moderators

IDL Reverse errors on enum with assigned values

Postby william.jehle@gtri.gatech.edu » Wed Jul 23, 2014 12:50 pm

Hello,

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 {
   QWE,
   WER,
   ERT,
   RTY,
   TYU,
   YUI,
   UIO,
   IOP
        };
};

#endif /* #ifndef _BAD_ENUM_IDL_ */
william.jehle@gtri.gatech.edu
Forum Beginner
Forum Beginner
 
Posts: 47
Posts Rating:2
Joined: Wed Jul 24, 2013 10:24 am

Re: IDL Reverse errors on enum with assigned values

Postby PauliusGrigaliunas » Thu Jul 24, 2014 2:40 am

Hello,

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
PauliusGrigaliunas
Customer Support
Customer Support
 
Posts: 59
Posts Rating:0
Joined: Mon Jul 19, 2010 1:37 am


Return to Code engineering

Who is online

Users browsing this forum: No registered users and 0 guests

cron