#212 Will not parse C++ functions with fully qualified arguments

open
5
2012-12-29
2007-04-03
Anonymous
No

//this will parse

accessCircuitInfo
assignPortCtl::xfindAndAssignPortBase(
Node_m* aNode,
const char* switchId,
// const SMCommonTypes::CircuitInfo2& circuitInfo,
unsigned long accessPointId )
{

// this will not parse
accessCircuitInfo
assignPortCtl::xfindAndAssignPortBase(
Node_m* aNode,
const char* switchId,
const SMCommonTypes::CircuitInfo2& circuitInfo,
unsigned long accessPointId }

{

The result is that the symbol "xfindAndAssignPortBase" can be found, but you can not find functions calling this function, nor can you find functions called by this function...

Man this was fixed almost 20 years ago!!! what the heck happened to parse. I guess some screwed up at Santa Cruz or what ever... C++ methods only work with no fully qualified/scoped naming.

I grabbed the source of 15.6. I would appreciate a reply, especially if you have a fix, since y'all know the code better than me. I imagine the token is not recognised as an argument. Well if I make a fix I will send it along.

-karl thiele karl.d.thiele@versionbusiness.com
kdthiele@nc.rr.com

Discussion

  • Logged In: NO

    are double colons scope operator not being recognised???

     
  • Logged In: YES
    user_id=27517
    Originator: NO

    Well, before we get too excited, let's all try to recall that the name and mission of this program is still "cscope", not "C++scope". Those are two different languages, although popular literature is awash with titles suggesting there's some language called "C/C++" which people should be taught to write programs in.

    Yes, the parser was extended to accept some C++ syntax where it was reasonably easy to to so, but expecting it to accept generic C++ is misguided.

    > this was fixed almost 20 years ago

    By whom? Where?

     
  • Logged In: NO

    Fix has been emailed to HBB, anyone can email me to request it, very simple fix

     
  • Logged In: YES
    user_id=778555
    Originator: NO

    Hello,

    Can you please do something with the :: decorated function argument types?
    The "nobody" writes that he or she has sent patches (very simple fix) -- I looked up the patches available on the Patch System, cannot find it there.

    --
    Regards,
    Mariusz

     
  • Paul Hughes
    Paul Hughes
    2009-10-30

    For me this bug make cscope useless on my c++ project.

    Fortunately it was easy to fix. About 10 mins of looking at the code located the single missing colon in fscanner.l.

    cvs diff fscanner.l
    Index: fscanner.l
    ===================================================================
    RCS file: /cvsroot/cscope/cscope/src/fscanner.l,v
    retrieving revision 1.14
    diff -r1.14 fscanner.l
    531c531
    < {ws}*\(({wsnl}|{identifier}|{number}|[*&[\]=,.])*\)([()]|{wsnl})*[:a-zA-Z_#{] {
    ---
    > {ws}*\(({wsnl}|{identifier}|{number}|[*&[\]=,.:])*\)([()]|{wsnl})*[:a-zA-Z_#{] {

     
  • Just for the record: I don't seem to have that mail "nobody" claims to have sent me all that time ago...

    As for the newly proposed patch: I'll need some feedback to believe it fixes the problem for good. For starters, it neglects to handle scanner.l, which to my eye seems to have the same problem.

    And what about the patterns for matching function calls? Wouldn't they need a similar modification? And if they don't: why not?