Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
variant_topic_tools::MessageDefinitionParser Class Reference

Message definition parser. More...

#include <MessageDefinitionParser.h>

Static Public Member Functions

static bool match (const std::string &expression, std::string &name, std::string &type)
 Match any message member expression. More...
 
static bool matchArray (const std::string &expression, std::string &name, std::string &memberType, size_t &size)
 Match an array message member expression. More...
 
static bool matchArrayType (const std::string &expression, std::string &memberType, size_t &size)
 Match an array type expression. More...
 
static bool matchConstant (const std::string &expression, std::string &name, std::string &type, std::string &value)
 Match a constant message member expression. More...
 
static bool matchSeparator (const std::string &expression)
 Match a separator expression. More...
 
static bool matchType (const std::string &expression)
 Match any message type expression. More...
 
static bool matchVariable (const std::string &expression, std::string &name, std::string &type)
 Match a variable message member expression. More...
 
static size_t parse (const std::string &messageDataType, const std::string &messageDefinition, std::vector< MessageType > &messageTypes)
 Parse a message definition and generate the message types. More...
 

Private Member Functions

 MessageDefinitionParser ()
 Default constructor. More...
 
 ~MessageDefinitionParser ()
 Destructor. More...
 

Static Private Attributes

static const boost::regex arrayMemberExpression
 Regular expression for matching an array message member. More...
 
static const boost::regex commentExpression
 Regular expression for matching a comment. More...
 
static const boost::regex constantMemberExpression
 Regular expression for matching a constant message member. More...
 
static const boost::regex constantStringMemberExpression
 Regular expression for matching a constant string message member. More...
 
static const boost::regex memberArrayTypeExpression
 Regular expression for matching an array message member type. More...
 
static const boost::regex memberExpression
 Regular expression for matching any message member. More...
 
static const boost::regex memberNameExpression
 Regular expression for matching a message member name. More...
 
static const boost::regex memberTypeExpression
 Regular expression for matching any message member type. More...
 
static const boost::regex memberValueExpression
 Regular expression for matching a message member value. More...
 
static const boost::regex messageTypeExpression
 Regular expression for matching a message type definition. More...
 
static const boost::regex separatorExpression
 Regular expression for matching a message type separator. More...
 
static const boost::regex variableMemberExpression
 Regular expression for matching a variable message member. More...
 

Detailed Description

Message definition parser.

Definition at line 37 of file MessageDefinitionParser.h.

Constructor & Destructor Documentation

variant_topic_tools::MessageDefinitionParser::MessageDefinitionParser ( )
private

Default constructor.

Definition at line 75 of file MessageDefinitionParser.cpp.

variant_topic_tools::MessageDefinitionParser::~MessageDefinitionParser ( )
private

Destructor.

Definition at line 78 of file MessageDefinitionParser.cpp.

Member Function Documentation

bool variant_topic_tools::MessageDefinitionParser::match ( const std::string &  expression,
std::string &  name,
std::string &  type 
)
static

Match any message member expression.

Definition at line 143 of file MessageDefinitionParser.cpp.

bool variant_topic_tools::MessageDefinitionParser::matchArray ( const std::string &  expression,
std::string &  name,
std::string &  memberType,
size_t &  size 
)
static

Match an array message member expression.

Definition at line 189 of file MessageDefinitionParser.cpp.

bool variant_topic_tools::MessageDefinitionParser::matchArrayType ( const std::string &  expression,
std::string &  memberType,
size_t &  size 
)
static

Match an array type expression.

Definition at line 124 of file MessageDefinitionParser.cpp.

bool variant_topic_tools::MessageDefinitionParser::matchConstant ( const std::string &  expression,
std::string &  name,
std::string &  type,
std::string &  value 
)
static

Match a constant message member expression.

Definition at line 158 of file MessageDefinitionParser.cpp.

bool variant_topic_tools::MessageDefinitionParser::matchSeparator ( const std::string &  expression)
static

Match a separator expression.

Definition at line 209 of file MessageDefinitionParser.cpp.

bool variant_topic_tools::MessageDefinitionParser::matchType ( const std::string &  expression)
static

Match any message type expression.

Definition at line 119 of file MessageDefinitionParser.cpp.

bool variant_topic_tools::MessageDefinitionParser::matchVariable ( const std::string &  expression,
std::string &  name,
std::string &  type 
)
static

Match a variable message member expression.

Definition at line 174 of file MessageDefinitionParser.cpp.

