CUBRID Engine  latest
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 
40 typedef struct keyword_rec KEYWORD_REC;
41 
43 {
48 };
49 
51 {
54 };
55 
56 enum
57 {
78 
83 };
84 
86 {
87  const char *keyword;
88  short value;
89  short suppress_echo; /* Ignored for C keywords */
90 };
91 
92 typedef struct keyword_table
93 {
95  int size;
97 
98 
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_ */
enum scanner_mode previous_mode
KEYWORD_REC * keyword_array
static KEYWORD_RECORD keywords[]
Definition: keyword.c:41
struct scanner_mode_record * previous_record
const char * keyword
int check_identifier(KEYWORD_TABLE *keywords, char *name)
static enum scanner_mode mode
static SCANNER_MODE_RECORD * mode_stack
int check_c_identifier(char *name)
struct keyword_table KEYWORD_TABLE
scanner_mode
Definition: esql_misc.h:134