1 /*****************************************************************************
2 
3 Copyright (c) 1996, 2018, Oracle and/or its affiliates. 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, version 2.0, as published by the
7 Free Software Foundation.
8 
9 This program is also distributed with certain software (including but not
10 limited to OpenSSL) that is licensed under separate terms, as designated in a
11 particular file or component or in included license documentation. The authors
12 of MySQL hereby grant you an additional permission to link the program and
13 your derivative works with the separately licensed software that they have
14 included with MySQL.
15 
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
19 for more details.
20 
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
24 
25 *****************************************************************************/
26 
27 /** @file include/pars0pars.h
28  SQL parser
29 
30  Created 11/19/1996 Heikki Tuuri
31  *******************************************************/
32 
33 #ifndef pars0pars_h
34 #define pars0pars_h
35 
36 #include "pars0types.h"
37 #include "que0types.h"
38 #include "row0mysql.h"
39 #include "row0types.h"
40 #include "trx0types.h"
41 #include "univ.i"
42 #include "usr0types.h"
43 #include "ut0vec.h"
44 
45 /** Type of the user functions. The first argument is always InnoDB-supplied
46 and varies in type, while 'user_arg' is a user-supplied argument. The
47 meaning of the return type also varies. See the individual use cases, e.g.
48 the FETCH statement, for details on them. */
49 typedef ibool (*pars_user_func_cb_t)(void *arg, void *user_arg);
50 
51 /** If the following is set TRUE, the parser will emit debugging
52 information */
53 extern int yydebug;
54 
55 /* Global variable used while parsing a single procedure or query : the code is
56 NOT re-entrant */
57 extern sym_tab_t *pars_sym_tab_global;
58 
59 /** Mutex to protect the sql parser */
60 extern ib_mutex_t pars_mutex;
61 
62 extern pars_res_word_t pars_to_binary_token;
63 extern pars_res_word_t pars_substr_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_count_token;
68 extern pars_res_word_t pars_sum_token;
69 extern pars_res_word_t pars_distinct_token;
70 extern pars_res_word_t pars_binary_token;
71 extern pars_res_word_t pars_blob_token;
72 extern pars_res_word_t pars_int_token;
73 extern pars_res_word_t pars_bigint_token;
74 extern pars_res_word_t pars_char_token;
75 extern pars_res_word_t pars_float_token;
76 extern pars_res_word_t pars_update_token;
77 extern pars_res_word_t pars_asc_token;
78 extern pars_res_word_t pars_desc_token;
79 extern pars_res_word_t pars_open_token;
80 extern pars_res_word_t pars_close_token;
81 extern pars_res_word_t pars_share_token;
82 extern pars_res_word_t pars_unique_token;
83 extern pars_res_word_t pars_clustered_token;
84 
85 extern ulint pars_star_denoter;
86 
87 /* Procedure parameter types */
88 #define PARS_INPUT 0
89 #define PARS_OUTPUT 1
90 #define PARS_NOT_PARAM 2
91 
92 int yyparse(void);
93 
94 /** Initialize for the internal parser */
95 void pars_init();
96 
97 /** Clean up the internal parser */
98 void pars_close();
99 
100 /** Parses an SQL string returning the query graph.
101  @return own: the query graph */
102 que_t *pars_sql(pars_info_t *info, /*!< in: extra information, or NULL */
103                 const char *str);  /*!< in: SQL string */
104 /** Retrieves characters to the lexical analyzer.
105  @return number of characters copied or 0 on EOF */
106 int pars_get_lex_chars(char *buf,        /*!< in/out: buffer where to copy */
107                        size_t max_size); /*!< in: maximum number of characters
108                                          which fit in the buffer */
109 /** Called by yyparse on error. */
110 void yyerror(const char *s); /*!< in: error message string */
111 /** Parses a variable declaration.
112  @return own: symbol table node of type SYM_VAR */
113 sym_node_t *pars_variable_declaration(
114     sym_node_t *node,       /*!< in: symbol table node allocated for the
115                             id of the variable */
116     pars_res_word_t *type); /*!< in: pointer to a type token */
117 /** Parses a function expression.
118  @return own: function node in a query tree */
119 func_node_t *pars_func(
120     que_node_t *res_word, /*!< in: function name reserved word */
121     que_node_t *arg);     /*!< in: first argument in the argument list */
122 /*************************************************************************
123 Rebind a LIKE search string. NOTE: We ignore any '%' characters embedded
124 within the search string.
125 @return own: function node in a query tree */
126 int pars_like_rebind(sym_node_t *node, /* in: The search string node.*/
127                      const byte *ptr,  /* in: literal to (re) bind */
128                      ulint len);       /* in: length of literal to (re) bind*/
129 /** Parses an operator expression.
130  @return own: function node in a query tree */
131 func_node_t *pars_op(int func,          /*!< in: operator token code */
132                      que_node_t *arg1,  /*!< in: first argument */
133                      que_node_t *arg2); /*!< in: second argument or NULL for an
134                                         unary operator */
135 /** Parses an ORDER BY clause. Order by a single column only is supported.
136  @return own: order-by node in a query tree */
137 order_node_t *pars_order_by(
138     sym_node_t *column,    /*!< in: column name */
139     pars_res_word_t *asc); /*!< in: &pars_asc_token or pars_desc_token */
140 /** Parses a select list; creates a query graph node for the whole SELECT
141  statement.
142  @return own: select node in a query tree */
143 sel_node_t *pars_select_list(
144     que_node_t *select_list, /*!< in: select list */
145     sym_node_t *into_list);  /*!< in: variables list or NULL */
146 /** Parses a cursor declaration.
147  @return sym_node */
148 que_node_t *pars_cursor_declaration(
149     sym_node_t *sym_node,     /*!< in: cursor id node in the symbol
150                               table */
151     sel_node_t *select_node); /*!< in: select node */
152 /** Parses a function declaration.
153  @return sym_node */
154 que_node_t *pars_function_declaration(
155     sym_node_t *sym_node); /*!< in: function id node in the symbol
156                            table */
157 /** Parses a select statement.
158  @return own: select node in a query tree */
159 sel_node_t *pars_select_statement(
160     sel_node_t *select_node,          /*!< in: select node already containing
161                                       the select list */
162     sym_node_t *table_list,           /*!< in: table list */
163     que_node_t *search_cond,          /*!< in: search condition or NULL */
164     pars_res_word_t *for_update,      /*!< in: NULL or &pars_update_token */
165     pars_res_word_t *consistent_read, /*!< in: NULL or
166                                              &pars_consistent_token */
167     order_node_t *order_by);          /*!< in: NULL or an order-by node */
168 /** Parses a column assignment in an update.
169  @return column assignment node */
170 col_assign_node_t *pars_column_assignment(
171     sym_node_t *column, /*!< in: column to assign */
172     que_node_t *exp);   /*!< in: value to assign */
173 /** Parses a delete or update statement start.
174  @return own: update node in a query tree */
175 upd_node_t *pars_update_statement_start(
176     ibool is_delete,                     /*!< in: TRUE if delete */
177     sym_node_t *table_sym,               /*!< in: table name node */
178     col_assign_node_t *col_assign_list); /*!< in: column assignment list, NULL
179                                      if delete */
180 /** Parses an update or delete statement.
181  @return own: update node in a query tree */
182 upd_node_t *pars_update_statement(
183     upd_node_t *node,         /*!< in: update node */
184     sym_node_t *cursor_sym,   /*!< in: pointer to a cursor entry in
185                               the symbol table or NULL */
186     que_node_t *search_cond); /*!< in: search condition or NULL */
187 /** Parses an insert statement.
188  @return own: update node in a query tree */
189 ins_node_t *pars_insert_statement(
190     sym_node_t *table_sym,   /*!< in: table name node */
191     que_node_t *values_list, /*!< in: value expression list or NULL */
192     sel_node_t *select);     /*!< in: select condition or NULL */
193 /** Parses a procedure parameter declaration.
194  @return own: symbol table node of type SYM_VAR */
195 sym_node_t *pars_parameter_declaration(
196     sym_node_t *node, /*!< in: symbol table node allocated for the
197                       id of the parameter */
198     ulint param_type,
199     /*!< in: PARS_INPUT or PARS_OUTPUT */
200     pars_res_word_t *type); /*!< in: pointer to a type token */
201 /** Parses an elsif element.
202  @return elsif node */
203 elsif_node_t *pars_elsif_element(
204     que_node_t *cond,       /*!< in: if-condition */
205     que_node_t *stat_list); /*!< in: statement list */
206 /** Parses an if-statement.
207  @return if-statement node */
208 if_node_t *pars_if_statement(
209     que_node_t *cond,       /*!< in: if-condition */
210     que_node_t *stat_list,  /*!< in: statement list */
211     que_node_t *else_part); /*!< in: else-part statement list */
212 /** Parses a for-loop-statement.
213  @return for-statement node */
214 for_node_t *pars_for_statement(
215     sym_node_t *loop_var,         /*!< in: loop variable */
216     que_node_t *loop_start_limit, /*!< in: loop start expression */
217     que_node_t *loop_end_limit,   /*!< in: loop end expression */
218     que_node_t *stat_list);       /*!< in: statement list */
219 /** Parses a while-statement.
220  @return while-statement node */
221 while_node_t *pars_while_statement(
222     que_node_t *cond,       /*!< in: while-condition */
223     que_node_t *stat_list); /*!< in: statement list */
224 /** Parses an exit statement.
225  @return exit statement node */
226 exit_node_t *pars_exit_statement(void);
227 /** Parses a return-statement.
228  @return return-statement node */
229 return_node_t *pars_return_statement(void);
230 /** Parses an assignment statement.
231  @return assignment statement node */
232 assign_node_t *pars_assignment_statement(
233     sym_node_t *var,  /*!< in: variable to assign */
234     que_node_t *val); /*!< in: value to assign */
235 /** Parses a fetch statement. into_list or user_func (but not both) must be
236  non-NULL.
237  @return fetch statement node */
238 fetch_node_t *pars_fetch_statement(
239     sym_node_t *cursor,     /*!< in: cursor node */
240     sym_node_t *into_list,  /*!< in: variables to set, or NULL */
241     sym_node_t *user_func); /*!< in: user function name, or NULL */
242 /** Parses an open or close cursor statement.
243  @return fetch statement node */
244 open_node_t *pars_open_statement(ulint type, /*!< in: ROW_SEL_OPEN_CURSOR
245                                              or ROW_SEL_CLOSE_CURSOR */
246                                  sym_node_t *cursor); /*!< in: cursor node */
247 /** Parses a commit statement.
248  @return own: commit node struct */
249 commit_node_t *pars_commit_statement(void);
250 /** Parses a rollback statement.
251  @return own: rollback node struct */
252 roll_node_t *pars_rollback_statement(void);
253 /** Parses a column definition at a table creation.
254  @return column sym table node */
255 sym_node_t *pars_column_def(sym_node_t *sym_node,  /*!< in: column node in the
256                                                    symbol table */
257                             pars_res_word_t *type, /*!< in: data type */
258                             sym_node_t *len,       /*!< in: length of column, or
259                                                    NULL */
260                             void *is_unsigned,     /*!< in: if not NULL, column
261                                                    is of type UNSIGNED. */
262                             void *is_not_null);    /*!< in: if not NULL, column
263                                                    is of type NOT NULL. */
264 /** Parses a table creation operation.
265 @param[in]	table_sym		table name node in the symbol table
266 @param[in]	column_defs		list of column names
267 @param[in]	not_fit_in_memory	a non-NULL pointer means that this is a
268                                         table which in simulations should be
269                                         simulated as not fitting in memory;
270                                         thread is put to sleep to simulate disk
271                                         accesses; NOTE that this flag is not
272                                         stored to the data dictionary on disk,
273                                         and the database will forget about
274                                         non-NULL value if it has the reload the
275                                         table definition from disk
276 @param[in]	compact			non-NULL if COMPACT table
277 @param[in]	block_size		block size (can be NULL)
278 @return table create subgraph */
279 tab_node_t *pars_create_table(sym_node_t *table_sym, sym_node_t *column_defs,
280                               sym_node_t *compact, sym_node_t *block_size,
281                               void *not_fit_in_memory);
282 
283 /** Parses an index creation operation.
284  @return index create subgraph */
285 ind_node_t *pars_create_index(
286     pars_res_word_t *unique_def,    /*!< in: not NULL if a unique index */
287     pars_res_word_t *clustered_def, /*!< in: not NULL if a clustered index */
288     sym_node_t *index_sym,          /*!< in: index name node in the symbol
289                                     table */
290     sym_node_t *table_sym,          /*!< in: table name node in the symbol
291                                     table */
292     sym_node_t *column_list);       /*!< in: list of column names */
293 /** Parses a procedure definition.
294  @return query fork node */
295 que_fork_t *pars_procedure_definition(
296     sym_node_t *sym_node,   /*!< in: procedure id node in the symbol
297                             table */
298     sym_node_t *param_list, /*!< in: parameter declaration list */
299     que_node_t *stat_list); /*!< in: statement list */
300 
301 /** Completes a query graph by adding query thread and fork nodes
302 above it and prepares the graph for running. The fork created is of
303 type QUE_FORK_MYSQL_INTERFACE.
304 @param[in]	node		root node for an incomplete query
305                                 graph, or NULL for dummy graph
306 @param[in]	trx		transaction handle
307 @param[in]	heap		memory heap which allocated
308 @param[in]	prebuilt	row prebuilt structure
309 @return query thread node to run */
310 que_thr_t *pars_complete_graph_for_exec(que_node_t *node, trx_t *trx,
311                                         mem_heap_t *heap,
312                                         row_prebuilt_t *prebuilt)
313     MY_ATTRIBUTE((warn_unused_result));
314 
315 /** Create parser info struct.
316  @return own: info struct */
317 pars_info_t *pars_info_create(void);
318 
319 /** Free info struct and everything it contains. */
320 void pars_info_free(pars_info_t *info); /*!< in, own: info struct */
321 
322 /** Add bound literal. */
323 void pars_info_add_literal(pars_info_t *info,   /*!< in: info struct */
324                            const char *name,    /*!< in: name */
325                            const void *address, /*!< in: address */
326                            ulint length,        /*!< in: length of data */
327                            ulint type,    /*!< in: type, e.g. DATA_FIXBINARY */
328                            ulint prtype); /*!< in: precise type, e.g.
329                                           DATA_UNSIGNED */
330 
331 /** Equivalent to pars_info_add_literal(info, name, str, strlen(str),
332  DATA_VARCHAR, DATA_ENGLISH). */
333 void pars_info_add_str_literal(pars_info_t *info, /*!< in: info struct */
334                                const char *name,  /*!< in: name */
335                                const char *str);  /*!< in: string */
336 /********************************************************************
337 If the literal value already exists then it rebinds otherwise it
338 creates a new entry.*/
339 void pars_info_bind_literal(pars_info_t *info,   /* in: info struct */
340                             const char *name,    /* in: name */
341                             const void *address, /* in: address */
342                             ulint length,        /* in: length of data */
343                             ulint type,    /* in: type, e.g. DATA_FIXBINARY */
344                             ulint prtype); /* in: precise type, e.g. */
345 /********************************************************************
346 If the literal value already exists then it rebinds otherwise it
347 creates a new entry.*/
348 void pars_info_bind_varchar_literal(pars_info_t *info, /*!< in: info struct */
349                                     const char *name,  /*!< in: name */
350                                     const byte *str,   /*!< in: string */
351                                     ulint str_len);    /*!< in: string length */
352 
353 /** Equivalent to:
354 
355 char buf[4];
356 mach_write_to_4(buf, val);
357 pars_info_add_literal(info, name, buf, 4, DATA_INT, 0);
358 
359 except that the buffer is dynamically allocated from the info struct's
360 heap.
361 @param[in]	info	info struct
362 @param[in]	name	name
363 @param[in]	val	value */
364 void pars_info_bind_int4_literal(pars_info_t *info, const char *name,
365                                  const ib_uint32_t *val);
366 
367 /** If the literal value already exists then it rebinds otherwise it
368 creates a new entry.
369 @param[in]	info	info struct
370 @param[in]	name	name
371 @param[in]	val	value */
372 void pars_info_bind_int8_literal(pars_info_t *info, const char *name,
373                                  const ib_uint64_t *val);
374 
375 /** Add user function. */
376 void pars_info_bind_function(
377     pars_info_t *info,        /*!< in: info struct */
378     const char *name,         /*!< in: function name */
379     pars_user_func_cb_t func, /*!< in: function address */
380     void *arg);               /*!< in: user-supplied argument */
381 
382 /** Add bound id.
383 @param[in]	info		info struct
384 @param[in]	copy_name	copy name if TRUE
385 @param[in]	name		name
386 @param[in]	id		id */
387 void pars_info_bind_id(pars_info_t *info, ibool copy_name, const char *name,
388                        const char *id);
389 
390 /** Equivalent to:
391 
392  char buf[4];
393  mach_write_to_4(buf, val);
394  pars_info_add_literal(info, name, buf, 4, DATA_INT, 0);
395 
396  except that the buffer is dynamically allocated from the info struct's
397  heap. */
398 void pars_info_add_int4_literal(pars_info_t *info, /*!< in: info struct */
399                                 const char *name,  /*!< in: name */
400                                 lint val);         /*!< in: value */
401 
402 /** Equivalent to:
403 
404  char buf[8];
405  mach_write_to_8(buf, val);
406  pars_info_add_literal(info, name, buf, 8, DATA_FIXBINARY, 0);
407 
408  except that the buffer is dynamically allocated from the info struct's
409  heap. */
410 void pars_info_add_ull_literal(pars_info_t *info, /*!< in: info struct */
411                                const char *name,  /*!< in: name */
412                                ib_uint64_t val);  /*!< in: value */
413 
414 /** If the literal value already exists then it rebinds otherwise it
415  creates a new entry. */
416 void pars_info_bind_ull_literal(pars_info_t *info,       /*!< in: info struct */
417                                 const char *name,        /*!< in: name */
418                                 const ib_uint64_t *val); /*!< in: value */
419 
420 /** Add bound id.
421 @param[in]	info	info struct
422 @param[in]	name	name
423 @param[in]	id	id */
424 void pars_info_add_id(pars_info_t *info, const char *name, const char *id);
425 
426 /** Get bound literal with the given name.
427  @return bound literal, or NULL if not found */
428 pars_bound_lit_t *pars_info_get_bound_lit(
429     pars_info_t *info, /*!< in: info struct */
430     const char *name); /*!< in: bound literal name to find */
431 
432 /** Get bound id with the given name.
433 @param[in]	info	info struct
434 @param[in]	name	bound id name to find
435 @return bound id, or NULL if not found */
436 pars_bound_id_t *pars_info_get_bound_id(pars_info_t *info, const char *name);
437 
438 /** Release any resources used by the lexer. */
439 void pars_lexer_close(void);
440 
441 /** Extra information supplied for pars_sql(). */
442 struct pars_info_t {
443   mem_heap_t *heap; /*!< our own memory heap */
444 
445   ib_vector_t *funcs;      /*!< user functions, or NUll
446                            (pars_user_func_t*) */
447   ib_vector_t *bound_lits; /*!< bound literals, or NULL
448                            (pars_bound_lit_t*) */
449   ib_vector_t *bound_ids;  /*!< bound ids, or NULL
450                            (pars_bound_id_t*) */
451 
452   ibool graph_owns_us; /*!< if TRUE (which is the default),
453                        que_graph_free() will free us */
454 };
455 
456 /** User-supplied function and argument. */
457 struct pars_user_func_t {
458   const char *name;         /*!< function name */
459   pars_user_func_cb_t func; /*!< function address */
460   void *arg;                /*!< user-supplied argument */
461 };
462 
463 /** Bound literal. */
464 struct pars_bound_lit_t {
465   const char *name;    /*!< name */
466   const void *address; /*!< address */
467   ulint length;        /*!< length of data */
468   ulint type;          /*!< type, e.g. DATA_FIXBINARY */
469   ulint prtype;        /*!< precise type, e.g. DATA_UNSIGNED */
470   sym_node_t *node;    /*!< symbol node */
471 };
472 
473 /** Bound identifier. */
474 struct pars_bound_id_t {
475   const char *name; /*!< name */
476   const char *id;   /*!< identifier */
477 };
478 
479 /** Struct used to denote a reserved word in a parsing tree */
480 struct pars_res_word_t {
481   int code; /*!< the token code for the reserved word from
482             pars0grm.h */
483 };
484 
485 /** A predefined function or operator node in a parsing tree; this construct
486 is also used for some non-functions like the assignment ':=' */
487 struct func_node_t {
488   que_common_t common; /*!< type: QUE_NODE_FUNC */
489   int func;            /*!< token code of the function name */
490   ulint fclass;        /*!< class of the function */
491   que_node_t *args;    /*!< argument(s) of the function */
492   UT_LIST_NODE_T(func_node_t) cond_list;
493   /*!< list of comparison conditions; defined
494   only for comparison operator nodes except,
495   presently, for OPT_SCROLL_TYPE ones */
496   UT_LIST_NODE_T(func_node_t) func_node_list;
497   /*!< list of function nodes in a parsed
498   query graph */
499 };
500 
501 /** An order-by node in a select */
502 struct order_node_t {
503   que_common_t common; /*!< type: QUE_NODE_ORDER */
504   sym_node_t *column;  /*!< order-by column */
505   ibool asc;           /*!< TRUE if ascending, FALSE if descending */
506 };
507 
508 /** Procedure definition node */
509 struct proc_node_t {
510   que_common_t common;    /*!< type: QUE_NODE_PROC */
511   sym_node_t *proc_id;    /*!< procedure name symbol in the symbol
512                           table of this same procedure */
513   sym_node_t *param_list; /*!< input and output parameters */
514   que_node_t *stat_list;  /*!< statement list */
515   sym_tab_t *sym_tab;     /*!< symbol table of this procedure */
516 };
517 
518 /** elsif-element node */
519 struct elsif_node_t {
520   que_common_t common;   /*!< type: QUE_NODE_ELSIF */
521   que_node_t *cond;      /*!< if condition */
522   que_node_t *stat_list; /*!< statement list */
523 };
524 
525 /** if-statement node */
526 struct if_node_t {
527   que_common_t common;      /*!< type: QUE_NODE_IF */
528   que_node_t *cond;         /*!< if condition */
529   que_node_t *stat_list;    /*!< statement list */
530   que_node_t *else_part;    /*!< else-part statement list */
531   elsif_node_t *elsif_list; /*!< elsif element list */
532 };
533 
534 /** while-statement node */
535 struct while_node_t {
536   que_common_t common;   /*!< type: QUE_NODE_WHILE */
537   que_node_t *cond;      /*!< while condition */
538   que_node_t *stat_list; /*!< statement list */
539 };
540 
541 /** for-loop-statement node */
542 struct for_node_t {
543   que_common_t common;          /*!< type: QUE_NODE_FOR */
544   sym_node_t *loop_var;         /*!< loop variable: this is the
545                                 dereferenced symbol from the
546                                 variable declarations, not the
547                                 symbol occurrence in the for loop
548                                 definition */
549   que_node_t *loop_start_limit; /*!< initial value of loop variable */
550   que_node_t *loop_end_limit;   /*!< end value of loop variable */
551   lint loop_end_value;          /*!< evaluated value for the end value:
552                                 it is calculated only when the loop
553                                 is entered, and will not change within
554                                 the loop */
555   que_node_t *stat_list;        /*!< statement list */
556 };
557 
558 /** exit statement node */
559 struct exit_node_t {
560   que_common_t common; /*!< type: QUE_NODE_EXIT */
561 };
562 
563 /** return-statement node */
564 struct return_node_t {
565   que_common_t common; /*!< type: QUE_NODE_RETURN */
566 };
567 
568 /** Assignment statement node */
569 struct assign_node_t {
570   que_common_t common; /*!< type: QUE_NODE_ASSIGNMENT */
571   sym_node_t *var;     /*!< variable to set */
572   que_node_t *val;     /*!< value to assign */
573 };
574 
575 /** Column assignment node */
576 struct col_assign_node_t {
577   que_common_t common; /*!< type: QUE_NODE_COL_ASSIGN */
578   sym_node_t *col;     /*!< column to set */
579   que_node_t *val;     /*!< value to assign */
580 };
581 
582 /** Classes of functions */
583 /* @{ */
584 #define PARS_FUNC_ARITH 1      /*!< +, -, *, / */
585 #define PARS_FUNC_LOGICAL 2    /*!< AND, OR, NOT */
586 #define PARS_FUNC_CMP 3        /*!< comparison operators */
587 #define PARS_FUNC_PREDEFINED 4 /*!< TO_NUMBER, SUBSTR, ... */
588 #define PARS_FUNC_AGGREGATE 5  /*!< COUNT, DISTINCT, SUM */
589 #define PARS_FUNC_OTHER                \
590   6 /*!< these are not real functions, \
591     e.g., := */
592 /* @} */
593 
594 #include "pars0pars.ic"
595 
596 #endif
597