]> git.proxmox.com Git - ceph.git/blame - ceph/src/jaegertracing/thrift/compiler/cpp/src/thrift/main.h
buildsys: switch source download to quincy
[ceph.git] / ceph / src / jaegertracing / thrift / compiler / cpp / src / thrift / main.h
CommitLineData
f67539c2
TL
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#ifndef T_MAIN_H
21#define T_MAIN_H
22
23#include <string>
24#include <cstdio>
25
26#include "thrift/logging.h"
27
28#include "thrift/parse/t_const.h"
29#include "thrift/parse/t_field.h"
30
31/**
32 * Defined in the flex library
33 */
34
35extern "C" { int yylex(void); }
36
37int yyparse(void);
38
39/**
40 * Expected to be defined by Flex/Bison
41 */
42void yyerror(const char* fmt, ...);
43
44/**
45 * Check simple identifier names
46 */
47void validate_simple_identifier(const char* identifier);
48
49/**
50 * Check constant types
51 */
52void validate_const_type(t_const* c);
53
54/**
55 * Check constant types
56 */
57void validate_field_value(t_field* field, t_const_value* cv);
58
59/**
60 * Check members of a throws block
61 */
62bool validate_throws(t_struct* throws);
63
64/**
65 * Converts a string filename into a thrift program name
66 */
67std::string program_name(std::string filename);
68
69/**
70 * Gets the directory path of a filename
71 */
72std::string directory_name(std::string filename);
73
74/**
75 * Get the absolute path for an include file
76 */
77std::string include_file(std::string filename);
78
79/**
80 * Clears any previously stored doctext string.
81 */
82void clear_doctext();
83
84/**
85 * Cleans up text commonly found in doxygen-like comments
86 */
87char* clean_up_doctext(char* doctext);
88
89/**
90 * We are sure the program doctext candidate is really the program doctext.
91 */
92void declare_valid_program_doctext();
93
94/**
95 * Emits a warning on list<byte>, binary type is typically a much better choice.
96 */
97void check_for_list_of_bytes(t_type* list_elem_type);
98
99/**
100 * Emits a one-time warning on byte type, promoting the new i8 type instead
101 */
102void emit_byte_type_warning();
103
104/**
105 * Prints deprecation notice for old NS declarations that are no longer supported
106 * If new_form is NULL, old_form is assumed to be a language identifier, such as "cpp"
107 * If new_form is not NULL, both arguments are used exactly as given
108 */
109void error_unsupported_namespace_decl(const char* old_form, const char* new_form = nullptr);
110
111/**
112 * Flex utilities
113 */
114
115extern int yylineno;
116extern char yytext[];
117extern std::FILE* yyin;
118
119#endif