OpenWalnut
1.4.0
|
This namespace contains the WStructuredTextParser data types and the parser. More...
Classes | |
struct | KeyValueType |
KeyValueType - a tuple containing name and value. More... | |
struct | ObjectType |
An object is always a name and contains several further nodes. More... | |
struct | Grammar |
The grammar describing the structured format. More... | |
class | StructuredValueTree |
This simplifies working with a tree in a WStructuredTextParser::FileType instance. More... | |
class | IsLeafVisitor |
Visitor to identify whether the given variant of type WStructuredTextParser::MemberType is a object or key-value pair. More... | |
class | IsCommentVisitor |
Visitor to identify whether the given variant of type WStructuredTextParser::MemberType is a comment. More... | |
class | NameQueryVisitor |
Visitor to query the m_name member of WStructuredTextParser::ObjectType and WStructuredTextParser::KeyValueType. More... | |
Typedefs | |
typedef std::string | KeyType |
we use these quite often, so define some short alias for them: | |
typedef std::string | ValueType |
The type used for values. | |
typedef std::string | CommentType |
The type used for comments. | |
typedef boost::variant < boost::recursive_wrapper < ObjectType >, KeyValueType, CommentType > | MemberType |
A node inside the AST is either another object or a key-value pair. | |
typedef std::vector< MemberType > | FileType |
An object representing all objects and comments on file level. | |
Functions | |
FileType | parseFromString (std::string input) |
Parse the given input and return the syntax tree. | |
FileType | parseFromFile (boost::filesystem::path path) |
Parse the given input and return the syntax tree. |
This namespace contains the WStructuredTextParser data types and the parser.
It builds up the abstract syntax tree (AST) for the given input which later can be traversed.
typedef std::string WStructuredTextParser::CommentType |
The type used for comments.
Definition at line 85 of file WStructuredTextParser.h.
typedef std::vector< MemberType > WStructuredTextParser::FileType |
An object representing all objects and comments on file level.
Definition at line 137 of file WStructuredTextParser.h.
typedef std::string WStructuredTextParser::KeyType |
we use these quite often, so define some short alias for them:
we use these quite often, so define some short alias for them: we use these quite often, so define some short alias for them: we use these quite often, so define some short alias for them: we use these quite often, so define some short alias for them: The type used for keys
Definition at line 75 of file WStructuredTextParser.h.
typedef boost::variant< boost::recursive_wrapper< ObjectType >, KeyValueType, CommentType > WStructuredTextParser::MemberType |
A node inside the AST is either another object or a key-value pair.
Definition at line 116 of file WStructuredTextParser.h.
typedef std::string WStructuredTextParser::ValueType |
The type used for values.
Definition at line 80 of file WStructuredTextParser.h.
FileType WStructuredTextParser::parseFromFile | ( | boost::filesystem::path | path | ) |
Parse the given input and return the syntax tree.
Throws an exception WParseError on error.
path | the file to parse |
WParseError | on parse error |
WFileNotFOund | in case the specified file could not be opened |
Definition at line 216 of file WStructuredTextParser.cpp.
Referenced by WStructuredTextParserTest::testParseFromFile().
FileType WStructuredTextParser::parseFromString | ( | std::string | input | ) |
Parse the given input and return the syntax tree.
Throws an exception WParseError on error.
input | the input to parse. |
WParseError | on parse error |
Definition at line 195 of file WStructuredTextParser.cpp.