I could do simple scanner and parser using bison and flex like a simple calculator for example I can give input (to the exe which was generated after compiling the lex.yy.c and y.tab.c), 3+4*5, the exe would display the result as 23. But I don't know how to do the following:
x = 0;
while (x < 3) {
print x;
x = x + 1;
}
using flex and bison. I want the exe generated to print x, until the while loop condition fails. How do I do that? Thanks in advance.