#13 patch to support forward declarations of structs

open
nobody
None
5
2010-08-17
2010-08-17
aptbuza
No

Bug ID [1723104] reports that the IDLToCLSCompiler doesn't support forward declarations of structs. I've made modifications to the grammar and compiler that should fix that. With this patch applied I've been able to compile IDL containing forward declarations and use them in a client communicating with an omniORB server.

The patch was generated against https://iiop-net.svn.sourceforge.net/svnroot/iiop-net/trunk/IIOPNet@1982. In order to build the compiler after applying the patch you will need to regenerate the files from IDL.jjt and change IDLToClsCompiler/IDLCompiler/ASTstruct_decl.cs and ASTstruct_forward_decl.cs to subclass SimpleNodeWithIdent instead of SimpleNode. I thought there might be a way to have them generated that way from the start, but if there is I wasn't able to find it.

I'm not intimately familiar with the compiler (or .Net/C# and CORBA) - I mostly used existing definitions as a guide - so at best I can say that "it works for me". I did spend some time looking for a compiler test suite but didn't see one.

Discussion

  • aptbuza
    aptbuza
    2010-08-17

     
    Attachments
  • aptbuza
    aptbuza
    2010-08-30

    Ah, I found the test suite for the IDLCompiler. It seems this patch causes the TestMultipleNestedTypes test to fail. I'll see if I can't fix it an submit a new patch.

     
  • You may also consider implementing forward declarations of unions, interfaces, etc.