Re: [Vala] How to get the local variables of a method?



ok, but how to iterate over all children blocks?

2009/5/10 Jürg Billeter <j bitron ch>
Hi,

On Sat, 2009-05-09 at 23:32 +0200, gege2061 wrote:
> I continu my learning of the vala parser.
>
> I seek to get the local variables of a method. I tested
> Method.body.get_local_variables() but the list is empty.
>
> What is the good way?

Local variables have block scope, which means that you might need to
call get_local_variables() on a child block of the method body. If you
want to list all local variables in a method, you need to iterate over
all block children and call get_local_variables() on each.

Jürg




--
Nicolas Joseph

Responsable des rubriques C et GTK+ de developpez.com /
In charge of the C and GTK+ sections on developpez.com

http://nicolasj.developpez.com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]