typedef's not recorded in CppHeaderParser.CppHeader

Create issue
Issue #4 resolved
Sixdsn created an issue

Hi,

I know its not a cpp keyword but it might be usefull to stock it somewhere in the CppHeader, maybe as C functions in a list in CppHeader.typedefs

it's usefull when developers are typedefing some classes

thank you,

Comments (11)

  1. Sixdsn reporter

    My bad, typedef is working find... i don't know why, but it looks like print cppHeader doesn't work anymore when there are typedef

    ex: i can print cppHeader correctly if there is no typedef and as soon as i put a typdef in the file being parsed, the print doesnt all informations as before

    but the typedef procedure itself looks fine for my first lil tests. i'm gonna look deeper tomorrow

  2. Sixdsn reporter
    class Zob
    {
     public:
      //typedef Zboub six;
    
    };
    
    typedef Zob Toto; 
    
    class Six: public Toto
    {
    
    };
    

    When uncommented, the typedef nested in class Zob is parsed correctly, but it doesn't matter in my case. Class Six isn't parsed as it is defined under a typedef... it's a big regression

    Debug output:

    [2215] trace
    [2216] (Empty Stack)
    [2172] CLEAR STACK 
    [2186] Evaluating stack ['typedef', 'Zob', 'Toto']
           BraceDepth: 0 (called from 2169)
    [2210] STACK ['typedef', 'Zob', 'Toto', ';'] 
    [2171] REAL CLEAR 
    [2029] Unexpectedly ran across LexToken(NAME,'class',7,36) with content in the nameStack.  Must be following #define magic.  Process that before moving on
    [2186] Evaluating stack ['typedef', 'Zob', 'Toto']
           BraceDepth: 0 (called from 2030)
    [2210] STACK [] 
    [2186] Evaluating stack ['typedef', 'Zob', 'Toto', 'class', 'Six', ':', 'Toto']
           BraceDepth: 0 (called from 2047)
    [2210] STACK ['Toto', '{'] 
    [2186] Evaluating stack ['typedef', 'Zob', 'Toto', 'class', 'Six', ':', 'Toto']
           BraceDepth: 1 (called from 2062)
    [2210] STACK ['Toto', '{', '}'] 
    [2070] END OF CLASS DEF 
    [2080] END OF STRUCT DEF 
    [2186] Evaluating stack ['typedef', 'Zob', 'Toto', 'class', 'Six', ':', 'Toto']
           BraceDepth: 0 (called from 2169)
    [2210] STACK [';'] 
    [2172] CLEAR STACK 
    

    And also It looks like i can't have access to protected typedef's only thoses that are in a public class scope. and i have some that are in a protected scope.

    Thanks,

  3. senex repo owner

    Maybe there was a reason standard type defs were filtered out. My regression tests were passing after the change. I will see how your code affects things tonight.

  4. Sixdsn reporter

    Looks pretty good thanks but only public nested typedefs are caught:

    class Six
    {
    typedef char Zob; //not stored in cppHeader (is private) 
    public:
    typedef int Foo; //stored correctly
    protected:
    typedef float Bar; // not stored in cppHeader
    };
    

    it's not an important feature to me as i won't use it right now, but as you store public ones, you should store the other ones (private/protected) in separated dict

    Tahnks again :)

  5. Log in to comment