Graph grammar rule parser. More...
#include <Rule_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 | |
| Rule_GML_grammar (Rule::CoreGraph &toFill, std::string &ruleID, std::vector< sgm::Pattern_Interface::Match_Constraint * > &ruleConstraints, Rule::CopyAndPasteOperations ©AndPaste, std::string &wildcard) | |
Static Public Member Functions | |
| static std::pair< Rule, int > | parseRule (const std::string &GML_string) throw (Rule_GML_error) |
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, STRLST_VAL = 4 } |
| 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 |
Static Protected Member Functions | |
| static std::string | trimQuotes (const std::string &s) |
Protected Attributes | |
| Rule::CopyAndPasteOperations & | copyAndPaste |
| The copy-and-Paste operation container to be filled. More... | |
| boost::property_map < Rule::CoreGraph, Rule::EdgeContextProperty > ::type | edgeContext |
| Access to the edge Rule context property_map of g2fill. More... | |
| boost::property_map < Rule::CoreGraph, Rule::EdgeLabelProperty > ::type | edgeLabel |
| Access to the edge label property_map of g2fill to set edge labels. More... | |
| Rule::CoreGraph & | g2fill |
| boost::property_map < Rule::CoreGraph, Rule::NodeContextProperty > ::type | nodeContext |
| Access to the node Rule context property_map of g2fill. More... | |
| boost::property_map < Rule::CoreGraph, Rule::NodeLabelProperty > ::type | nodeLabel |
| Access to the node label property_map of g2fill to set node labels. More... | |
| boost::property_map < Rule::CoreGraph, Rule::NodeRightLabelProperty > ::type | nodeLabelRight |
| std::vector < sgm::Pattern_Interface::Match_Constraint * > & | ruleConstraints |
| The additional constraints to be fulfilled by the rule to be filled. More... | |
| std::string & | ruleID |
| The rule id that is filled. More... | |
| std::string & | wildcard |
| The wildcard label that is filled if present. More... | |
Parses a GML string representation of a ggl::Rule object. Example :
====== RULE TO ENCODE =======================
3(D) -1- 1(B) 3(E) -1- 1(B)
| / | |
2 3 ==> 4 3
| / | |
2(C) -0- 0(A) 2(C) 4(D)
======= RULE IN GML =========================
rule [
ruleID "Example rule"
context [
node [ id 1 label "B" ]
node [ id 2 label "C" ]
edge [ source 1 target 3 label "-1-" ]
]
left [
node [ id 0 label "A" ]
node [ id 3 label "D" ]
edge [ source 0 target 2 label "-0-" ]
edge [ source 1 target 2 label "-3-" ]
edge [ source 2 target 3 label "-2-" ]
]
right [
node [ id 3 label "E" ]
node [ id 4 label "D" ]
edge [ source 2 target 3 label "-4-" ]
edge [ source 1 target 4 label "-3-" ]
]
]
=============================================
* 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 | operator | list
real ::= sign? digit '.' digit+ mantissa
integer ::= sign? digit+
string ::= '"' instring '"'
operator ::= '>' | '<' | '=' | '!'
list ::= '[' keyvalues ']'
sign ::= '+' | '-'
digit ::= ['0'-'9']
mantissa ::= ('E' | 'e') sign? digit+
instring ::= ASCII-{'&', '"'} | '&' ['a'-'z''A'-'Z'] ';'
*
Definition at line 117 of file Rule_GML_grammar.hh.
|
protected |
Definition at line 136 of file Rule_GML_grammar.hh.
|
protected |
Definition at line 145 of file Rule_GML_grammar.hh.
|
protected |
Definition at line 135 of file Rule_GML_grammar.hh.
|
protected |
Definition at line 137 of file Rule_GML_grammar.hh.
|
protected |
| Enumerator | |
|---|---|
| Y_CONTXT | |
| N_CONTXT | |
| UNKNOWN | |
| INT_VAL | |
| STR_VAL | |
| DBL_VAL | |
| LST_VAL | |
| STRLST_VAL | |
Definition at line 123 of file Rule_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 Rule core graph object to add nodes and edges to |
| ruleID | the Rule ID to set |
| ruleConstraints | the additional constraints that have to be met by the rule |
| copyAndPaste | the copy-and-Paste operation container to fill |
| wildcard | the wildcard string to be filled. NOTE: if no wildcard was parsed this string is not changed, so check for a change to know if a wildcard was parsed or not! |
|
static |
Parses a GML string and generates a Rule object
| GML_string | the string to parse |
| ggl::Rule_GML_error | if parsing errors occur |
|
staticprotected |
Trims leading and tailing quotes from a string
| s | the string to trim |
|
protected |
Definition at line 248 of file Rule_GML_grammar.hh.
|
mutableprotected |
Definition at line 282 of file Rule_GML_grammar.hh.
|
mutableprotected |
Definition at line 276 of file Rule_GML_grammar.hh.
|
protected |
The boost core graph object that is filled to represent the next parsed Rule.
Definition at line 239 of file Rule_GML_grammar.hh.
|
mutableprotected |
Definition at line 270 of file Rule_GML_grammar.hh.
|
mutableprotected |
Definition at line 257 of file Rule_GML_grammar.hh.
|
mutableprotected |
Access to the right node label property_map of g2fill to set changing node labels
Definition at line 264 of file Rule_GML_grammar.hh.
|
protected |
Definition at line 245 of file Rule_GML_grammar.hh.
|
protected |
Definition at line 242 of file Rule_GML_grammar.hh.
|
protected |
Definition at line 251 of file Rule_GML_grammar.hh.