Static Public Member Functions | Private Member Functions | Static Private Attributes
variant_topic_tools::MessageDefinitionParser Class Reference

Message definition parser. More...

#include <MessageDefinitionParser.h>

List of all members.

Static Public Member Functions

static bool match (const std::string &expression, std::string &name, std::string &type)
 Match any message member expression.
static bool matchArray (const std::string &expression, std::string &name, std::string &memberType, size_t &size)
 Match an array message member expression.
static bool matchArrayType (const std::string &expression, std::string &memberType, size_t &size)
 Match an array type expression.
static bool matchConstant (const std::string &expression, std::string &name, std::string &type, std::string &value)
 Match a constant message member expression.
static bool matchSeparator (const std::string &expression)
 Match a separator expression.
static bool matchType (const std::string &expression)
 Match any message type expression.
static bool matchVariable (const std::string &expression, std::string &name, std::string &type)
 Match a variable message member expression.
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.

Private Member Functions

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

Static Private Attributes

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

Detailed Description

Message definition parser.

Definition at line 37 of file MessageDefinitionParser.h.


Constructor & Destructor Documentation

Default constructor.

Definition at line 75 of file MessageDefinitionParser.cpp.

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

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.

Initial value:
  boost::regex("#.*$")

Regular expression for matching a comment.

Definition at line 80 of file MessageDefinitionParser.h.

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.

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.

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.

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.

Initial value:
  boost::regex("[a-zA-Z][a-zA-Z1-9_]*")

Regular expression for matching a message member name.

Definition at line 92 of file MessageDefinitionParser.h.

Initial value:
  boost::regex("[a-zA-Z][a-zA-Z1-9_/]*")

Regular expression for matching any message member type.

Definition at line 96 of file MessageDefinitionParser.h.

Initial value:
  boost::regex("[^\\h]+")

Regular expression for matching a message member value.

Definition at line 104 of file MessageDefinitionParser.h.

Initial value:
  boost::regex("^\\h*MSG:\\h*([a-zA-Z][a-zA-Z1-9_/]*).*$")

Regular expression for matching a message type definition.

Definition at line 88 of file MessageDefinitionParser.h.

Initial value:
  boost::regex("^==+$")

Regular expression for matching a message type separator.

Definition at line 84 of file MessageDefinitionParser.h.

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 Tue Jul 9 2019 03:18:42