rcl  master
C API providing common ROS client library functionality.
lexer.h
1 // Copyright 2018 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef RCL__LEXER_H_
16 #define RCL__LEXER_H_
17 
18 #include <stddef.h>
19 
20 #include "rcl/allocator.h"
21 #include "rcl/macros.h"
22 #include "rcl/types.h"
23 #include "rcl/visibility_control.h"
24 
25 #if __cplusplus
26 extern "C"
27 {
28 #endif
29 
31 typedef enum rcl_lexeme_t
32 {
34  RCL_LEXEME_NONE = 0,
36  RCL_LEXEME_EOF = 1,
38  RCL_LEXEME_TILDE_SLASH = 2,
40  RCL_LEXEME_URL_SERVICE = 3,
42  RCL_LEXEME_URL_TOPIC = 4,
44  RCL_LEXEME_COLON = 5,
46  RCL_LEXEME_NODE = 6,
48  RCL_LEXEME_NS = 7,
50  RCL_LEXEME_SEPARATOR = 8,
52  RCL_LEXEME_BR1 = 9,
54  RCL_LEXEME_BR2 = 10,
56  RCL_LEXEME_BR3 = 11,
58  RCL_LEXEME_BR4 = 12,
60  RCL_LEXEME_BR5 = 13,
62  RCL_LEXEME_BR6 = 14,
64  RCL_LEXEME_BR7 = 15,
66  RCL_LEXEME_BR8 = 16,
68  RCL_LEXEME_BR9 = 17,
70  RCL_LEXEME_TOKEN = 18,
72  RCL_LEXEME_FORWARD_SLASH = 19,
74  RCL_LEXEME_WILD_ONE = 20,
76  RCL_LEXEME_WILD_MULTI = 21,
77  // TODO(hidmic): remove when parameter names are standardized to
78  // use slashes in lieu of dots
80  RCL_LEXEME_DOT = 22,
81 } rcl_lexeme_t;
82 
83 
85 
106 RCL_PUBLIC
107 RCL_WARN_UNUSED
108 rcl_ret_t
109 rcl_lexer_analyze(
110  const char * text,
111  rcl_lexeme_t * lexeme,
112  size_t * length);
113 
114 #if __cplusplus
115 }
116 #endif
117 
118 #endif // RCL__LEXER_H_