Re: symbol lookup and overload resolution

Richard Kelly <[email protected]>
Newsgroups gmane.comp.documentation.synopsis
Organization Jet Propulsion Laboratory
Message-ID <[email protected]>
Hi Stefan,

Thanks for the pointers to SymbolLookup::Visitor, Parser::parse(), and 
the rest.  Clearly, I'm not yet using as much of Synopsis's capabilities 
as I could be.  I'll read up on those guys and try to start using them 
sensibly.  If I can come up with some intelligent comments and/or 
suggestions for you about those parts of the API, I'll send more e-mail.

Please see my other comments below.


Stefan Seefeld wrote:
>
> The reference code I usually use to see whether it works correctly
> (<hint> in lack of good unit tests </hint>) is boost.

As I learn more about Synopsis, I'll look over your existing tests.  I 
don't know yet, but perhaps I'll be able to help out in that area.

> As soon as we can be confident that symbol lookup works correctly, we
> can
> 
> 1. switch on symbol lookup by default
> 2. make the parser itself use it
> 3. make the symbol lookup API(s) public, in particular expose it
>    to python

That would be great.  In the meantime, can I trouble you with one more 
question?

For each software entity -- class, free function, member function, 
whatever -- I have to be able to find all declarations and the 
definition (if any) of that entity, wherever they may exist in the 
original source code.  So far, I've been querying the AST for that 
information, including AST.declarations(), AST.types(), and now 
Type.Dictionary.lookup() to get the declarations.  After that, I'm 
following the file() and line() information from each Declaration and 
Comment.

Of course, I now know that I should be using some of the Synopsis 
features you've described to me, so I'll start switching over to them. 
But from what I've seen up to this point, I haven't found in the AST all 
of the references to all of the original declarations.  So maybe I'll 
find the definition of function foo() in a .cpp file but not the 
corresponding declaration of foo() in the .hpp file.  Note that this is 
*after* running the Synopsis linker, like this:

     parser = Cxx.Parser( main_file_only = False )
     linker = Linker( RmdcComments(), Previous(), JavaTags() )
     self.__ast = AST.AST()
     self.__ast = parser.process( self.__ast, input = inFiles )
     self.__ast = linker.process( self.__ast )

So, am I interpreting the AST incorrectly?  Does it actually contain 
references to every single declaration/definition of foo()?  Should I be 
querying the AST before linking, instead of after?

Rick
-- 
Richard M Kelly                             [email protected]
[PGP  =>  D5 C3 CC D2 B7 D0 A9 B0  D5 90 B2 55 5A 80 23 B6  FC AB 67 B4]
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.