I need to Parse whole java code and save statements in a tree structure for making Control flow graph : <p>I need to identify java source code all type of statements and store them in a tree structure to make a control flow graph! what i cannot understand is how should i read a java source code so that my program may distinguish all different types of statements in java( if,for, classes, methods etc.)
Do i need to add the whole grammar of java language?</p>

<p>what i cannot understand is how should i read a java source code so that my program may distinguish all different types of statements in java( if,for, classes, methods etc.)</p>
