CUBRID Engine
latest
Main Page
Namespaces
Classes
Files
File List
File Members
esql_scanner_support.h
Go to the documentation of this file.
1
/*
2
* Copyright 2008 Search Solution Corporation
3
* Copyright 2016 CUBRID Corporation
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
*/
18
19
20
/*
21
* esql_scanner_support.h -
22
*/
23
24
#ifndef _ESQL_SCANNER_SUPPORT_H_
25
#define _ESQL_SCANNER_SUPPORT_H_
26
27
#ident "$Id$"
28
29
#include "
esql_misc.h
"
30
31
32
#define CHECK_LINENO \
33
do { \
34
if (need_line_directive) \
35
emit_line_directive(); \
36
} while (0)
37
38
39
typedef
struct
scanner_mode_record
SCANNER_MODE_RECORD
;
40
typedef
struct
keyword_rec
KEYWORD_REC
;
41
42
struct
scanner_mode_record
43
{
44
enum
scanner_mode
previous_mode
;
45
bool
recognize_keywords
;
46
bool
suppress_echo
;
47
struct
scanner_mode_record
*
previous_record
;
48
};
49
50
enum
scansup_msg
51
{
52
MSG_EMPTY_STACK
= 1,
53
MSG_NOT_PERMITTED
= 2
54
};
55
56
enum
57
{
58
MSG_DONT_KNOW
= 1,
59
MSG_CHECK_CORRECTNESS
,
60
MSG_USING_NOT_PERMITTED
,
61
MSG_CURSOR_UNDEFINED
,
62
MSG_PTR_TO_DESCR
,
63
MSG_PTR_TO_DB_OBJECT
,
64
MSG_CHAR_STRING
,
65
MSG_INDICATOR_NOT_ALLOWED
,
66
MSG_NOT_DECLARED
,
67
MSG_MUST_BE_SHORT
,
68
MSG_INCOMPLETE_DEF
,
69
MSG_NOT_VALID
,
70
MSG_TYPE_NOT_ACCEPTABLE
,
71
MSG_UNKNOWN_HV_TYPE
,
72
MSG_BAD_ADDRESS
,
73
MSG_DEREF_NOT_ALLOWED
,
74
MSG_NOT_POINTER
,
75
MSG_NOT_POINTER_TO_STRUCT
,
76
MSG_NOT_STRUCT
,
77
MSG_NO_FIELD
,
78
79
ESQL_MSG_STD_ERR
= 52,
80
ESQL_MSG_LEX_ERROR
= 53,
81
ESQL_MSG_SYNTAX_ERR1
= 54,
82
ESQL_MSG_SYNTAX_ERR2
= 55
83
};
84
85
struct
keyword_rec
86
{
87
const
char
*
keyword
;
88
short
value
;
89
short
suppress_echo
;
/* Ignored for C keywords */
90
};
91
92
typedef
struct
keyword_table
93
{
94
KEYWORD_REC
*
keyword_array
;
95
int
size
;
96
}
KEYWORD_TABLE
;
97
98
99
static
SCANNER_MODE_RECORD
*
mode_stack
;
100
static
enum
scanner_mode
mode
;
101
static
bool
recognize_keywords
;
102
static
bool
suppress_echo
=
false
;
103
104
#if defined (ENABLE_UNUSED_FUNCTION)
105
static
void
ignore_token (
void
);
106
static
void
count_embedded_newlines (
void
);
107
static
void
echo_string_constant (
const
char
*,
int
);
108
#endif
109
110
int
check_c_identifier
(
char
*name);
111
int
check_identifier
(
KEYWORD_TABLE
*
keywords
,
char
*name);
112
113
#endif
/* _ESQL_SCANNER_SUPPORT_H_ */
esql_misc.h
MSG_INCOMPLETE_DEF
Definition:
esql_scanner_support.h:68
MSG_EMPTY_STACK
Definition:
esql_scanner_support.h:52
keyword_table
Definition:
esql_scanner_support.h:92
MSG_NOT_PERMITTED
Definition:
esql_scanner_support.h:53
MSG_CURSOR_UNDEFINED
Definition:
esql_scanner_support.h:61
scanner_mode_record::previous_mode
enum scanner_mode previous_mode
Definition:
esql_scanner_support.h:44
keyword_table::keyword_array
KEYWORD_REC * keyword_array
Definition:
esql_scanner_support.h:94
MSG_NOT_DECLARED
Definition:
esql_scanner_support.h:66
keywords
static KEYWORD_RECORD keywords[]
Definition:
keyword.c:41
scanner_mode_record::previous_record
struct scanner_mode_record * previous_record
Definition:
esql_scanner_support.h:47
MSG_NOT_VALID
Definition:
esql_scanner_support.h:69
MSG_DEREF_NOT_ALLOWED
Definition:
esql_scanner_support.h:73
MSG_NO_FIELD
Definition:
esql_scanner_support.h:77
keyword_rec::keyword
const char * keyword
Definition:
esql_scanner_support.h:87
check_identifier
int check_identifier(KEYWORD_TABLE *keywords, char *name)
scansup_msg
scansup_msg
Definition:
esql_scanner_support.h:50
mode
static enum scanner_mode mode
Definition:
esql_scanner_support.h:100
ESQL_MSG_LEX_ERROR
Definition:
esql_scanner_support.h:80
MSG_CHECK_CORRECTNESS
Definition:
esql_scanner_support.h:59
mode_stack
static SCANNER_MODE_RECORD * mode_stack
Definition:
esql_scanner_support.h:99
MSG_NOT_POINTER
Definition:
esql_scanner_support.h:74
MSG_BAD_ADDRESS
Definition:
esql_scanner_support.h:72
check_c_identifier
int check_c_identifier(char *name)
MSG_NOT_POINTER_TO_STRUCT
Definition:
esql_scanner_support.h:75
KEYWORD_TABLE
struct keyword_table KEYWORD_TABLE
MSG_TYPE_NOT_ACCEPTABLE
Definition:
esql_scanner_support.h:70
MSG_UNKNOWN_HV_TYPE
Definition:
esql_scanner_support.h:71
MSG_MUST_BE_SHORT
Definition:
esql_scanner_support.h:67
ESQL_MSG_STD_ERR
Definition:
esql_scanner_support.h:79
MSG_INDICATOR_NOT_ALLOWED
Definition:
esql_scanner_support.h:65
keyword_rec::suppress_echo
short suppress_echo
Definition:
esql_scanner_support.h:89
scanner_mode_record::suppress_echo
bool suppress_echo
Definition:
esql_scanner_support.h:46
MSG_PTR_TO_DB_OBJECT
Definition:
esql_scanner_support.h:63
MSG_CHAR_STRING
Definition:
esql_scanner_support.h:64
ESQL_MSG_SYNTAX_ERR2
Definition:
esql_scanner_support.h:82
scanner_mode_record::recognize_keywords
bool recognize_keywords
Definition:
esql_scanner_support.h:45
MSG_NOT_STRUCT
Definition:
esql_scanner_support.h:76
keyword_table::size
int size
Definition:
esql_scanner_support.h:95
MSG_DONT_KNOW
Definition:
esql_scanner_support.h:58
keyword_rec
Definition:
esql_scanner_support.h:85
MSG_PTR_TO_DESCR
Definition:
esql_scanner_support.h:62
scanner_mode
scanner_mode
Definition:
esql_misc.h:134
MSG_USING_NOT_PERMITTED
Definition:
esql_scanner_support.h:60
scanner_mode_record
Definition:
esql_scanner_support.h:42
ESQL_MSG_SYNTAX_ERR1
Definition:
esql_scanner_support.h:81
keyword_rec::value
short value
Definition:
esql_scanner_support.h:88
src
executables
esql_scanner_support.h
Generated by
1.8.11