Persistent AST and google sparsehash

Jakob Petsovits jpetso at gmx.at
Sat Aug 5 16:53:05 UTC 2006


On Saturday, 5. August 2006 18:25, Adam Treat wrote:
> > An AST node does not need to contain pointers other than pointers to the
> > other nodes, so we can concentrate on serializing the custom members
> > (bools, ints, enums) and traversing the tree. We have a non-cyclic tree,
> > which should be easy enough to traverse - hey, we already got default
> > visitors!
>
> Yah, that reference I linked is a great source.  This should be very easy
> to implement in the kdev-ast-gen as we already have a visitor, like you
> said ;)

Just to say it more clearly again:
The serializer could just be another class derived from either the visitor or 
the default_visitor. Quite similar to it, I guess.

> > The most difficult question for me is how to seperate the serialized
> > members from the data stream, but that's probably because I'm not
> > familiar with the class and haven't read the apidox yet.
>
> Not sure what you mean?  I'm pretty sure roberto is not going to want to
> use QDataStream in the parser, although I wish kdevelop-pg would just bite
> the bullet and use Qt ;)

Not as long as I'm the main committer there.
We can have optional, non-default functionality, but I do want to keep the 
standard generated parser completely Qt/KDE independent.

> So, we'll probably have to use std::iostream and 
> just serialize ourselves.   Check out the reference I linked.

If the serializer is a seperate visitor in a seperate file, I don't see a 
reason not to use QDataStream. If std::iostream doesn't work too different, 
it can possibly be generated for both and switched by --adapt-to.

...Jakob.




More information about the KDevelop-devel mailing list