I have a source code of new kind of small programming language;
method M(n: int) returns (r: int)
ensures r == n;
{
var i := 0;
while (i < n)
{
i := i + 1;
}
r := i;
}
I want to read this source file of this code (just one file without any dependencies) using Java and create XML for function name, input parameters,return types,keyword ensures etc.
In order to do that, I need to analyse given source code maybe create a kind of a tree structure to see hierarchical view. (at least I am thinking that way)
Is there any kind of framework that could help me to customize the keywords in order to analyse this kind of material and generate XML out of it or should I just read this file line by line and try to create XML parser by myself.
My main purpose in here to represent this code in XML format.In order to generate some UML kind diagrams.I am not aiming to create new compiler or language. (my question was not clear enough I hope this makes it more clear)