Control flow graph from AST

423 views
Skip to first unread message

Jonathan Baeriswyl

unread,
Oct 29, 2013, 5:05:02 AM10/29/13
to antlr-di...@googlegroups.com
Hello,

I want to perform a taint analysis, in that purpose I want to get the complete CFG of program (I want to do one for Java, C, C++ and C#, so 4 program in total ^^)
The idea is to give all source code one by one to the antlr generated files, that will construct the AST, and I will construct the CFG thanks to the provided structure.
And then I will be able to work as freely as possible with the cfg, to perform the taint analysis and other kind of analysis later.

So, I have a couple of question:

Does something already exist that construct the complete cfg and give access to work on it, for one of these languages? (it does not matter if it is done in antlr3 or 4, as I have access to the cfg)
I need to parse the code for all these languages, but I can't find the grammar for all, I found for C and Java here https://github.com/antlr/grammars-v4, but did not for C++ and C#, where can I find them? (again it doesn't matter if antlr 3 or 4 as soon as I can work with ast to construct the CFG)
Are the grammar for C and Java, find above, complete? (the one for C seems not, like it did not recognise #define #include etc...)

Thanks for your answers

Best,

John

Jonathan Baeriswyl

unread,
Oct 31, 2013, 6:39:38 AM10/31/13
to
I found here some grammar (for antlr3) http://www.antlr3.org/grammar/list.html 
Plus there seems to be a lot of other usefull tools,

But I still can't find the control flow graph that I need, is there really anyone who has already done this? 

And still I would like to have antlr4 grammar if possible, but the grammar list seems kind of empty, is there another site listing antlr4 grammars?

thanks you,

Best,

John
Reply all
Reply to author
Forward
0 new messages