Menu

#18 Reverse Engineering nested classes too complex

open
5
2004-06-12
2003-11-17
Jeff Bailey
No

Reverse engineering the attached files causes an
"argument list too complex" error. Stepping through
the parsing code it appears that the scoped return
value is causing the parser to get confused about where
the function name begins.

Discussion

  • Jeff Bailey

    Jeff Bailey - 2003-11-17

    Too Complex

     
  • Craig Gunhouse

    Craig Gunhouse - 2004-06-12

    Logged In: YES
    user_id=109050

    The current parser will probably be replaced with something
    better, the current one is to difficult to work with.

     
  • Craig Gunhouse

    Craig Gunhouse - 2004-06-12
    • assigned_to: nobody --> gunner
     
  • Vambola Kotkas

    Vambola Kotkas - 2005-11-12

    Logged In: YES
    user_id=698026

    C++ parser is complex piece of software anyway ... replacing
    it takes time.

    For people who dont want to wait I got a fix or at least current
    one stopped throwing these exceptions if i did it.

    ClassBuilder.dll!SourceParser::ParseFunction Line 1125
    WAS:
    while( *cur != '(' && *cur != ':')
    FIX:
    while( *cur != '(' /*&& *cur != ':'*/)

    Nearby comments indicate that looking for ":"-s is probably
    bug anyway.

     
  • Craig Gunhouse

    Craig Gunhouse - 2005-11-12

    Logged In: YES
    user_id=109050

    I am currently writing a new version of the parser. The current
    version does not support change to well. Fix one bug, get two
    more in it's place. For example the change you suggest may
    work for the code you are dealing with but code containing a lot
    of scope operators ("::") may fail. This parser came from
    wxWidgets (wxWindows) and I found myself always plugging
    holes in the code and one of those hole was and still is the scope
    operator. Thanks for the suggestion, it may be better to break
    the code where it works for that one case it works for the scope
    operator than to have it not work on majority of the other parsed
    source code,

    Thanks again for your help,

    Gunner

     
  • Vambola Kotkas

    Vambola Kotkas - 2005-11-12

    Logged In: YES
    user_id=698026

    The change i suggested worked very good on
    reverseengineering quite complex project written by multiple
    authors. It also seemingly fixed bug reported as[675347] too.

    I overall agree that the parser in this project is not most
    powerful or maintainable one. The major problem is that
    classbuilder does not seemingly support nested
    classes/namespaces etc. If your new parser will do it then its
    good idea to work on it. Even horrible end may be better than
    endless horror. ;-)

     
  • Vambola Kotkas

    Vambola Kotkas - 2005-11-12

    Logged In: YES
    user_id=698026

    BTW ... there are several quite sophisticated open source
    C++ parsers available so maybe better try to embed one of
    them, instead of writing new one.

     
  • Craig Gunhouse

    Craig Gunhouse - 2005-11-14

    Logged In: YES
    user_id=109050

    I have looked at some of these parsers and you end up having to
    write description of C++ to the parser.

    I looked at the code you mention and it deals with some code in
    wxWindowl

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.