libcluon
0.0.148
|
#include <MessageParser.hpp>
Public Types | |
enum | MessageParserErrorCodes : uint8_t { NO_MESSAGEPARSER_ERROR = 0, SYNTAX_ERROR = 1, DUPLICATE_IDENTIFIERS = 2 } |
Public Member Functions | |
MessageParser ()=default | |
std::pair< std::vector< MetaMessage >, MessageParserErrorCodes > | parse (const std::string &input) |
This class provides a parser for message specifications in .odvd format. The format is inspired by Google Protobuf (https://developers.google.com/protocol-buffers/) but simplified to enforce backwards and forwards compatibility next to numerical message identifiers.
This message specification format is also used by OpenDaVINCI (http://code.opendavinci.org).
The parser is based on https://github.com/yhirose/cpp-peglib.
An example for a .odvd compliant message is demonstrated in the following:
enum cluon::MessageParser::MessageParserErrorCodes : uint8_t |
|
default |
std::pair< std::vector< MetaMessage >, MessageParser::MessageParserErrorCodes > cluon::MessageParser::parse | ( | const std::string & | input | ) |
This method tries to parse the given message specification.
input | Message specification. |
References ast, cluon::MetaMessage::messageIdentifier(), cluon::MetaMessage::messageName(), mm, cluon::MetaMessage::packageName(), and retVal.
Referenced by cluon::EnvelopeConverter::setMessageSpecification(), and cluon::LCMToGenericMessage::setMessageSpecification().