CUBRID Engine  latest
csql_grammar_scan.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  * scanner_support.h - scanner support functions
22  */
23 
24 #ifndef _SCANNER_SUPPORT_H_
25 #define _SCANNER_SUPPORT_H_
26 
27 #ident "$Id$"
28 
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
34 
35 #define pt_orderbynum_compatibility(expr) pt_instnum_compatibility(expr)
36 
37 #define PICE(expr) \
38  do { \
39  if (parser_instnum_check == 1 && \
40  expr && !pt_instnum_compatibility(expr)) { \
41  PT_ERRORmf2(this_parser, expr, MSGCAT_SET_PARSER_SEMANTIC, \
42  MSGCAT_SEMANTIC_INSTNUM_COMPATIBILITY_ERR, \
43  "INST_NUM() or ROWNUM", "INST_NUM() or ROWNUM"); \
44  } \
45  if (parser_groupbynum_check == 1 && \
46  expr && !pt_groupbynum_compatibility(expr)) { \
47  PT_ERRORmf2(this_parser, expr, MSGCAT_SET_PARSER_SEMANTIC, \
48  MSGCAT_SEMANTIC_INSTNUM_COMPATIBILITY_ERR, \
49  "GROUPBY_NUM()", "GROUPBY_NUM()"); \
50  } \
51  if (parser_orderbynum_check == 1 && \
52  expr && !pt_orderbynum_compatibility(expr)) { \
53  PT_ERRORmf2(this_parser, expr, MSGCAT_SET_PARSER_SEMANTIC, \
54  MSGCAT_SEMANTIC_INSTNUM_COMPATIBILITY_ERR, \
55  "ORDERBY_NUM()", "ORDERBY_NUM()"); \
56  } \
57  } while (0)
58 
59  extern int parser_input_host_index;
60  extern int parser_output_host_index;
61  extern int parser_statement_OK;
63  extern PT_HINT parser_hint_table[];
64 
65  extern int pt_nextchar (void);
66  extern char *pt_makename (const char *name);
67  extern void pt_fix_left_parens (void);
68  extern void pt_check_hint (const char *text, PT_HINT hint_table[], PT_HINT_ENUM * result_hint,
69  bool prev_is_white_char);
70  extern void pt_get_hint (const char *text, PT_HINT hint_table[], PT_NODE * node);
71  extern void pt_cleanup_hint (PARSER_CONTEXT * parser, PT_HINT hint_table[]);
72 
73  extern void pt_parser_line_col (PT_NODE * node);
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif /* _SCANNER_SUPPORT_H_ */
PT_HINT parser_hint_table[]
int parser_input_host_index
char * pt_makename(const char *name)
int pt_nextchar(void)
PT_HINT_ENUM
Definition: parse_tree.h:1161
void pt_parser_line_col(PT_NODE *node)
SP_PARSER_CTX * parser
void pt_cleanup_hint(PARSER_CONTEXT *parser, PT_HINT hint_table[])
int parser_statement_OK
int parser_output_host_index
void pt_check_hint(const char *text, PT_HINT hint_table[], PT_HINT_ENUM *result_hint, bool prev_is_white_char)
PARSER_CONTEXT * this_parser
void pt_fix_left_parens(void)
void pt_get_hint(const char *text, PT_HINT hint_table[], PT_NODE *node)