I'm using pycparser to parse some C code. Specifically, I need certain portions of the code, included in pycparser are some visitors like visit_If to visit "If" sections of the code. However, I'm having problem visiting 'else' part of an if-else statement.
Example 1:
if (x == 0)
{
// some statements
}
else
{
// some statements -> I only need all codes under else
}
Example 2:
if (x == 0)
// a statement
else
// a statement -> I only need all codes under else
How is this possible in pycparser?