Season of KDE 2020 - ROCS IDE - Add File backends, Week : 1
Shivam Balikondwar
shivambalikondwar101 at gmail.com
Tue Jan 21 11:49:16 GMT 2020
Hi there, Shivam here
I did research on KML file format , i am working to add support to import
and export graphs in KML format.
This is a short explanation of my understanding, I request Caio and Tomaz
to go through it and help me finalize the grammer for this parser.
KML is an easy to interpret file format written in the form of nested html
like tags "<>". The attributes( values ) are in the <> </> tag present
which can be parsed by spirit parser.
In the past week I did research and studied the spirit boost library.
I have become familiar with both the parser and generator (qi and karma)
qi's API , skipper function. Also how the current implementation of rocs
uses this library to parse the files.
Long story short, i think this grammar definition might be enough for
importing/exporting graph.
<Graph> : tells the nested tags will contain, graph nodes, edges etc
<id> : can be a number, name , etc symbol denoting graph
<type> : digraph(directional), graph specifying the type of graph
<Node> : each node present inside the graph
<id> : a visual id for the node, can be name or digit
<unq id> : a unique id to be used later in joining edges.
<color> : node color
<style> : just a generalised definition for all the less required
attributes like text size, etc
<Edge> : contains all the edges and shows how they are interconnected
<Nodes>: a comma seperated parameter which will speficy the two nodes
connect.
In case of directed graph the parser will assume it to be first points to
the second. Eg: for a and b nodes it will be as a,b and when its directed
it will be as a,b but interpreted as a->b
<color> : color of the edge
<wieght> : wieght of the edge
<style> : other less important attributes.
An example
<Graph>
<Node>
<id>A</id>
<color> blue </color>
</Node>
<Node>
<id>B</id>
<color> blue </color>
</Node>
<Node>
<id>C</id
<color> blue </color>
</Node>
<Edge>
<color>
<connect>
A,B
</connect>
blue
</color>
</Edge>
</Graph>
This above parser can be realised using spirit boost library as used in
rocs/libgraphtheory/fileformats/grammer files
Looking forward for everyone's reply on what changes are required.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-soc/attachments/20200121/45ac80c0/attachment.html>
More information about the Kde-soc
mailing list