Graph GML parser. More...
#include <Graph_GML_grammar.hh>

Data Structures | |
| struct | definition |
| The definition of the GML grammar. More... | |
| class | keys_map |
| struct | keyvalue_closure |
| struct | lt_edge |
| struct | lt_node |
Public Member Functions | |
| Graph_GML_grammar (Graph &toFill) | |
Static Public Member Functions | |
| static std::pair< Graph, int > | parseGraph (const std::string &GML_string) |
Protected Types | |
| typedef boost::tuple< int, int, std::string, std::string > | edge_t |
| typedef std::map< std::string, kv_values_t > | keys_map_t |
| enum | kv_values { Y_CONTXT = -3, N_CONTXT = -2, UNKNOWN = -1, INT_VAL = 0, STR_VAL = 1, DBL_VAL = 2, LST_VAL = 3 } |
| enummeration of value types in gml key-value pairs More... | |
| typedef enum kv_values | kv_values_t |
| typedef boost::tuple< int, std::string, std::string > | node_t |
Protected Attributes | |
| boost::property_map< Graph, PropEdgeLabel >::type | edgeLabel |
| Access to the edge label property_map of g2fill to set edge labels. More... | |
| Graph & | g2fill |
| boost::property_map< Graph, PropNodeLabel >::type | nodeLabel |
| Access to the node label property_map of g2fill to set node labels. More... | |
Parses a GML string representation of a ggl::Graph object. Example :
====== GRAPH TO ENCODE =======================
3(D) -1- 1(B)
| /
2 3
| /
2(C) -0- 0(A)
======= GRAPH IN GML =========================
graph [
node [ id 0 label "A" ]
node [ id 1 label "B" ]
node [ id 2 label "C" ]
node [ id 3 label "D" ]
edge [ source 0 target 2 label "-0-" ]
edge [ source 1 target 3 label "-1-" ]
edge [ source 1 target 2 label "-3-" ]
edge [ source 2 target 3 label "-2-" ]
]
==============================================BNF grammar of GML (http://www.infosun.fim.uni-passau.de/Graphlet/GML/)
gml ::= keyvalues
keyvalues ::= keyvalue (keyvalue)
keyvalue ::= key value
key ::= ['a'-'z''A'-'Z']['a'-'z''A'-'Z''0'-'9']
value ::= real | integer | string | list
real ::= sign? digit '.' digit+ mantissa
integer ::= sign? digit+
string ::= '"' instring '"'
list ::= '[' keyvalues ']'
sign ::= '+' | '-'
digit ::= ['0'-'9']
mantissa ::= ('E' | 'e') sign? digit+
instring ::= ASCII-{'&', '"'} | '&' ['a'-'z''A'-'Z'] ';'
Definition at line 102 of file Graph_GML_grammar.hh.
|
protected |
Definition at line 133 of file Graph_GML_grammar.hh.
|
protected |
Definition at line 131 of file Graph_GML_grammar.hh.
|
protected |
Definition at line 119 of file Graph_GML_grammar.hh.
|
protected |
Definition at line 134 of file Graph_GML_grammar.hh.
|
protected |
| Enumerator | |
|---|---|
| Y_CONTXT | |
| N_CONTXT | |
| UNKNOWN | |
| INT_VAL | |
| STR_VAL | |
| DBL_VAL | |
| LST_VAL | |
Definition at line 108 of file Graph_GML_grammar.hh.
|
explicit |
Constructs the definitions of a GML graph grammar to parse a GML graph string representation and to fill the encoded graph into a given boost graph object.
| toFill | the graph object to add nodes and edges to |
|
static |
Parses a GML string and generates a Graph object
| GML_string | the string to parse |
|
mutableprotected |
Definition at line 223 of file Graph_GML_grammar.hh.
|
protected |
The boost core graph object that is filled to represent the next parsed Rule.
Definition at line 213 of file Graph_GML_grammar.hh.
|
mutableprotected |
Definition at line 218 of file Graph_GML_grammar.hh.