Drizzled Public API Documentation

pars0pars.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (C) 1996, 2010, Innobase Oy. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
8 
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15 St, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
26 #pragma once
27 #ifndef pars0pars_h
28 #define pars0pars_h
29 
30 #include "univ.i"
31 #include "que0types.h"
32 #include "usr0types.h"
33 #include "pars0types.h"
34 #include "row0types.h"
35 #include "trx0types.h"
36 #include "ut0vec.h"
37 
42 typedef void* (*pars_user_func_cb_t)(void* arg, void* user_arg);
43 
46 extern int yydebug;
47 
48 #ifdef UNIV_SQL_DEBUG
49 
51 extern ibool pars_print_lexed;
52 #endif /* UNIV_SQL_DEBUG */
53 
54 /* Global variable used while parsing a single procedure or query : the code is
55 NOT re-entrant */
56 extern sym_tab_t* pars_sym_tab_global;
57 
58 extern pars_res_word_t pars_to_char_token;
59 extern pars_res_word_t pars_to_number_token;
60 extern pars_res_word_t pars_to_binary_token;
61 extern pars_res_word_t pars_binary_to_number_token;
62 extern pars_res_word_t pars_substr_token;
63 extern pars_res_word_t pars_replstr_token;
64 extern pars_res_word_t pars_concat_token;
65 extern pars_res_word_t pars_length_token;
66 extern pars_res_word_t pars_instr_token;
67 extern pars_res_word_t pars_sysdate_token;
68 extern pars_res_word_t pars_printf_token;
69 extern pars_res_word_t pars_assert_token;
70 extern pars_res_word_t pars_rnd_token;
71 extern pars_res_word_t pars_rnd_str_token;
72 extern pars_res_word_t pars_count_token;
73 extern pars_res_word_t pars_sum_token;
74 extern pars_res_word_t pars_distinct_token;
75 extern pars_res_word_t pars_binary_token;
76 extern pars_res_word_t pars_blob_token;
77 extern pars_res_word_t pars_int_token;
78 extern pars_res_word_t pars_char_token;
79 extern pars_res_word_t pars_float_token;
80 extern pars_res_word_t pars_update_token;
81 extern pars_res_word_t pars_asc_token;
82 extern pars_res_word_t pars_desc_token;
83 extern pars_res_word_t pars_open_token;
84 extern pars_res_word_t pars_close_token;
85 extern pars_res_word_t pars_share_token;
86 extern pars_res_word_t pars_unique_token;
87 extern pars_res_word_t pars_clustered_token;
88 
89 extern ulint pars_star_denoter;
90 
91 /* Procedure parameter types */
92 #define PARS_INPUT 0
93 #define PARS_OUTPUT 1
94 #define PARS_NOT_PARAM 2
95 
96 int
97 yyparse(void);
98 
99 /*************************************************************/
102 UNIV_INTERN
103 que_t*
104 pars_sql(
105 /*=====*/
106  pars_info_t* info,
107  const char* str);
108 /*************************************************************/
110 #ifdef __cplusplus
111 extern "C"
112 #endif
113 UNIV_INTERN
114 void
116 /*===============*/
117  char* buf,
118  int* result,
119  int max_size);
121 /*************************************************************/
123 UNIV_INTERN
124 void
125 yyerror(
126 /*====*/
127  const char* s);
128 /*********************************************************************/
131 UNIV_INTERN
132 sym_node_t*
134 /*======================*/
135  sym_node_t* node,
137  pars_res_word_t* type);
138 /*********************************************************************/
141 UNIV_INTERN
143 pars_func(
144 /*======*/
145  que_node_t* res_word,
146  que_node_t* arg);
147 /*********************************************************************/
150 UNIV_INTERN
152 pars_op(
153 /*====*/
154  int func,
155  que_node_t* arg1,
156  que_node_t* arg2);
158 /*********************************************************************/
161 UNIV_INTERN
164 /*==========*/
165  sym_node_t* column,
166  pars_res_word_t* asc);
167 /*********************************************************************/
171 UNIV_INTERN
172 sel_node_t*
174 /*=============*/
175  que_node_t* select_list,
176  sym_node_t* into_list);
177 /*********************************************************************/
180 UNIV_INTERN
181 que_node_t*
183 /*====================*/
184  sym_node_t* sym_node,
186  sel_node_t* select_node);
187 /*********************************************************************/
190 UNIV_INTERN
191 que_node_t*
193 /*======================*/
194  sym_node_t* sym_node);
196 /*********************************************************************/
199 UNIV_INTERN
200 sel_node_t*
202 /*==================*/
203  sel_node_t* select_node,
205  sym_node_t* table_list,
206  que_node_t* search_cond,
207  pars_res_word_t* for_update,
208  pars_res_word_t* consistent_read,
210  order_node_t* order_by);
211 /*********************************************************************/
214 UNIV_INTERN
217 /*===================*/
218  sym_node_t* column,
219  que_node_t* exp);
220 /*********************************************************************/
223 UNIV_INTERN
224 upd_node_t*
226 /*========================*/
227  ibool is_delete,
228  sym_node_t* table_sym,
229  col_assign_node_t* col_assign_list);
231 /*********************************************************************/
234 UNIV_INTERN
235 upd_node_t*
237 /*==================*/
238  upd_node_t* node,
239  sym_node_t* cursor_sym,
241  que_node_t* search_cond);
242 /*********************************************************************/
245 UNIV_INTERN
246 ins_node_t*
248 /*==================*/
249  sym_node_t* table_sym,
250  que_node_t* values_list,
251  sel_node_t* select);
252 /*********************************************************************/
255 UNIV_INTERN
256 sym_node_t*
258 /*=======================*/
259  sym_node_t* node,
261  ulint param_type,
263  pars_res_word_t* type);
264 /*********************************************************************/
267 UNIV_INTERN
270 /*===============*/
271  que_node_t* cond,
272  que_node_t* stat_list);
273 /*********************************************************************/
276 UNIV_INTERN
277 if_node_t*
279 /*==============*/
280  que_node_t* cond,
281  que_node_t* stat_list,
282  que_node_t* else_part);
283 /*********************************************************************/
286 UNIV_INTERN
287 for_node_t*
289 /*===============*/
290  sym_node_t* loop_var,
291  que_node_t* loop_start_limit,
292  que_node_t* loop_end_limit,
293  que_node_t* stat_list);
294 /*********************************************************************/
297 UNIV_INTERN
300 /*=================*/
301  que_node_t* cond,
302  que_node_t* stat_list);
303 /*********************************************************************/
306 UNIV_INTERN
308 pars_exit_statement(void);
309 /*=====================*/
310 /*********************************************************************/
313 UNIV_INTERN
316 /*=======================*/
317 /*********************************************************************/
320 UNIV_INTERN
323 /*================*/
324  que_node_t* res_word,
325  que_node_t* args);
326 /*********************************************************************/
329 UNIV_INTERN
332 /*======================*/
333  sym_node_t* var,
334  que_node_t* val);
335 /*********************************************************************/
339 UNIV_INTERN
342 /*=================*/
343  sym_node_t* cursor,
344  sym_node_t* into_list,
345  sym_node_t* user_func);
346 /*********************************************************************/
349 UNIV_INTERN
352 /*================*/
353  ulint type,
355  sym_node_t* cursor);
356 /*********************************************************************/
359 UNIV_INTERN
362 /*======================*/
363  sel_node_t* sel_node);
364 /*********************************************************************/
367 UNIV_INTERN
370 /*=======================*/
371 /*********************************************************************/
374 UNIV_INTERN
377 /*=========================*/
378 /*********************************************************************/
381 UNIV_INTERN
382 sym_node_t*
384 /*============*/
385  sym_node_t* sym_node,
387  pars_res_word_t* type,
388  sym_node_t* len,
390  void* is_unsigned,
392  void* is_not_null);
394 /*********************************************************************/
397 UNIV_INTERN
398 tab_node_t*
400 /*==============*/
401  sym_node_t* table_sym,
403  sym_node_t* column_defs,
404  void* not_fit_in_memory);
414 /*********************************************************************/
417 UNIV_INTERN
418 ind_node_t*
420 /*==============*/
421  pars_res_word_t* unique_def,
422  pars_res_word_t* clustered_def,
423  sym_node_t* index_sym,
425  sym_node_t* table_sym,
427  sym_node_t* column_list);
428 /*********************************************************************/
431 UNIV_INTERN
432 que_fork_t*
434 /*======================*/
435  sym_node_t* sym_node,
437  sym_node_t* param_list,
438  que_node_t* stat_list);
440 /*************************************************************/
446 UNIV_INTERN
447 que_fork_t*
449 /*=======================*/
450  sym_node_t* sym_node);
451 /******************************************************************/
456 UNIV_INTERN
457 que_thr_t*
459 /*=========================*/
460  que_node_t* node,
462  trx_t* trx,
463  mem_heap_t* heap);
465 /****************************************************************/
468 UNIV_INTERN
470 pars_info_create(void);
471 /*==================*/
472 
473 /****************************************************************/
475 UNIV_INTERN
476 void
478 /*===========*/
479  pars_info_t* info);
481 /****************************************************************/
483 UNIV_INTERN
484 void
486 /*==================*/
487  pars_info_t* info,
488  const char* name,
489  const void* address,
490  ulint length,
491  ulint type,
492  ulint prtype);
495 /****************************************************************/
498 UNIV_INTERN
499 void
501 /*======================*/
502  pars_info_t* info,
503  const char* name,
504  const char* str);
506 /****************************************************************/
515 UNIV_INTERN
516 void
518 /*=======================*/
519  pars_info_t* info,
520  const char* name,
521  lint val);
523 /****************************************************************/
532 UNIV_INTERN
533 void
535 /*======================*/
536  pars_info_t* info,
537  const char* name,
538  ib_uint64_t val);
539 /****************************************************************/
541 UNIV_INTERN
542 void
544 /*===================*/
545  pars_info_t* info,
546  const char* name,
547  pars_user_func_cb_t func,
548  void* arg);
550 /****************************************************************/
552 UNIV_INTERN
553 void
555 /*=============*/
556  pars_info_t* info,
557  const char* name,
558  const char* id);
560 /****************************************************************/
563 UNIV_INTERN
566 /*====================*/
567  pars_info_t* info,
568  const char* name);
570 /****************************************************************/
573 UNIV_INTERN
576 /*====================*/
577  pars_info_t* info,
578  const char* name);
580 /****************************************************************/
583 UNIV_INTERN
586 /*===================*/
587  pars_info_t* info,
588  const char* name);
590 /******************************************************************/
592 #ifdef __cplusplus
593 extern "C"
594 #endif
595 UNIV_INTERN
596 void
597 pars_lexer_close(void);
598 /*==================*/
599 
613 };
614 
617  const char* name;
619  void* arg;
620 };
621 
624  const char* name;
625  const void* address;
626  ulint length;
627  ulint type;
628  ulint prtype;
629 };
630 
633  const char* name;
634  const char* id;
635 };
636 
639  int code;
641 };
642 
647  int func;
648  ulint func_class;
649  que_node_t* args;
650  UT_LIST_NODE_T(func_node_t) cond_list;
654  UT_LIST_NODE_T(func_node_t) func_node_list;
657 };
658 
663  ibool asc;
664 };
665 
669  sym_node_t* proc_id;
672  que_node_t* stat_list;
674 };
675 
679  que_node_t* cond;
680  que_node_t* stat_list;
681 };
682 
686  que_node_t* cond;
687  que_node_t* stat_list;
688  que_node_t* else_part;
690 };
691 
695  que_node_t* cond;
696  que_node_t* stat_list;
697 };
698 
702  sym_node_t* loop_var;
707  que_node_t* loop_start_limit;
708  que_node_t* loop_end_limit;
709  lint loop_end_value;
713  que_node_t* stat_list;
714 };
715 
719 };
720 
724 };
725 
730  que_node_t* val;
731 };
732 
737  que_node_t* val;
738 };
739 
741 /* @{ */
742 #define PARS_FUNC_ARITH 1
743 #define PARS_FUNC_LOGICAL 2
744 #define PARS_FUNC_CMP 3
745 #define PARS_FUNC_PREDEFINED 4
746 #define PARS_FUNC_AGGREGATE 5
747 #define PARS_FUNC_OTHER 6
749 /* @} */
750 
751 #ifndef UNIV_NONINL
752 #include "pars0pars.ic"
753 #endif
754 
755 #endif