MessageDefinitionParser.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (C) 2014 by Ralf Kaestner *
3  * ralf.kaestner@gmail.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the Lesser GNU General Public License as published by*
7  * the Free Software Foundation; either version 3 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * Lesser GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the Lesser GNU General Public License *
16  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17  ******************************************************************************/
18 
23 #ifndef VARIANT_TOPIC_TOOLS_MESSAGE_DEFINITION_PARSER_H
24 #define VARIANT_TOPIC_TOOLS_MESSAGE_DEFINITION_PARSER_H
25 
26 #include <vector>
27 
28 #include <boost/regex.hpp>
29 
30 #include <ros/ros.h>
31 
33 
34 namespace variant_topic_tools {
38  public:
41  static size_t parse(const std::string& messageDataType, const std::string&
42  messageDefinition, std::vector<MessageType>& messageTypes);
43 
46  static bool matchType(const std::string& expression);
47 
50  static bool matchArrayType(const std::string& expression, std::string&
51  memberType, size_t& size);
52 
55  static bool match(const std::string& expression, std::string& name,
56  std::string& type);
57 
60  static bool matchConstant(const std::string& expression, std::string&
61  name, std::string& type, std::string& value);
62 
65  static bool matchVariable(const std::string& expression, std::string&
66  name, std::string& type);
67 
70  static bool matchArray(const std::string& expression, std::string& name,
71  std::string& memberType, size_t& size);
72 
75  static bool matchSeparator(const std::string& expression);
76 
77  private:
80  static const boost::regex commentExpression;
81 
84  static const boost::regex separatorExpression;
85 
88  static const boost::regex messageTypeExpression;
89 
92  static const boost::regex memberNameExpression;
93 
96  static const boost::regex memberTypeExpression;
97 
100  static const boost::regex memberArrayTypeExpression;
101 
104  static const boost::regex memberValueExpression;
105 
108  static const boost::regex memberExpression;
109 
112  static const boost::regex constantMemberExpression;
113 
117  static const boost::regex constantStringMemberExpression;
118 
121  static const boost::regex variableMemberExpression;
122 
125  static const boost::regex arrayMemberExpression;
126 
130 
134  };
135 };
136 
137 #endif
static bool matchConstant(const std::string &expression, std::string &name, std::string &type, std::string &value)
Match a constant message member expression.
static bool match(const std::string &expression, std::string &name, std::string &type)
Match any message member expression.
variant_topic_tools::MessageDefinition messageDefinition
Definition: info.cpp:30
static bool matchSeparator(const std::string &expression)
Match a separator expression.
static const boost::regex constantStringMemberExpression
Regular expression for matching a constant string message member.
static bool matchArray(const std::string &expression, std::string &name, std::string &memberType, size_t &size)
Match an array message member expression.
static const boost::regex messageTypeExpression
Regular expression for matching a message type definition.
static const boost::regex constantMemberExpression
Regular expression for matching a constant message member.
static bool matchArrayType(const std::string &expression, std::string &memberType, size_t &size)
Match an array type expression.
static const boost::regex variableMemberExpression
Regular expression for matching a variable message member.
static const boost::regex memberNameExpression
Regular expression for matching a message member name.
static const boost::regex commentExpression
Regular expression for matching a comment.
static bool matchType(const std::string &expression)
Match any message type 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.
static const boost::regex separatorExpression
Regular expression for matching a message type separator.
static const boost::regex memberValueExpression
Regular expression for matching a message member value.
static const boost::regex arrayMemberExpression
Regular expression for matching an array 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.
Header file providing the MessageType class interface.
static bool matchVariable(const std::string &expression, std::string &name, std::string &type)
Match a variable message member expression.
static const boost::regex memberTypeExpression
Regular expression for matching any message member type.


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