The Array type

Luke Petre <[email protected]>
Newsgroups gmane.comp.documentation.synopsis
Message-ID <[email protected]>
I have to admit that my interest in Synopsis is primarily because it 
parses C++ very nicely.

That being said I've noticed that the Array type doesn't seem to be 
parsed correctly, at least not for member variables.  I've added the 
following code to swalker.cc, although I'm not 100% sure this is The 
Right Way to approach the problem.

This is in swalker.cc, the function 
SWalker::TranslateVariableDeclarator.  At about line 1137.

...
  // TODO: implement sizes support
  {
    bool array = false;
    Types::Array::Mods sizes;
    Ptree* pStart = decl->Cdr()->Cdr();
    char* type2 = enctype;
    while ( *type2 == 'A' )
    {
      Ptree* pDim = pStart->Cdr();
      sizes.push_back( pDim->First()->string() );
      pStart = pDim->Cdr()->Cdr();
      ++type2;
      array = true;
    }

    if ( array )
    {
      type = new Types::Array( type, sizes );
    }
  }
...

I'm also very curious where the //.< syntax is handled.  I've looked 
everywhere and can't really get my head around the previous comment feature.

Keep up the excellent work!

Luke
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.