[Qt-creator] Symbol visitor and Scope::Use questions

Marek Jasovsky jasovsky.marek at gmail.com
Tue Mar 24 11:59:29 CET 2009


Hi Roberto

is my assumption correct that you basically have 2 options...

first (part of which you also do) is to store all local declarations of a
variable within a Function class instance...

second. get base AST node of a function and implement custom AST visitor to
read all declarations from child nodes of that FunctionDefinitionAST (?)
node?

right?

is the basic reason, that you do not go deeper behind the Block:: that you
are not interested (so far) in this, what's inside of this Block?

Thanks in advance

Marek

2009/3/24 Roberto Raggi <roberto.raggi at trolltech.com>

>
> Hi Bertjan,
>
> On 23.03.2009, at 16:06, Bertjan Broeksema wrote:
>
>
> However, if we use this code for this small example:
>
> int main(int argc, char *argv[])
> {
>  string s = "een string";
>  s += " meer tekst";
>  cout << s << endl;
>
>  return 0;
> }
>
> it seems that there is only a child node for the declaration of s in the
> block. The semantic pass doesn't seem to add child nodes to the block for
> the
> Expressions which are in the block. Could you explain why this happens and
> how
> we eventually could solve this?
>
>
> Right, there's only one declaration in the block, so it kind of make sense
> to me that there is only one symbol in `block->members()' (the symbol
> introduced by the declaration of `s').
>
>
> Another question we had is about the Use class in Scope. What exactly is
> the
> purpose of this class? Does it define the relation definition <-> use?
>
>
> Well - that code is not used at the moment. I'm still playing with
> different ways to represent a `use' of Symbol. By the way, when it'll be
> done you'll be able to ask the engine for all the uses of a symbol
> introduced by a declaration.
>
> ciao robe
>
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090324/9d3ba05b/attachment.html 


More information about the Qt-creator-old mailing list