[Rose-public] VariableDeclaration name

Phil Miller mille121 at illinois.edu
Tue Sep 17 18:28:33 PDT 2013


I believe you want SgInitializedName::get_name(). SgVariableDeclaration
represents a statement that may declare several variables, each of which
has its own SgInitializedName AST node.


On Tue, Sep 17, 2013 at 6:16 PM, Tim <rose.mailinglist at gmail.com> wrote:

> Hello,
>
> I'm using the virtual disc image with the corresponding rose version of
> 2012.
> At the moment, I try to write a hello world transformer which inserts new
> variables into a list
> of variable declarations. For instance:
>
> int main(int argc, char* argv[])
> {
>   int first, insert_after_me, last;
>   return 1;
> }
>
> How can I get the name of the current VariableDeclaration?
> The function get_mangled_name() delivers a long string that contains the
> var name, however,
> I don't like to parse this string.
> Is there any other solution/function like this:
>
> if(isSgVariableDeclaration(n))**{
>
>   SgVariableDeclaration* vd = isSgVariableDeclaration(n);
>
>   if(vd->???.compare("insert_**after_me") == 0) {
>
>     ...
>   }
> }
>
> I'm happy about every evidence :-)
>
> Cheers!
>
> Tim
> ______________________________**_________________
> rose-public mailing list
> rose-public at nersc.gov
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nersc.gov/pipermail/rose-public/attachments/20130917/54df6ffa/attachment.html>


More information about the rose-public mailing list