Generating CFG -where nodes are statements- for C source codes

Job ID: 32653985

Budget: $250 – $750 USD

Hi,

Please: if you do not have an idea about CFG, then do not try, because you will waste my time.

I want to hire someone that he can build a Control Flow Graph data structure from the statements of a C code.

I want a CFG for each C procedure in the program.

You can use any tool for this purpose.

_________________________________________
Class Stmnt { public:
int id;
vector<int> successors;
vector<int> used_variables;
vector<int> read_variables;
Type type;
}

For example:
void main() {
while( i < k + proc2(j) )
{
i++;
}
}
_____________
Statements[0]= { 0, {1}, {}, {}, Type.ProcedureHeader }
Statements[1]= { 1, {2}, {}, {}, Type.OpenCurelyParenthesis }
Statements[2]= { 2, {3}, {j}, {tmp1}, Type.CallProcedure }
Statements[3]= { 3, {4,8}, {i,k,tmp1}, Type.While }
Statements[4]= { 4, {5}, {}, Type.OpenCurelyParenthesis }
Statements[5]= { 5, {6}, {i}, {i], Type.Assignment }
Statements[6]= { 6, {3}, {}, {}, Type. CloseCurelyParenthesis }
Statements[7]= { 7, {}, {}, {], Type. CloseCurelyParenthesis }

I hope this explains the idea ..

_________________________________________

There are many tools that could be used to generate a CFG such as: Frama-C, CLang, Understand Code (SciTools).

_________________________________________

The input is any C project code. The output is data structures, without converting it to Basic Blocks.

_________________________________________

Article about CFG: https://en.wikipedia.org/wiki/Control-flow_graph

_________________________________________

Please, if you do not have an idea about CFG, then it is better not to submit a proposal

_________________________________________

Thanks