Closed srchaitu2008 closed 4 months ago
Additionally, please check the below IDL file as well:
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 typedef Sub SubSequence[Top::SeqLen]; struct AllSubs { SubSequence Subs; }; //AllSubs
Similar error is encountered:
Processing the file /tmp/IdlParseError_2.idl... /tmp/IdlParseError_2.idl:13:36: error: Error evaluating array dimension: ;Top_MAXLEN=64;Top_SeqLenAssumingThisModule=MAXLEN;Top_SeqLen=Top::MAXLEN;(Top_SeqLen) | 0 /tmp/IdlParseError_2.idl:16:3: error: 'SubSequence' was not defined previously
Thanks for the report. We will take it into a look.
Hi @richiware ,
I have tried the fix and the previously mentioned IDL files are processing successfully.
Given below is another IDL file for which the processing fails with this fix as well:
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
Requesting you to take a look at this as well.
Hi @richiware ,
Can you please take a look at the above IDL file as well?
I was testing your last IDL file. The failure is caused by the integer constant that is set with a enumeration value. This corner case will be more difficult to be supported and right now I don't have that time.
I propose you to open a new issue for this new case and we will fix it when we have time and this issue could be closed automatically when the related PR are merged.
Hi @richiware ,
As requested in earlier comments, raised issue 385 for IDL parse error when integer constant is set with enum value.
Thanking you, S.Ravi.Chaitanya
The below mentioned idl file parsing fails with below mentioned error (idl-parser 3.0.0 is used alongwith fast-dds-gen 3.3.0) :
IDL file:
Error:
In the above idl file, there is a struct which tries to declare an int array as typedef. One observation is that when the enum declaration (const module1::mod1_enum_val enum1 = module1::mod1_enum_val::value1;) is removed/commented, the parsing works fine.
Below command is used :
For example: