CUBRID Engine
latest
|
#include "config.h"
#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include "esql_grammar.h"
#include "esql_scanner_support.h"
#include "util_func.h"
#include "misc_string.h"
#include "esql_misc.h"
#include "memory_alloc.h"
Go to the source code of this file.
Classes | |
struct | builtin_type_s |
Macros | |
#define | BAD_C_TYPE ((C_TYPE) -1) |
#define | UNINIT_C_TYPE ((C_TYPE) -2) |
#define | C_TYPE_STRUCT ((C_TYPE) -3) |
#define | UNINITIALIZED(p) ((p) == UNINIT_C_TYPE) |
Typedefs | |
typedef struct builtin_type_s | BUILTIN_TYPE |
Variables | |
static BUILTIN_TYPE | builtin_types [] |
static HOST_LOD ** | pp_gathering |
static HOST_LOD * | pp_host_refs |
static SYMBOL * | string_dummy |
static HOST_LOD * | host_lod_chain |
static HOST_LOD * | host_lod_free_list |
#define BAD_C_TYPE ((C_TYPE) -1) |
Definition at line 40 of file esql_host_variable.c.
Referenced by pp_add_host_ref(), pp_check(), and pp_check_builtin_type().
#define C_TYPE_STRUCT ((C_TYPE) -3) |
Definition at line 42 of file esql_host_variable.c.
Referenced by pp_add_host_ref(), and pp_check().
#define UNINIT_C_TYPE ((C_TYPE) -2) |
Definition at line 41 of file esql_host_variable.c.
#define UNINITIALIZED | ( | p | ) | ((p) == UNINIT_C_TYPE) |
Definition at line 43 of file esql_host_variable.c.
Referenced by pp_get_type().
typedef struct builtin_type_s BUILTIN_TYPE |
Definition at line 46 of file esql_host_variable.c.
Definition at line 1294 of file esql_host_variable.c.
References hash_tab_s::add_symbol, pp_add_spec_to_decl(), pp_add_storage_class(), pp_add_struct_spec(), pp_current_type_spec(), pp_discard_link(), pp_new_structdef(), pp_new_symbol(), pp_reset_current_type_spec(), pp_Struct_table, and pp_Symbol_table.
Referenced by pp_hv_init().
HOST_REF* pp_add_host_ref | ( | HOST_VAR * | var, |
HOST_VAR * | indicator, | ||
bool | structs_allowed, | ||
int * | n_refs | ||
) |
Definition at line 273 of file esql_host_variable.c.
References host_ref::addr_expr_buf, BAD_C_TYPE, C_TYPE_STRUCT, esql_yyverror(), EX_HOSTVAR_SET, host_var::expr, host_ref::expr_buf, free_and_init, host_ref::ind, host_ref::ind_addr_expr_buf, host_ref::ind_expr_buf, host_ref::input_size_buf, IS_INT, IS_LONG, host_lod::max_refs, MSG_INDICATOR_NOT_ALLOWED, MSG_MUST_BE_SHORT, host_lod::n_real_refs, host_lod::n_refs, NULL, host_ref::output_size_buf, pp_add_struct_field_refs(), pp_check(), pp_free_host_var(), pp_get_msg(), pp_host_refs, pp_malloc(), pp_new_host_lod(), host_ref::precision_buf, host_lod::real_refs, host_lod::refs, host_var::type, host_ref::uci_type, host_ref::var, and vs_str().
Referenced by pp_add_host_str(), and pp_add_struct_field_refs().
HOST_REF* pp_add_host_str | ( | char * | str | ) |
Definition at line 520 of file esql_host_variable.c.
References C_TYPE_STRING_CONST, host_var::expr, NULL, pp_add_host_ref(), pp_new_host_var(), pp_translate_string(), host_ref::uci_type, and vs_clear().
Definition at line 382 of file esql_host_variable.c.
References link::decl, errors, esql_yyverror(), EX_HOSTVAR_SET, host_var::expr, structdef::fields, MSG_INCOMPLETE_DEF, symbol::next, NULL, pp_add_host_ref(), pp_free_host_var(), pp_get_msg(), pp_new_host_var(), link::s, host_var::type, specifier::v_struct, specifier::val, vs_prepend(), and vs_str().
Referenced by pp_add_host_ref().
|
static |
Definition at line 1122 of file esql_host_variable.c.
References host_var::addr_expr, esql_yyverror(), EX_HOSTVAR_SET, IS_CHAR, IS_PSEUDO_TYPE, IS_PTR_TYPE, MSG_BAD_ADDRESS, link::next, NULL, pp_expr(), pp_get_msg(), host_var::type, VARCHAR_ARRAY_NAME, vs_clear(), vs_sprintf(), and vs_str().
Referenced by pp_get_addr_expr(), and pp_get_ind_addr_expr().
Definition at line 1239 of file esql_host_variable.c.
References link::d, D_POINTER, declarator::dcl_type, link::decl, link::next, NULL, pp_new_link(), and host_var::type.
Definition at line 987 of file esql_host_variable.c.
References BAD_C_TYPE, builtin_type_s::c_type, C_TYPE_BIT, C_TYPE_CHAR_ARRAY, C_TYPE_CHAR_POINTER, C_TYPE_DOUBLE, C_TYPE_FLOAT, C_TYPE_INTEGER, C_TYPE_LONG, C_TYPE_SHORT, C_TYPE_STRUCT, C_TYPE_VARBIT, C_TYPE_VARCHAR, link::decl, esql_yyverror(), EX_HOSTVAR_SET, host_var::expr, IS_ARRAY, IS_CHAR, specifier::is_long, IS_POINTER, specifier::is_short, IS_SPECIFIER, specifier::is_unsigned, MSG_TYPE_NOT_ACCEPTABLE, N_BIT, N_CHR, N_FLOAT, N_INT, N_STRUCTURE, N_VARBIT, N_VARCHAR, link::next, specifier::noun, NULL, pp_check_builtin_type(), pp_get_msg(), pp_type_str(), link::s, structdef::type, host_var::type, specifier::v_struct, specifier::val, and vs_str().
Referenced by pp_add_host_ref(), and pp_get_type().
Definition at line 1087 of file esql_host_variable.c.
References BAD_C_TYPE, builtin_type_s::c_type, i, builtin_type_s::mode, pp_the_same_type(), builtin_type_s::sym, and symbol::type.
Referenced by pp_check().
void pp_check_host_var_list | ( | void | ) |
Definition at line 589 of file esql_host_variable.c.
References esql_yyverror(), EX_HOSTVAR_SET, i, MSG_TYPE_NOT_ACCEPTABLE, host_lod::n_refs, NULL, NUM_C_VARIABLE_TYPES, pp_get_expr(), pp_get_msg(), pp_get_type(), pp_type_str(), host_lod::refs, host_var::type, and host_ref::var.
Definition at line 554 of file esql_host_variable.c.
References esql_yyverror(), EX_HOSTVAR_SET, free_and_init, MEMBER, MSG_NOT_VALID, NULL, pp_expr(), pp_get_msg(), pp_get_type(), pp_strdup(), and host_ref::var.
void pp_clear_host_lod | ( | HOST_LOD * | lod | ) |
Definition at line 1467 of file esql_host_variable.c.
References host_lod::desc, i, host_lod::n_real_refs, host_lod::n_refs, NULL, pp_free_host_ref(), host_lod::real_refs, and host_lod::refs.
Referenced by pp_clear_host_refs(), and pp_free_host_lod().
void pp_clear_host_refs | ( | void | ) |
Definition at line 167 of file esql_host_variable.c.
References host_lod_chain, host_lod_free_list, input_refs, host_lod::next, NULL, output_refs, and pp_clear_host_lod().
Referenced by pp_hv_init().
HOST_LOD* pp_copy_host_refs | ( | void | ) |
Definition at line 474 of file esql_host_variable.c.
References NULL, and pp_host_refs.
Referenced by pp_detach_host_refs().
HOST_LOD* pp_detach_host_refs | ( | void | ) |
Definition at line 494 of file esql_host_variable.c.
References host_lod_chain, host_lod::next, NULL, and pp_copy_host_refs().
|
static |
Definition at line 1108 of file esql_host_variable.c.
References host_var::expr, and vs_str().
Referenced by pp_addr_expr(), pp_check_type(), pp_get_expr(), and pp_get_ind_expr().
Definition at line 1267 of file esql_host_variable.c.
References structdef::fields, symbol::name, symbol::next, NULL, and builtin_type_s::sym.
Referenced by pp_struct_deref().
void pp_free_host_lod | ( | HOST_LOD * | lod | ) |
Definition at line 1445 of file esql_host_variable.c.
References free_and_init, NULL, pp_clear_host_lod(), and host_lod::real_refs.
Referenced by pp_free_cursor(), and pp_hv_finish().
void pp_free_host_ref | ( | HOST_REF * | ref | ) |
Definition at line 452 of file esql_host_variable.c.
References host_ref::addr_expr_buf, host_ref::expr_buf, host_ref::ind, host_ref::ind_addr_expr_buf, host_ref::ind_expr_buf, host_ref::input_size_buf, host_ref::output_size_buf, pp_free_host_var(), host_ref::precision_buf, host_ref::var, and vs_free().
Referenced by pp_clear_host_lod().
void pp_free_host_var | ( | HOST_VAR * | var | ) |
Definition at line 238 of file esql_host_variable.c.
References host_var::addr_expr, host_var::expr, free_and_init, host_var::heap_allocated, NULL, pp_discard_link_chain(), host_var::type, and vs_free().
Referenced by pp_add_host_ref(), pp_add_struct_field_refs(), and pp_free_host_ref().
void pp_gather_input_refs | ( | void | ) |
Definition at line 112 of file esql_host_variable.c.
References input_refs, output_refs, and pp_host_refs.
void pp_gather_output_refs | ( | void | ) |
Definition at line 128 of file esql_host_variable.c.
References input_refs, output_refs, and pp_host_refs.
char* pp_get_addr_expr | ( | HOST_REF * | ref | ) |
Definition at line 878 of file esql_host_variable.c.
References host_ref::addr_expr_buf, NULL, pp_addr_expr(), host_ref::var, vs_new(), vs_str(), and vs_strcpy().
Referenced by emit_get_db_value(), emit_put_db_value(), and get_quasi_string().
char* pp_get_expr | ( | HOST_REF * | ref | ) |
Definition at line 852 of file esql_host_variable.c.
References host_ref::expr_buf, NULL, pp_expr(), host_ref::var, vs_new(), vs_str(), and vs_strcpy().
Referenced by emit_put_db_value(), get_quasi_string(), pp_check_host_var_list(), pp_get_input_size(), pp_get_output_size(), pp_get_precision(), pp_print_host_ref(), pp_switch_to_descriptor(), tr_object_describe(), and tr_object_fetch().
char* pp_get_ind_addr_expr | ( | HOST_REF * | ref | ) |
Definition at line 925 of file esql_host_variable.c.
References host_ref::ind, host_ref::ind_addr_expr_buf, NULL, pp_addr_expr(), pp_internal_ind, vs_new(), vs_str(), and vs_strcpy().
Referenced by emit_get_db_value(), and emit_put_db_value().
char* pp_get_ind_expr | ( | HOST_REF * | ref | ) |
Definition at line 901 of file esql_host_variable.c.
References host_ref::ind, host_ref::ind_expr_buf, NULL, pp_expr(), vs_new(), vs_str(), and vs_strcpy().
Referenced by pp_print_host_ref().
char* pp_get_input_size | ( | HOST_REF * | ref | ) |
Definition at line 712 of file esql_host_variable.c.
References assert, C_TYPE_BASICSET, C_TYPE_BIT, C_TYPE_CHAR_ARRAY, C_TYPE_CHAR_POINTER, C_TYPE_COLLECTION, C_TYPE_DATE, C_TYPE_DB_VALUE, C_TYPE_DOUBLE, C_TYPE_FLOAT, C_TYPE_INTEGER, C_TYPE_LONG, C_TYPE_MONETARY, C_TYPE_MULTISET, C_TYPE_OBJECTID, C_TYPE_SEQUENCE, C_TYPE_SHORT, C_TYPE_STRING_CONST, C_TYPE_TIME, C_TYPE_TIMESTAMP, C_TYPE_VARBIT, C_TYPE_VARCHAR, esql_yyverror(), EX_HOSTVAR_SET, host_ref::input_size_buf, MSG_UNKNOWN_HV_TYPE, NULL, pp_get_expr(), pp_get_msg(), pp_type_str(), host_var::type, host_ref::uci_type, host_ref::var, VARCHAR_LENGTH_NAME, vs_new(), vs_sprintf(), vs_str(), and vs_strcpy().
Referenced by emit_get_db_value(), emit_put_db_value(), get_quasi_string(), pp_get_output_size(), and pp_print_host_ref().
char* pp_get_output_size | ( | HOST_REF * | ref | ) |
Definition at line 811 of file esql_host_variable.c.
References assert, C_TYPE_BIT, C_TYPE_CHAR_POINTER, C_TYPE_VARBIT, C_TYPE_VARCHAR, NULL, host_ref::output_size_buf, pp_get_expr(), pp_get_input_size(), host_ref::uci_type, host_ref::var, VARCHAR_ARRAY_NAME, vs_new(), vs_sprintf(), and vs_str().
Referenced by emit_get_db_value().
char* pp_get_precision | ( | HOST_REF * | ref | ) |
Definition at line 635 of file esql_host_variable.c.
References assert, C_TYPE_BASICSET, C_TYPE_BIT, C_TYPE_CHAR_ARRAY, C_TYPE_CHAR_POINTER, C_TYPE_COLLECTION, C_TYPE_DATE, C_TYPE_DB_VALUE, C_TYPE_DOUBLE, C_TYPE_FLOAT, C_TYPE_INTEGER, C_TYPE_LONG, C_TYPE_MONETARY, C_TYPE_MULTISET, C_TYPE_OBJECTID, C_TYPE_SEQUENCE, C_TYPE_SHORT, C_TYPE_STRING_CONST, C_TYPE_TIME, C_TYPE_TIMESTAMP, C_TYPE_VARBIT, C_TYPE_VARCHAR, esql_yyverror(), EX_HOSTVAR_SET, MSG_UNKNOWN_HV_TYPE, NULL, pp_get_expr(), pp_get_msg(), pp_type_str(), host_ref::precision_buf, host_var::type, host_ref::uci_type, host_ref::var, VARCHAR_ARRAY_NAME, VARCHAR_LENGTH_NAME, vs_new(), vs_sprintf(), vs_str(), and vs_strcpy().
Referenced by emit_put_db_value().
Definition at line 614 of file esql_host_variable.c.
References assert, NULL, pp_check(), host_ref::uci_type, UNINITIALIZED, and host_ref::var.
Referenced by emit_get_db_value(), emit_put_db_value(), get_quasi_string(), pp_check_host_var_list(), and pp_check_type().
void pp_hv_finish | ( | void | ) |
Definition at line 1382 of file esql_host_variable.c.
References host_lod::next, pp_discard_symbol(), and pp_free_host_lod().
Referenced by pp_finish().
void pp_hv_init | ( | void | ) |
Definition at line 1324 of file esql_host_variable.c.
References D_ARRAY, i, input_refs, builtin_type_s::name, NULL, output_refs, pp_add_declarator(), pp_add_dummy_structdef(), pp_add_spec_to_decl(), pp_add_storage_class(), pp_add_symbols_to_table(), pp_add_type_adj(), pp_add_type_noun(), pp_clear_host_refs(), pp_current_type_spec(), pp_discard_link(), pp_new_symbol(), pp_reset_current_type_spec(), and builtin_type_s::sym.
Referenced by pp_startup().
HOST_LOD* pp_input_refs | ( | void | ) |
Definition at line 144 of file esql_host_variable.c.
References input_refs.
HOST_LOD* pp_new_host_lod | ( | void | ) |
Definition at line 1406 of file esql_host_variable.c.
References host_lod::desc, esql_yyverror(), EX_MISC_SET, host_lod_chain, host_lod_free_list, host_lod::max_refs, MSG_OUT_OF_MEMORY, host_lod::n_real_refs, host_lod::n_refs, host_lod::next, NULL, pp_get_msg(), host_lod::real_refs, and host_lod::refs.
Referenced by pp_add_host_ref().
Definition at line 207 of file esql_host_variable.c.
References host_var::addr_expr, host_var::etype, host_var::expr, host_var::heap_allocated, symbol::name, NULL, pp_clone_type(), host_var::type, symbol::type, vs_new(), and vs_strcat().
Referenced by pp_add_host_str(), and pp_add_struct_field_refs().
HOST_LOD* pp_output_refs | ( | void | ) |
Definition at line 154 of file esql_host_variable.c.
References output_refs.
void pp_print_host_ref | ( | HOST_REF * | ref, |
FILE * | fp | ||
) |
Definition at line 961 of file esql_host_variable.c.
References NULL, p, pp_get_expr(), pp_get_ind_expr(), pp_get_input_size(), and host_ref::var.
Referenced by pp_print_cursor().
Definition at line 1160 of file esql_host_variable.c.
References esql_yyverror(), EX_HOSTVAR_SET, host_var::expr, IS_PTR_TYPE, MSG_DEREF_NOT_ALLOWED, link::next, NULL, pp_discard_link(), pp_get_msg(), host_var::type, and vs_str().
Definition at line 1191 of file esql_host_variable.c.
References link::decl, esql_yyverror(), host_var::etype, EX_HOSTVAR_SET, host_var::expr, IS_PSEUDO_TYPE, IS_PTR_TYPE, IS_STRUCT, MSG_NO_FIELD, MSG_NOT_POINTER, MSG_NOT_POINTER_TO_STRUCT, MSG_NOT_STRUCT, link::next, NULL, pp_clone_type(), pp_discard_link(), pp_discard_link_chain(), pp_find_field(), pp_get_msg(), link::s, host_var::type, symbol::type, structdef::type_string, specifier::v_struct, specifier::val, and vs_str().
char* pp_switch_to_descriptor | ( | void | ) |
Definition at line 1498 of file esql_host_variable.c.
References assert, host_lod::desc, host_lod::n_refs, NULL, pp_get_expr(), and host_lod::refs.
Definition at line 1532 of file esql_host_variable.c.
References NULL, p, vs_putc(), and vs_strcat().
Referenced by pp_add_host_str().
|
static |
Definition at line 56 of file esql_host_variable.c.
|
static |
Definition at line 96 of file esql_host_variable.c.
Referenced by pp_clear_host_refs(), pp_detach_host_refs(), and pp_new_host_lod().
|
static |
Definition at line 97 of file esql_host_variable.c.
Referenced by pp_clear_host_refs(), and pp_new_host_lod().
|
static |
Definition at line 92 of file esql_host_variable.c.
|
static |
Definition at line 94 of file esql_host_variable.c.
Referenced by pp_add_host_ref(), pp_copy_host_refs(), pp_gather_input_refs(), and pp_gather_output_refs().
|
static |
Definition at line 95 of file esql_host_variable.c.