problem during parse of namespace with C-Header extern "C" included

Achim Spangler spangler at tec.agrar.tu-muenchen.de
Mon Mar 20 13:11:05 GMT 2000


Hi,
ClassParser.cc throws an 
ASSERT: "lexem == '}'" in ClassParser.cc (383)

in a header file, where I define TWO namespaces like the following:

header.h:
namespace nam1
{ // start of namespace recognized as nam1
  #if defined(DEF_1)
    extern "C" {
      #include "header_1.h"
    }
  #elif defined(DEF_2)
    extern "C" {
      #include "header_2.h"
    }
  #endif
}
namespace nam2
{
  // some inline functions
} // end of namespace recognized as nam1(!)

I tried to replace some "}" with "};" but one time ClassParser.cc
complains about errors and some other time the API generation complains
about undefined decls.

Interesting test information:
I checked for the code line, where ClassParser see begin and end of
namespace (by inserting cout getLineno() in
CClassParser::parseNamespace(CParsedScopeContainer* scope) )
==> only namespace nam1 is recognized starting and ending at the
commented positions
==> I suspect that the parser is confused by the "{" and "}" of the
extern "C" block

Greetings,
Achim
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=IKB-Duernast-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Dipl.-Inform. Achim Spangler                TUM Freising-Weihenstephan
Tel.:  +49-8161-71 3565                     Institut fuer Landtechnik
Fax.:  +49-8161-71 3895                     Am Staudengarten 2
Email: spangler at tec.agrar.tu-muenchen.de    85350 Freising
URL:   http://ikb.weihenstephan.de/deu/members/persons/spangler.html
       http://ikb.weihenstephan.de/en/members/persons/spangler.html
=-=-=-=-=-=-=-=-=-=-=-Agricultural BUS System (LBS)-=-=-=-=-=-=-=-=-=-=-




More information about the KDevelop mailing list