rcl
master
C API providing common ROS client library functionality.
include
rcl
lexer.h
Go to the documentation of this file.
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
16
17
#ifndef RCL__LEXER_H_
18
#define RCL__LEXER_H_
19
20
#include <stddef.h>
21
22
#include "
rcl/allocator.h
"
23
#include "rcl/macros.h"
24
#include "
rcl/types.h
"
25
#include "rcl/visibility_control.h"
26
27
#if __cplusplus
28
extern
"C"
29
{
30
#endif
31
33
typedef
enum
rcl_lexeme_t
34
{
36
RCL_LEXEME_NONE
= 0,
38
RCL_LEXEME_EOF
= 1,
40
RCL_LEXEME_TILDE_SLASH
= 2,
42
RCL_LEXEME_URL_SERVICE
= 3,
44
RCL_LEXEME_URL_TOPIC
= 4,
46
RCL_LEXEME_COLON
= 5,
48
RCL_LEXEME_NODE
= 6,
50
RCL_LEXEME_NS
= 7,
52
RCL_LEXEME_SEPARATOR
= 8,
54
RCL_LEXEME_BR1
= 9,
56
RCL_LEXEME_BR2
= 10,
58
RCL_LEXEME_BR3
= 11,
60
RCL_LEXEME_BR4
= 12,
62
RCL_LEXEME_BR5
= 13,
64
RCL_LEXEME_BR6
= 14,
66
RCL_LEXEME_BR7
= 15,
68
RCL_LEXEME_BR8
= 16,
70
RCL_LEXEME_BR9
= 17,
72
RCL_LEXEME_TOKEN
= 18,
74
RCL_LEXEME_FORWARD_SLASH
= 19,
76
RCL_LEXEME_WILD_ONE
= 20,
78
RCL_LEXEME_WILD_MULTI
= 21,
79
// TODO(hidmic): remove when parameter names are standardized to
80
// use slashes in lieu of dots
82
RCL_LEXEME_DOT
= 22,
83
}
rcl_lexeme_t
;
84
85
87
108
RCL_PUBLIC
109
RCL_WARN_UNUSED
110
rcl_ret_t
111
rcl_lexer_analyze
(
112
const
char
* text,
113
rcl_lexeme_t
* lexeme,
114
size_t
* length);
115
116
#if __cplusplus
117
}
118
#endif
119
120
#endif // RCL__LEXER_H_
RCL_LEXEME_WILD_ONE
@ RCL_LEXEME_WILD_ONE
Definition:
lexer.h:76
RCL_LEXEME_FORWARD_SLASH
@ RCL_LEXEME_FORWARD_SLASH
/
Definition:
lexer.h:74
RCL_LEXEME_TILDE_SLASH
@ RCL_LEXEME_TILDE_SLASH
~/
Definition:
lexer.h:40
rcl_lexeme_t
rcl_lexeme_t
Type of lexeme found by lexical analysis.
Definition:
lexer.h:33
types.h
rcl_ret_t
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition:
types.h:23
RCL_LEXEME_BR1
@ RCL_LEXEME_BR1
\1
Definition:
lexer.h:54
RCL_LEXEME_DOT
@ RCL_LEXEME_DOT
.
Definition:
lexer.h:82
RCL_LEXEME_BR5
@ RCL_LEXEME_BR5
\5
Definition:
lexer.h:62
RCL_LEXEME_NODE
@ RCL_LEXEME_NODE
__node or __name
Definition:
lexer.h:48
rcl_lexer_analyze
rcl_ret_t rcl_lexer_analyze(const char *text, rcl_lexeme_t *lexeme, size_t *length)
Do lexical analysis on a string.
RCL_LEXEME_BR4
@ RCL_LEXEME_BR4
\4
Definition:
lexer.h:60
RCL_LEXEME_URL_TOPIC
@ RCL_LEXEME_URL_TOPIC
rostopic://
Definition:
lexer.h:44
RCL_LEXEME_NONE
@ RCL_LEXEME_NONE
Indicates no valid lexeme was found (end of input not reached)
Definition:
lexer.h:36
RCL_LEXEME_SEPARATOR
@ RCL_LEXEME_SEPARATOR
:=
Definition:
lexer.h:52
RCL_LEXEME_BR7
@ RCL_LEXEME_BR7
\7
Definition:
lexer.h:66
RCL_LEXEME_EOF
@ RCL_LEXEME_EOF
Indicates end of input has been reached.
Definition:
lexer.h:38
RCL_LEXEME_TOKEN
@ RCL_LEXEME_TOKEN
a name between slashes, must match (([a-zA-Z](_)?)|_)([0-9a-zA-Z](_)?)*
Definition:
lexer.h:72
RCL_LEXEME_BR8
@ RCL_LEXEME_BR8
\8
Definition:
lexer.h:68
RCL_LEXEME_COLON
@ RCL_LEXEME_COLON
:
Definition:
lexer.h:46
allocator.h
RCL_LEXEME_WILD_MULTI
@ RCL_LEXEME_WILD_MULTI
**
Definition:
lexer.h:78
RCL_LEXEME_NS
@ RCL_LEXEME_NS
__ns
Definition:
lexer.h:50
RCL_LEXEME_BR2
@ RCL_LEXEME_BR2
\2
Definition:
lexer.h:56
RCL_LEXEME_BR3
@ RCL_LEXEME_BR3
\3
Definition:
lexer.h:58
RCL_LEXEME_URL_SERVICE
@ RCL_LEXEME_URL_SERVICE
rosservice://
Definition:
lexer.h:42
RCL_LEXEME_BR6
@ RCL_LEXEME_BR6
\6
Definition:
lexer.h:64
RCL_LEXEME_BR9
@ RCL_LEXEME_BR9
\9
Definition:
lexer.h:70
Generated by
1.8.17