[cfe-dev] How get next node from current node in AST?

David Blaikie dblaikie at gmail.com
Fri Sep 20 08:26:15 PDT 2013


This relationship isn't tracked in the it. If you're interested in sibling
relationships, you'd need an iterator over the children of the parent. Same
as with any c++ container.
On Sep 20, 2013 6:46 AM, "Madhur Amilkanthwar" <madhur13490 at gmail.com>
wrote:

> Plus one for this question...
>
>
> On Thu, Sep 19, 2013 at 2:32 PM, Vladimir <VladimirPlyashkun at yandex.ru>wrote:
>
>> Hello everyone! Maybe is there some method like currNode->nextNode() ?
>> For example, i have this code:
>>
>> //some code here
>> for(int i = 0; i < 10; ++i) { /* some code */ }
>> int var2;
>> //some code here
>>
>> For example, i have an overriden method
>>
>> bool TraverseForStmt(clang::ForStmt* forStmt)
>> {
>>     // here i could get a forBody by calling forStmt->getBody().
>>     // i could get  parents by calling method on ASTContext
>>    // but how to get next node (get node after forStmt i.e. get 'int var2'
>> node)?
>>    //My task is to know that some nodes comes after forStmt.
>> }
>> I read documentation, but have not found an answear.
>>
>>
>>
>> --
>> View this message in context:
>> http://clang-developers.42468.n3.nabble.com/How-get-next-node-from-current-node-in-AST-tp4034572.html
>> Sent from the Clang Developers mailing list archive at Nabble.com.
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>
>
>
> --
> Thank You.
> Madhur D. Amilkanthwar
> RISE lab,
> IIT Madras.
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130920/c6d183bd/attachment.html>


More information about the cfe-dev mailing list