eProsima / Fast-DDS-Gen

Fast-DDS IDL code generator tool. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
82 stars 62 forks source link

fast-dds-gen-3.3.0 with idl-parser 3.0.0 : idl parse error observed when integer constant is set with a enumeration value #385

Open srchaitu2008 opened 4 months ago

srchaitu2008 commented 4 months ago

Hi @richiware ,

Given below is another IDL file for which the processing fails (tested with idl-parser 3.0.0 alongwith fast-dds-gen 3.3.0 with the fix for fast-dds-gen issue 373 included ) :

module module1 { enum mod1_enum_val { value1, value2 }; //mod1_enum_val }; //module1 const int32 myValUsingFullPathAsInt32 = module1::mod1_enum_val::value1; const module1::mod1_enum_val myValUsingFullPath = module1::mod1_enum_val::value1; const module1::mod1_enum_val myVal = module1::mod1_enum_val::value2; module Top { const uint32 MAXLEN = 64; const uint32 SeqLenAssumingThisModule = MAXLEN; const uint32 SeqLen = Top::MAXLEN; }; //Top struct Sub { int32 userID; double f64Data; uint8 vChar; }; //Sub enum Modes { MODE1, //11 MODE2, //20 MODE3 //200 }; //Modes const int32 myDefaultModeAsInt32 = Modes::MODE3; const Modes myDefaultMode = Modes::MODE3; const Modes myDefaultMode1 = Modes::MODE2; typedef Sub SubSequence[Top::SeqLen]; struct AllSubs { SubSequence Subs; }; //AllSubs

Error

Processing the file /tmp/IdlError3.idl... /tmp/IdlError3.idl:9:70: error: Error evaluating expression: ;(module1_mod1_enum_val_value1) | 0 /tmp/IdlError3.idl:30:47: error: Error evaluating expression: ;Top_MAXLEN=64;Top_SeqLenAssumingThisModule=64;Top_SeqLen=64;(Modes_MODE3) | 0

Raising this issue as indicated in comments of fast-dds-gen issue 373

Thanking you, S.Ravi.Chaitanya