size_t variant_topic_tools::MessageDefinitionParser::parse ( const std::string &  messageDataType,
const std::string &  messageDefinition,
std::vector< MessageType > &  messageTypes 
)
static

Parse a message definition and generate the message types.

Definition at line 85 of file MessageDefinitionParser.cpp.

Member Data Documentation

const boost::regex variant_topic_tools::MessageDefinitionParser::arrayMemberExpression
staticprivate
Initial value:
=
boost::regex("^\\h*"+memberArrayTypeExpression.str()+"\\h+("+
memberNameExpression.str()+")\\h*("+commentExpression.str()+")?$")

Regular expression for matching an array message member.

Definition at line 125 of file MessageDefinitionParser.h.

const boost::regex variant_topic_tools::MessageDefinitionParser::commentExpression
staticprivate
Initial value:
=
boost::regex("#.*$")

Regular expression for matching a comment.

Definition at line 80 of file MessageDefinitionParser.h.

const boost::regex variant_topic_tools::MessageDefinitionParser::constantMemberExpression
staticprivate
Initial value:
=
boost::regex("^\\h*("+memberTypeExpression.str()+")\\h+("+
memberNameExpression.str()+")\\h*=\\h*("+memberValueExpression.str()+
")\\h*("+commentExpression.str()+")?$")

Regular expression for matching a constant message member.

Definition at line 112 of file MessageDefinitionParser.h.

const boost::regex variant_topic_tools::MessageDefinitionParser::constantStringMemberExpression
staticprivate
Initial value:
=
boost::regex("^\\h*(string)\\h+("+memberNameExpression.str()+
")\\h*=\\h*(.*?)\\h*$")

Regular expression for matching a constant string message member.

Definition at line 117 of file MessageDefinitionParser.h.

const boost::regex variant_topic_tools::MessageDefinitionParser::memberArrayTypeExpression
staticprivate
Initial value:
=
boost::regex("("+memberTypeExpression.str()+")\\[([0-9]*)\\]")

Regular expression for matching an array message member type.

Definition at line 100 of file MessageDefinitionParser.h.

const boost::regex variant_topic_tools::MessageDefinitionParser::memberExpression
staticprivate
Initial value:
=
boost::regex("^\\h*("+memberTypeExpression.str()+")(\\[[0-9]*\\])?\\h+("+
memberNameExpression.str()+").*$")

Regular expression for matching any message member.

Definition at line 108 of file MessageDefinitionParser.h.

const boost::regex variant_topic_tools::MessageDefinitionParser::memberNameExpression
staticprivate
Initial value:
=
boost::regex("[a-zA-Z][a-zA-Z0-9_]*")

Regular expression for matching a message member name.

Definition at line 92 of file MessageDefinitionParser.h.

const boost::regex variant_topic_tools::MessageDefinitionParser::memberTypeExpression
staticprivate
Initial value:
=
boost::regex("[a-zA-Z][a-zA-Z0-9_/]*")

Regular expression for matching any message member type.

Definition at line 96 of file MessageDefinitionParser.h.

const boost::regex variant_topic_tools::MessageDefinitionParser::memberValueExpression
staticprivate
Initial value:
=
boost::regex("[^\\h]+")

Regular expression for matching a message member value.

Definition at line 104 of file MessageDefinitionParser.h.

const boost::regex variant_topic_tools::MessageDefinitionParser::messageTypeExpression
staticprivate
Initial value:
=
boost::regex("^\\h*MSG:\\h*([a-zA-Z][a-zA-Z0-9_/]*).*$")

Regular expression for matching a message type definition.

Definition at line 88 of file MessageDefinitionParser.h.

const boost::regex variant_topic_tools::MessageDefinitionParser::separatorExpression
staticprivate
Initial value:
=
boost::regex("^==+$")

Regular expression for matching a message type separator.

Definition at line 84 of file MessageDefinitionParser.h.

const boost::regex variant_topic_tools::MessageDefinitionParser::variableMemberExpression
staticprivate
Initial value:
=
boost::regex("^\\h*("+memberTypeExpression.str()+")(\\[[0-9]*\\])?\\h+("+
memberNameExpression.str()+")\\h*("+commentExpression.str()+")?$")

Regular expression for matching a variable message member.

Definition at line 121 of file MessageDefinitionParser.h.


The documentation for this class was generated from the following files:


variant_topic_tools
Author(s): Ralf Kaestner
autogenerated on Sat Jan 9 2021 03:56:50