Ada support

Roberto Raggi raggi at di.unipi.it
Mon Apr 14 20:50:05 UTC 2003


On Monday 14 April 2003 20:05, luc willems wrote:
> >......, maybe is better to wait one or two weeks before start to
> > integrate the ADA support, because i'm rewriting the whole class store.
> >
> > ciao robe
>
> 	 hello Robe,
>
> can i expect many changes our is the interface stable ? I used the class
> viewer for perl and wonder if i need to update this code ?
>
> 	luc

the new class store is completely different from the old one, but is very 
simple to use it.. for instance, this code add the a class declaration for 
c++ 

    Tag tag;
    if( kind == "class" )
        tag.setKind( Tag::Kind_Class );
    else if( kind == "struct" )
        tag.setKind( Tag::Kind_Struct );
    else if( kind == "union" )
        tag.setKind( Tag::Kind_Union );

    tag.setFileName( m_fileName );
    tag.setName( className );
    tag.setScope( m_currentScope );

    int line, col;
    ast->getStartPosition( &line, &col );
    tag.setStartPosition( line, col );

    ast->getEndPosition( &line, &col );
    tag.setEndPosition( line, col );

    QString classId = m_catalog->addItem( tag );


is very simple to fetch informations too, for instance this query returns all 
classes declared in scope "std"

QValueList<Catalog::QueryArgument> args;
args << Catalog::QueryArgument( "kind", Tag::Kind_Class ) 
       << Catalog::QueryArgument( "scope" (QStringList() << "std") );

QValueList<Tag> classes = catalog->query( args );

all data is stored using berkley db 3/4 and Catalog::query() is very 
efficient, because it uses the "equality join" provided by bdb.
http://www.sleepycat.com/docs/api_c/db_join.html

ciao robe





More information about the KDevelop-devel mailing list