This module requires two main tasks:
- Read in a Graphviz DOT file
- Print out a Genie XDSL file
Do it yourself (The more difficult)
Essentially, you will code everything from scratch.
Step 1 is the trickier part, and it may require some understanding lexing/parsing. You need to take in the DOT file and then identify valid tokens (e.g. brackets, ->, etc.). Then these tokens should be put in a representation that the code can identify. If you put some restrictions on the allowed DOT syntax, you can simplify this process.
From the representation, you should have enough information to understand the arcs and nodes of the network. Then, you can output XDSL format by opening a file stream and outputting the necessary text. Try opening a Genie-generated XDSL file with a text editor (e.g. vim) to see the syntax (it is an XML file with particular tags). Whitespace is probably not needed, but useful for readability.
Use the libraries! (The easier way)
Here, you can just let other libraries do your heavy lifting.
First, the Boost library is very powerful and has a module to form a Graph from a DOT file (http://www.boost.org/doc/libs/1_55_0/libs/graph/doc/table_of_contents.html).
With this, you can use the API to access nodes/edges and then create a DSL_network with the SMILE API (http://genie.sis.pitt.edu/wiki/SMILE_Documentation). Then, you can run the WriteFile() function to generate an XDSL file.
In the end...
Whichever way you want to do it is fine. You should be able to get better performance from the first (skip creation of graph-like objects internally), but the second will be a lot easier.