I want to extract loop condition from a program or an abstract syntax tree in clang. While researching on this topic, I came to know loop conditions can be extracted into a function. How to extract this loop condition into a function or is there any command in Clang to directly extract loop conditions from an abstract syntax tree or a program. Kindly help me with this.
Sir, as you told we can visually find loop condition from abstract syntax tree. But, I want to automatically extract loop condition from either abstract syntax tree or a program.
Thank you for your help !!
Sir, I have created the findClassDecls.cpp and CMakeLists.txt file as provided in the link. After these steps, how can we extract loop conditions using these visitor class ?
I don’t know what link you’re referring to, but I find it unlikely that bin/find-class-decls is expected to be in your home directory. Either whatever guide you’re following overlooked a step or you did.
I am a beginner who is using Clang. I am trying to extract loop conditions and I just want to get loop conditions extracted from the program.
The program from which I want to extract loop conditions is given below :
void main()
{
int a;
while(a >10)
a = a - 1;
}
This program contains a single while loop which contains a condition a < 10. I just want to extract this condition a < 10 from this program.
I have gone through the reference documentation. With this member function and ASTVisitors, how can I extract loop condition ? Is there any example showing how could it be done ?
I have gone through the reference documentation. With this member function and ASTVisitors, how can I extract loop condition ? Is there any example showing how could it be done ?