Program Listing for File lexer.h
↰ Return to documentation for file (include/rcl/lexer.h
)
// Copyright 2018 Open Source Robotics Foundation, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef RCL__LEXER_H_
#define RCL__LEXER_H_
#include <stddef.h>
#include "rcl/allocator.h"
#include "rcl/macros.h"
#include "rcl/types.h"
#include "rcl/visibility_control.h"
#if __cplusplus
extern "C"
{
#endif
typedef enum rcl_lexeme_e
{
RCL_LEXEME_NONE = 0,
RCL_LEXEME_EOF = 1,
RCL_LEXEME_TILDE_SLASH = 2,
RCL_LEXEME_URL_SERVICE = 3,
RCL_LEXEME_URL_TOPIC = 4,
RCL_LEXEME_COLON = 5,
RCL_LEXEME_NODE = 6,
RCL_LEXEME_NS = 7,
RCL_LEXEME_SEPARATOR = 8,
RCL_LEXEME_BR1 = 9,
RCL_LEXEME_BR2 = 10,
RCL_LEXEME_BR3 = 11,
RCL_LEXEME_BR4 = 12,
RCL_LEXEME_BR5 = 13,
RCL_LEXEME_BR6 = 14,
RCL_LEXEME_BR7 = 15,
RCL_LEXEME_BR8 = 16,
RCL_LEXEME_BR9 = 17,
RCL_LEXEME_TOKEN = 18,
RCL_LEXEME_FORWARD_SLASH = 19,
RCL_LEXEME_WILD_ONE = 20,
RCL_LEXEME_WILD_MULTI = 21,
// TODO(hidmic): remove when parameter names are standardized to
// use slashes in lieu of dots
RCL_LEXEME_DOT = 22,
} rcl_lexeme_t;
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_lexer_analyze(
const char * text,
rcl_lexeme_t * lexeme,
size_t * length);
#if __cplusplus
}
#endif
#endif // RCL__LEXER_H_