generating xml from dafny code

Oct 25, 2013 at 7:29 PM
Edited Oct 27, 2013 at 9:49 PM
Good afternoon everyone;

I was just wondering is it somehow possible to generate an xml structure of given dafny source code.

Regards,
Developer
Oct 28, 2013 at 8:14 AM
Hi,

Dafny provides an AST and a pretty-printer, which you could adapt to generate XML instead of Dafny code.

Best regards,

Valentin
Oct 28, 2013 at 12:36 PM
Good afternoon Valentin;

Thank you for your answer;

When I read my question and I realize that what I am asking for (sorry for that) is not so clear. Therefore, I will ask again with details.

What I want to do either obtain AST(it can be any kind of structure that I could read and manipulate easily) of a given input .dfy program OR try to generate XML from given .dfy program file.

I manage to run project dafny in visual studio 2012. Project has source code files DafnyAst.cs, parser.cs, printer.cs, scanner.cs. However, since this project is not documented I don't know How to manipulate this files to reach my purpose.

Which classes would help me to reach my purpose ?

Is there any kind of document that I could read about it ?

Regards,
Developer
Oct 30, 2013 at 12:22 PM
Hi,

unfortunately there is no comprehensive documentation for the internals of Dafny. I would start looking into the 'Printer' class if you want to get an overview of the AST.

Best regards,

Valentin