OpenWalnut
1.4.0
|
The grammar describing the structured format. More...
#include <WStructuredTextParser.h>
Public Member Functions | |
Grammar (std::ostream &error) | |
Constructor and grammar description. | |
Public Attributes | |
qi::rule< Iterator, ObjectType(), ascii::space_type > | object |
Rule for objects. | |
qi::rule< Iterator, FileType(), ascii::space_type > | file |
Rule for files. | |
qi::rule< Iterator, CommentType(), ascii::space_type > | comment |
Rule for comments. | |
qi::rule< Iterator, KeyValueType(), ascii::space_type > | kvpair |
Key-value pair rule. | |
qi::rule< Iterator, KeyType() > | key |
Key rule. | |
qi::rule< Iterator, ValueType() > | value |
Value rule. |
The grammar describing the structured format.
It uses the boost::spirit features to parse the input. There are several rules to comply to successfully parse a file:
For more details please see the test fixture file in core/common/test/fixtures/WStrutcuredTextParser_test.txt.
Iterator | the iterator, used to get the input stream |
Definition at line 179 of file WStructuredTextParser.h.
WStructuredTextParser::Grammar< Iterator >::Grammar | ( | std::ostream & | error | ) | [inline, explicit] |
Constructor and grammar description.
It contains the EBNF (Extended Backus Naur Form) of the format we can parse.
error | Will contain error message if any occurs during functions execution |
Definition at line 186 of file WStructuredTextParser.h.
qi::rule< Iterator, CommentType(), ascii::space_type > WStructuredTextParser::Grammar< Iterator >::comment |
qi::rule< Iterator, FileType(), ascii::space_type > WStructuredTextParser::Grammar< Iterator >::file |
Rule for files.
Basically the same as an object but without name
Definition at line 230 of file WStructuredTextParser.h.
qi::rule< Iterator, KeyType() > WStructuredTextParser::Grammar< Iterator >::key |
Key rule.
See constructor for exact definition.
Definition at line 245 of file WStructuredTextParser.h.
qi::rule< Iterator, KeyValueType(), ascii::space_type > WStructuredTextParser::Grammar< Iterator >::kvpair |
Key-value pair rule.
See constructor for exact definition.
Definition at line 240 of file WStructuredTextParser.h.
qi::rule< Iterator, ObjectType(), ascii::space_type > WStructuredTextParser::Grammar< Iterator >::object |
Rule for objects.
Attribute is ObjectType and is the start rule of the grammar. See constructor for exact definition.
Definition at line 225 of file WStructuredTextParser.h.
qi::rule< Iterator, ValueType() > WStructuredTextParser::Grammar< Iterator >::value |
Value rule.
See constructor for exact definition.
Definition at line 250 of file WStructuredTextParser.h.