Commit e8b80a5a authored by osku's avatar osku

Add support for bound ids in InnoDB's SQL parser.

parent d35c4375
......@@ -531,6 +531,16 @@ pars_info_add_function(
pars_user_func_cb_t func, /* in: function address */
void* arg); /* in: user-supplied argument */
/********************************************************************
Add bound id. */
void
pars_info_add_id(
/*=============*/
pars_info_t* info, /* in: info struct */
const char* name, /* in: name */
const char* id); /* in: id */
/********************************************************************
Get user function with the given name.*/
......@@ -553,6 +563,17 @@ pars_info_get_bound_lit(
pars_info_t* info, /* in: info struct */
const char* name); /* in: bound literal name to find */
/********************************************************************
Get bound id with the given name.*/
pars_bound_id_t*
pars_info_get_bound_id(
/*===================*/
/* out: bound id, or NULL if not
found */
pars_info_t* info, /* in: info struct */
const char* name); /* in: bound id name to find */
/* Extra information supplied for pars_sql(). */
struct pars_info_struct {
......@@ -562,6 +583,8 @@ struct pars_info_struct {
(pars_user_func_t*) */
ib_vector_t* bound_lits; /* bound literals, or NULL
(pars_bound_lit_t*) */
ib_vector_t* bound_ids; /* bound ids, or NULL
(pars_bound_id_t*) */
ibool graph_owns_us; /* if TRUE (which is the default),
que_graph_free() will free us */
......@@ -583,6 +606,12 @@ struct pars_bound_lit_struct {
ulint prtype; /* precise type, e.g. DATA_UNSIGNED */
};
/* Bound id. */
struct pars_bound_id_struct {
const char* name; /* name */
const char* id; /* id */
};
/* Struct used to denote a reserved word in a parsing tree */
struct pars_res_word_struct{
int code; /* the token code for the reserved word from
......
......@@ -82,6 +82,16 @@ sym_tab_add_id(
byte* name, /* in: identifier name */
ulint len); /* in: identifier length */
/**********************************************************************
Add a bound identifier to a symbol table. */
sym_node_t*
sym_tab_add_bound_id(
/*===========*/
/* out: symbol table node */
sym_tab_t* sym_tab, /* in: symbol table */
const char* name); /* in: name of bound id */
#define SYM_CLUST_FIELD_NO 0
#define SYM_SEC_FIELD_NO 1
......
......@@ -12,6 +12,7 @@ Created 1/11/1998 Heikki Tuuri
typedef struct pars_info_struct pars_info_t;
typedef struct pars_user_func_struct pars_user_func_t;
typedef struct pars_bound_lit_struct pars_bound_lit_t;
typedef struct pars_bound_id_struct pars_bound_id_t;
typedef struct sym_node_struct sym_node_t;
typedef struct sym_tab_struct sym_tab_t;
typedef struct pars_res_word_struct pars_res_word_t;
......
......@@ -356,8 +356,8 @@ static void yy_fatal_error (yyconst char msg[] );
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 116
#define YY_END_OF_BUFFER 117
#define YY_NUM_RULES 117
#define YY_END_OF_BUFFER 118
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
......@@ -365,51 +365,51 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_accept[394] =
static yyconst flex_int16_t yy_accept[396] =
{ 0,
0, 0, 111, 111, 0, 0, 0, 0, 117, 115,
114, 114, 7, 106, 4, 95, 101, 104, 102, 99,
103, 115, 105, 1, 115, 100, 98, 96, 97, 109,
89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
89, 89, 89, 89, 89, 89, 89, 89, 107, 108,
111, 112, 5, 6, 8, 9, 114, 90, 110, 2,
1, 3, 91, 92, 94, 93, 89, 89, 89, 89,
89, 89, 44, 89, 89, 89, 89, 89, 89, 89,
89, 89, 89, 89, 89, 89, 89, 89, 89, 27,
16, 24, 89, 89, 89, 89, 54, 61, 89, 13,
89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
89, 89, 89, 89, 89, 89, 89, 111, 112, 112,
113, 5, 6, 8, 9, 2, 12, 45, 89, 89,
89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
89, 89, 89, 89, 89, 89, 26, 89, 89, 89,
40, 89, 89, 89, 89, 20, 89, 89, 14, 89,
89, 89, 17, 89, 89, 89, 89, 89, 80, 89,
89, 89, 51, 11, 89, 35, 89, 89, 89, 89,
89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
19, 23, 89, 89, 89, 89, 89, 89, 89, 89,
89, 89, 89, 46, 89, 89, 29, 89, 87, 89,
89, 38, 89, 89, 89, 89, 89, 48, 89, 31,
89, 10, 64, 89, 89, 89, 42, 89, 89, 89,
89, 89, 89, 89, 89, 89, 28, 89, 89, 89,
89, 89, 89, 89, 89, 89, 85, 89, 25, 89,
66, 89, 89, 89, 89, 36, 89, 89, 89, 89,
89, 89, 89, 30, 65, 22, 89, 57, 89, 75,
89, 89, 89, 43, 89, 89, 89, 89, 89, 89,
89, 89, 89, 89, 56, 89, 89, 89, 89, 89,
89, 89, 39, 32, 79, 18, 89, 83, 74, 89,
55, 89, 63, 89, 52, 89, 89, 89, 47, 89,
76, 89, 78, 89, 89, 33, 89, 89, 89, 34,
72, 89, 89, 89, 89, 58, 89, 50, 49, 89,
89, 89, 53, 62, 89, 89, 89, 21, 89, 89,
73, 81, 89, 89, 77, 89, 68, 89, 89, 89,
89, 89, 37, 89, 88, 67, 89, 84, 89, 89,
89, 86, 89, 59, 89, 89, 15, 89, 70, 69,
89, 41, 89, 82, 89, 89, 89, 89, 89, 89,
89, 89, 89, 89, 71, 89, 89, 89, 89, 89,
89, 60, 0
0, 0, 112, 112, 0, 0, 0, 0, 118, 116,
115, 115, 8, 116, 107, 5, 96, 102, 105, 103,
100, 104, 116, 106, 1, 116, 101, 99, 97, 98,
110, 90, 90, 90, 90, 90, 90, 90, 90, 90,
90, 90, 90, 90, 90, 90, 90, 90, 90, 108,
109, 112, 113, 6, 7, 9, 10, 115, 4, 91,
111, 2, 1, 3, 92, 93, 95, 94, 90, 90,
90, 90, 90, 90, 45, 90, 90, 90, 90, 90,
90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
90, 28, 17, 25, 90, 90, 90, 90, 55, 62,
90, 14, 90, 90, 90, 90, 90, 90, 90, 90,
90, 90, 90, 90, 90, 90, 90, 90, 90, 112,
113, 113, 114, 6, 7, 9, 10, 2, 13, 46,
90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
90, 90, 90, 90, 90, 90, 90, 90, 27, 90,
90, 90, 41, 90, 90, 90, 90, 21, 90, 90,
15, 90, 90, 90, 18, 90, 90, 90, 90, 90,
81, 90, 90, 90, 52, 12, 90, 36, 90, 90,
90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
90, 90, 20, 24, 90, 90, 90, 90, 90, 90,
90, 90, 90, 90, 90, 47, 90, 90, 30, 90,
88, 90, 90, 39, 90, 90, 90, 90, 90, 49,
90, 32, 90, 11, 65, 90, 90, 90, 43, 90,
90, 90, 90, 90, 90, 90, 90, 90, 29, 90,
90, 90, 90, 90, 90, 90, 90, 90, 86, 90,
26, 90, 67, 90, 90, 90, 90, 37, 90, 90,
90, 90, 90, 90, 90, 31, 66, 23, 90, 58,
90, 76, 90, 90, 90, 44, 90, 90, 90, 90,
90, 90, 90, 90, 90, 90, 57, 90, 90, 90,
90, 90, 90, 90, 40, 33, 80, 19, 90, 84,
75, 90, 56, 90, 64, 90, 53, 90, 90, 90,
48, 90, 77, 90, 79, 90, 90, 34, 90, 90,
90, 35, 73, 90, 90, 90, 90, 59, 90, 51,
50, 90, 90, 90, 54, 63, 90, 90, 90, 22,
90, 90, 74, 82, 90, 90, 78, 90, 69, 90,
90, 90, 90, 90, 38, 90, 89, 68, 90, 85,
90, 90, 90, 87, 90, 60, 90, 90, 16, 90,
71, 70, 90, 42, 90, 83, 90, 90, 90, 90,
90, 90, 90, 90, 90, 90, 72, 90, 90, 90,
90, 90, 90, 61, 0
} ;
......@@ -418,17 +418,17 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 1, 4, 1, 1, 5, 1, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 16, 17, 18,
19, 20, 21, 1, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 31,
1, 1, 1, 1, 47, 1, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 48, 1, 49, 1, 1, 1, 1, 1,
1, 2, 1, 4, 1, 5, 6, 1, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 17, 18, 19,
20, 21, 22, 1, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 32,
1, 1, 1, 1, 48, 1, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32, 32, 49, 1, 50, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
......@@ -445,228 +445,228 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;
static yyconst flex_int32_t yy_meta[50] =
static yyconst flex_int32_t yy_meta[51] =
{ 0,
1, 1, 1, 2, 1, 3, 1, 1, 4, 1,
1, 1, 1, 1, 5, 1, 1, 1, 6, 1,
1, 5, 5, 5, 5, 5, 5, 5, 5, 5,
1, 1, 1, 2, 1, 1, 3, 1, 1, 4,
1, 1, 1, 1, 1, 5, 1, 1, 1, 6,
1, 1, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 1, 1
5, 5, 5, 5, 5, 5, 5, 5, 1, 1
} ;
static yyconst flex_int16_t yy_base[403] =
static yyconst flex_int16_t yy_base[406] =
{ 0,
0, 0, 434, 433, 435, 434, 435, 434, 437, 444,
48, 50, 444, 444, 444, 444, 444, 444, 444, 444,
444, 423, 426, 41, 415, 444, 38, 444, 414, 444,
20, 33, 32, 46, 40, 44, 0, 54, 52, 48,
60, 393, 65, 66, 74, 27, 409, 69, 444, 444,
0, 97, 0, 424, 0, 425, 111, 444, 444, 413,
54, 408, 444, 444, 444, 444, 0, 401, 69, 397,
389, 387, 0, 400, 79, 82, 395, 381, 94, 379,
392, 377, 391, 385, 373, 377, 373, 375, 375, 0,
82, 0, 374, 372, 366, 373, 0, 0, 379, 379,
362, 89, 98, 377, 93, 95, 368, 106, 360, 376,
372, 350, 101, 371, 362, 112, 355, 0, 134, 135,
444, 0, 387, 0, 388, 376, 0, 0, 364, 359,
366, 364, 347, 345, 344, 349, 106, 347, 359, 93,
347, 353, 354, 336, 336, 121, 0, 334, 350, 351,
0, 338, 347, 344, 119, 126, 341, 331, 340, 333,
330, 338, 0, 328, 338, 336, 327, 317, 311, 324,
309, 329, 0, 0, 314, 0, 328, 319, 316, 130,
312, 319, 326, 305, 307, 312, 312, 304, 307, 302,
0, 0, 314, 298, 308, 315, 306, 294, 293, 307,
296, 309, 289, 0, 299, 281, 0, 300, 0, 297,
284, 0, 283, 278, 283, 282, 292, 0, 278, 0,
282, 0, 0, 278, 275, 289, 0, 274, 274, 272,
288, 273, 285, 267, 285, 280, 0, 275, 275, 261,
260, 273, 259, 273, 272, 271, 0, 255, 0, 249,
0, 268, 252, 251, 251, 0, 264, 254, 249, 248,
260, 250, 249, 0, 0, 0, 253, 0, 241, 0,
255, 251, 237, 0, 251, 252, 235, 240, 233, 251,
233, 230, 231, 228, 0, 233, 245, 232, 239, 229,
237, 222, 0, 0, 0, 214, 221, 0, 0, 218,
0, 217, 0, 231, 0, 232, 219, 218, 0, 214,
0, 217, 0, 209, 211, 0, 210, 224, 217, 0,
0, 220, 223, 205, 220, 0, 216, 0, 0, 200,
214, 213, 0, 0, 197, 196, 201, 0, 210, 195,
0, 0, 201, 197, 0, 192, 0, 204, 204, 192,
202, 191, 0, 178, 0, 0, 198, 0, 182, 176,
182, 0, 173, 0, 178, 191, 0, 190, 0, 0,
181, 0, 185, 0, 172, 172, 178, 164, 187, 175,
174, 154, 125, 116, 0, 127, 133, 124, 121, 117,
109, 0, 444, 165, 171, 177, 179, 145, 185, 191,
197, 203
0, 0, 435, 434, 436, 435, 437, 436, 439, 446,
49, 51, 446, 0, 446, 446, 446, 446, 446, 446,
446, 446, 424, 427, 41, 416, 446, 38, 446, 415,
446, 20, 33, 32, 46, 40, 44, 0, 54, 52,
48, 60, 394, 65, 66, 74, 27, 410, 69, 446,
446, 0, 97, 0, 425, 0, 427, 112, 0, 446,
446, 414, 54, 409, 446, 446, 446, 446, 0, 402,
69, 398, 390, 388, 0, 401, 79, 82, 396, 382,
94, 380, 393, 378, 392, 386, 374, 378, 374, 376,
376, 0, 82, 0, 375, 373, 367, 374, 0, 0,
380, 380, 363, 89, 98, 378, 93, 95, 369, 106,
361, 377, 373, 351, 101, 372, 363, 112, 356, 0,
134, 135, 446, 0, 388, 0, 390, 377, 0, 0,
365, 360, 367, 365, 348, 346, 345, 350, 106, 348,
360, 93, 348, 354, 355, 337, 337, 121, 0, 335,
351, 352, 0, 339, 348, 345, 119, 126, 342, 332,
341, 334, 331, 339, 0, 329, 339, 337, 328, 318,
312, 325, 310, 330, 0, 0, 315, 0, 329, 320,
317, 130, 313, 320, 327, 306, 308, 313, 313, 305,
308, 303, 0, 0, 315, 299, 309, 316, 307, 295,
294, 308, 297, 310, 290, 0, 300, 282, 0, 301,
0, 298, 285, 0, 284, 279, 284, 283, 293, 0,
279, 0, 283, 0, 0, 279, 276, 290, 0, 275,
275, 273, 289, 274, 286, 268, 286, 281, 0, 276,
276, 262, 261, 274, 260, 274, 273, 272, 0, 256,
0, 250, 0, 269, 253, 252, 252, 0, 265, 255,
250, 249, 261, 251, 250, 0, 0, 0, 254, 0,
242, 0, 256, 252, 238, 0, 252, 253, 236, 241,
234, 252, 234, 231, 232, 229, 0, 234, 246, 233,
240, 230, 238, 223, 0, 0, 0, 215, 222, 0,
0, 219, 0, 218, 0, 232, 0, 233, 220, 219,
0, 215, 0, 218, 0, 210, 212, 0, 211, 225,
218, 0, 0, 221, 224, 206, 221, 0, 217, 0,
0, 201, 215, 214, 0, 0, 198, 197, 202, 0,
211, 196, 0, 0, 202, 198, 0, 193, 0, 205,
205, 193, 203, 192, 0, 179, 0, 0, 199, 0,
183, 177, 183, 0, 174, 0, 179, 192, 0, 191,
0, 0, 182, 0, 186, 0, 173, 173, 179, 165,
188, 180, 179, 165, 150, 117, 0, 129, 135, 125,
122, 118, 110, 0, 446, 166, 172, 178, 151, 180,
146, 186, 192, 198, 204
} ;
static yyconst flex_int16_t yy_def[403] =
static yyconst flex_int16_t yy_def[406] =
{ 0,
393, 1, 394, 394, 395, 395, 396, 396, 393, 393,
393, 393, 393, 393, 393, 393, 393, 393, 393, 393,
393, 393, 393, 393, 397, 393, 393, 393, 393, 393,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 393, 393,
399, 400, 401, 393, 402, 393, 393, 393, 393, 393,
393, 397, 393, 393, 393, 393, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 399, 400, 400,
393, 401, 393, 402, 393, 393, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
398, 398, 0, 393, 393, 393, 393, 393, 393, 393,
393, 393
395, 1, 396, 396, 397, 397, 398, 398, 395, 395,
395, 395, 395, 399, 395, 395, 395, 395, 395, 395,
395, 395, 395, 395, 395, 400, 395, 395, 395, 395,
395, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 395,
395, 402, 403, 404, 395, 405, 395, 395, 399, 395,
395, 395, 395, 400, 395, 395, 395, 395, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 402,
403, 403, 395, 404, 395, 405, 395, 395, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 401, 401, 401, 401, 401, 401,
401, 401, 401, 401, 0, 395, 395, 395, 395, 395,
395, 395, 395, 395, 395
} ;
static yyconst flex_int16_t yy_nxt[494] =
static yyconst flex_int16_t yy_nxt[497] =
{ 0,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36, 37, 37, 38,
37, 37, 39, 37, 40, 41, 42, 37, 43, 44,
45, 46, 47, 48, 37, 37, 37, 49, 50, 57,
57, 57, 57, 60, 68, 61, 64, 65, 70, 69,
74, 113, 71, 114, 75, 72, 60, 76, 61, 85,
77, 79, 82, 78, 83, 80, 86, 93, 73, 87,
90, 81, 88, 95, 84, 89, 97, 94, 91, 96,
103, 106, 128, 92, 98, 110, 99, 116, 100, 104,
105, 101, 111, 107, 117, 120, 154, 108, 129, 112,
121, 109, 57, 57, 134, 136, 137, 141, 164, 166,
135, 155, 156, 138, 165, 170, 142, 172, 175, 196,
181, 200, 201, 143, 167, 173, 171, 185, 168, 176,
182, 186, 393, 120, 215, 197, 207, 393, 121, 67,
208, 217, 238, 239, 392, 391, 390, 389, 388, 216,
387, 218, 386, 385, 240, 51, 51, 51, 51, 51,
51, 53, 53, 53, 53, 53, 53, 55, 55, 55,
55, 55, 55, 62, 62, 118, 118, 118, 384, 118,
118, 119, 119, 119, 119, 119, 119, 122, 122, 383,
122, 122, 122, 124, 382, 124, 124, 124, 124, 381,
380, 379, 378, 377, 376, 375, 374, 373, 372, 371,
370, 369, 368, 367, 366, 365, 364, 363, 362, 361,
360, 359, 358, 357, 356, 355, 354, 353, 352, 351,
350, 349, 348, 347, 346, 345, 344, 343, 342, 341,
340, 339, 338, 337, 336, 335, 334, 333, 332, 331,
330, 329, 328, 327, 326, 325, 324, 323, 322, 321,
320, 319, 318, 317, 316, 315, 314, 313, 312, 311,
310, 309, 308, 307, 306, 305, 304, 303, 302, 301,
300, 299, 298, 297, 296, 295, 294, 293, 292, 291,
290, 289, 288, 287, 286, 285, 284, 283, 282, 281,
280, 279, 278, 277, 276, 275, 274, 273, 272, 271,
270, 269, 268, 267, 266, 265, 264, 263, 262, 261,
260, 259, 258, 257, 256, 255, 254, 253, 252, 251,
250, 249, 248, 247, 246, 245, 244, 243, 242, 241,
237, 236, 235, 234, 233, 232, 231, 230, 229, 228,
227, 226, 225, 224, 223, 222, 221, 220, 219, 214,
213, 212, 211, 210, 209, 206, 205, 204, 203, 202,
199, 198, 195, 194, 193, 192, 191, 190, 189, 188,
126, 125, 123, 187, 184, 183, 180, 179, 178, 177,
174, 169, 163, 162, 161, 160, 159, 158, 157, 153,
152, 151, 150, 149, 148, 147, 146, 145, 144, 140,
139, 133, 132, 131, 130, 127, 393, 126, 125, 123,
115, 102, 66, 63, 59, 58, 393, 56, 56, 54,
54, 52, 52, 9, 393, 393, 393, 393, 393, 393,
393, 393, 393, 393, 393, 393, 393, 393, 393, 393,
393, 393, 393, 393, 393, 393, 393, 393, 393, 393,
393, 393, 393, 393, 393, 393, 393, 393, 393, 393,
393, 393, 393, 393, 393, 393, 393, 393, 393, 393,
393, 393, 393
30, 31, 32, 33, 34, 35, 36, 37, 38, 38,
39, 38, 38, 40, 38, 41, 42, 43, 38, 44,
45, 46, 47, 48, 49, 38, 38, 38, 50, 51,
58, 58, 58, 58, 62, 70, 63, 66, 67, 72,
71, 76, 115, 73, 116, 77, 74, 62, 78, 63,
87, 79, 81, 84, 80, 85, 82, 88, 95, 75,
89, 92, 83, 90, 97, 86, 91, 99, 96, 93,
98, 105, 108, 130, 94, 100, 112, 101, 118, 102,
106, 107, 103, 113, 109, 119, 122, 156, 110, 131,
114, 123, 111, 58, 58, 136, 138, 139, 143, 166,
168, 137, 157, 158, 140, 167, 172, 144, 174, 177,
198, 183, 202, 203, 145, 169, 175, 173, 187, 170,
178, 184, 188, 395, 122, 217, 199, 209, 395, 123,
69, 210, 219, 240, 241, 59, 394, 393, 392, 391,
218, 390, 220, 389, 388, 242, 52, 52, 52, 52,
52, 52, 54, 54, 54, 54, 54, 54, 56, 56,
56, 56, 56, 56, 64, 64, 120, 120, 120, 387,
120, 120, 121, 121, 121, 121, 121, 121, 124, 124,
386, 124, 124, 124, 126, 385, 126, 126, 126, 126,
384, 383, 382, 381, 380, 379, 378, 377, 376, 375,
374, 373, 372, 371, 370, 369, 368, 367, 366, 365,
364, 363, 362, 361, 360, 359, 358, 357, 356, 355,
354, 353, 352, 351, 350, 349, 348, 347, 346, 345,
344, 343, 342, 341, 340, 339, 338, 337, 336, 335,
334, 333, 332, 331, 330, 329, 328, 327, 326, 325,
324, 323, 322, 321, 320, 319, 318, 317, 316, 315,
314, 313, 312, 311, 310, 309, 308, 307, 306, 305,
304, 303, 302, 301, 300, 299, 298, 297, 296, 295,
294, 293, 292, 291, 290, 289, 288, 287, 286, 285,
284, 283, 282, 281, 280, 279, 278, 277, 276, 275,
274, 273, 272, 271, 270, 269, 268, 267, 266, 265,
264, 263, 262, 261, 260, 259, 258, 257, 256, 255,
254, 253, 252, 251, 250, 249, 248, 247, 246, 245,
244, 243, 239, 238, 237, 236, 235, 234, 233, 232,
231, 230, 229, 228, 227, 226, 225, 224, 223, 222,
221, 216, 215, 214, 213, 212, 211, 208, 207, 206,
205, 204, 201, 200, 197, 196, 195, 194, 193, 192,
191, 190, 128, 127, 125, 189, 186, 185, 182, 181,
180, 179, 176, 171, 165, 164, 163, 162, 161, 160,
159, 155, 154, 153, 152, 151, 150, 149, 148, 147,
146, 142, 141, 135, 134, 133, 132, 129, 395, 128,
127, 125, 117, 104, 68, 65, 61, 60, 395, 57,
57, 55, 55, 53, 53, 9, 395, 395, 395, 395,
395, 395, 395, 395, 395, 395, 395, 395, 395, 395,
395, 395, 395, 395, 395, 395, 395, 395, 395, 395,
395, 395, 395, 395, 395, 395, 395, 395, 395, 395,
395, 395, 395, 395, 395, 395, 395, 395, 395, 395,
395, 395, 395, 395, 395, 395
} ;
static yyconst flex_int16_t yy_chk[494] =
static yyconst flex_int16_t yy_chk[497] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 11,
11, 12, 12, 24, 31, 24, 27, 27, 32, 31,
33, 46, 32, 46, 33, 32, 61, 33, 61, 36,
33, 34, 35, 33, 35, 34, 36, 39, 32, 36,
38, 34, 36, 40, 35, 36, 41, 39, 38, 40,
43, 44, 69, 38, 41, 45, 41, 48, 41, 43,
43, 41, 45, 44, 48, 52, 91, 44, 69, 45,
52, 44, 57, 57, 75, 76, 76, 79, 102, 103,
75, 91, 91, 76, 102, 105, 79, 106, 108, 137,
113, 140, 140, 79, 103, 106, 105, 116, 103, 108,
113, 116, 119, 120, 155, 137, 146, 119, 120, 398,
146, 156, 180, 180, 391, 390, 389, 388, 387, 155,
386, 156, 384, 383, 180, 394, 394, 394, 394, 394,
394, 395, 395, 395, 395, 395, 395, 396, 396, 396,
396, 396, 396, 397, 397, 399, 399, 399, 382, 399,
399, 400, 400, 400, 400, 400, 400, 401, 401, 381,
401, 401, 401, 402, 380, 402, 402, 402, 402, 379,
378, 377, 376, 375, 373, 371, 368, 366, 365, 363,
361, 360, 359, 357, 354, 352, 351, 350, 349, 348,
346, 344, 343, 340, 339, 337, 336, 335, 332, 331,
330, 327, 325, 324, 323, 322, 319, 318, 317, 315,
314, 312, 310, 308, 307, 306, 304, 302, 300, 297,
296, 292, 291, 290, 289, 288, 287, 286, 284, 283,
282, 281, 280, 279, 278, 277, 276, 275, 273, 272,
271, 269, 267, 263, 262, 261, 260, 259, 258, 257,
255, 254, 253, 252, 250, 248, 246, 245, 244, 243,
242, 241, 240, 239, 238, 236, 235, 234, 233, 232,
231, 230, 229, 228, 226, 225, 224, 221, 219, 217,
216, 215, 214, 213, 211, 210, 208, 206, 205, 203,
202, 201, 200, 199, 198, 197, 196, 195, 194, 193,
190, 189, 188, 187, 186, 185, 184, 183, 182, 181,
179, 178, 177, 175, 172, 171, 170, 169, 168, 167,
166, 165, 164, 162, 161, 160, 159, 158, 157, 154,
153, 152, 150, 149, 148, 145, 144, 143, 142, 141,
139, 138, 136, 135, 134, 133, 132, 131, 130, 129,
126, 125, 123, 117, 115, 114, 112, 111, 110, 109,
107, 104, 101, 100, 99, 96, 95, 94, 93, 89,
88, 87, 86, 85, 84, 83, 82, 81, 80, 78,
77, 74, 72, 71, 70, 68, 62, 60, 56, 54,
47, 42, 29, 25, 23, 22, 9, 8, 7, 6,
5, 4, 3, 393, 393, 393, 393, 393, 393, 393,
393, 393, 393, 393, 393, 393, 393, 393, 393, 393,
393, 393, 393, 393, 393, 393, 393, 393, 393, 393,
393, 393, 393, 393, 393, 393, 393, 393, 393, 393,
393, 393, 393, 393, 393, 393, 393, 393, 393, 393,
393, 393, 393
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
11, 11, 12, 12, 25, 32, 25, 28, 28, 33,
32, 34, 47, 33, 47, 34, 33, 63, 34, 63,
37, 34, 35, 36, 34, 36, 35, 37, 40, 33,
37, 39, 35, 37, 41, 36, 37, 42, 40, 39,
41, 44, 45, 71, 39, 42, 46, 42, 49, 42,
44, 44, 42, 46, 45, 49, 53, 93, 45, 71,
46, 53, 45, 58, 58, 77, 78, 78, 81, 104,
105, 77, 93, 93, 78, 104, 107, 81, 108, 110,
139, 115, 142, 142, 81, 105, 108, 107, 118, 105,
110, 115, 118, 121, 122, 157, 139, 148, 121, 122,
401, 148, 158, 182, 182, 399, 393, 392, 391, 390,
157, 389, 158, 388, 386, 182, 396, 396, 396, 396,
396, 396, 397, 397, 397, 397, 397, 397, 398, 398,
398, 398, 398, 398, 400, 400, 402, 402, 402, 385,
402, 402, 403, 403, 403, 403, 403, 403, 404, 404,
384, 404, 404, 404, 405, 383, 405, 405, 405, 405,
382, 381, 380, 379, 378, 377, 375, 373, 370, 368,
367, 365, 363, 362, 361, 359, 356, 354, 353, 352,
351, 350, 348, 346, 345, 342, 341, 339, 338, 337,
334, 333, 332, 329, 327, 326, 325, 324, 321, 320,
319, 317, 316, 314, 312, 310, 309, 308, 306, 304,
302, 299, 298, 294, 293, 292, 291, 290, 289, 288,
286, 285, 284, 283, 282, 281, 280, 279, 278, 277,
275, 274, 273, 271, 269, 265, 264, 263, 262, 261,
260, 259, 257, 256, 255, 254, 252, 250, 248, 247,
246, 245, 244, 243, 242, 241, 240, 238, 237, 236,
235, 234, 233, 232, 231, 230, 228, 227, 226, 223,
221, 219, 218, 217, 216, 215, 213, 212, 210, 208,
207, 205, 204, 203, 202, 201, 200, 199, 198, 197,
196, 195, 192, 191, 190, 189, 188, 187, 186, 185,
184, 183, 181, 180, 179, 177, 174, 173, 172, 171,
170, 169, 168, 167, 166, 164, 163, 162, 161, 160,
159, 156, 155, 154, 152, 151, 150, 147, 146, 145,
144, 143, 141, 140, 138, 137, 136, 135, 134, 133,
132, 131, 128, 127, 125, 119, 117, 116, 114, 113,
112, 111, 109, 106, 103, 102, 101, 98, 97, 96,
95, 91, 90, 89, 88, 87, 86, 85, 84, 83,
82, 80, 79, 76, 74, 73, 72, 70, 64, 62,
57, 55, 48, 43, 30, 26, 24, 23, 9, 8,
7, 6, 5, 4, 3, 395, 395, 395, 395, 395,
395, 395, 395, 395, 395, 395, 395, 395, 395, 395,
395, 395, 395, 395, 395, 395, 395, 395, 395, 395,
395, 395, 395, 395, 395, 395, 395, 395, 395, 395,
395, 395, 395, 395, 395, 395, 395, 395, 395, 395,
395, 395, 395, 395, 395, 395
} ;
......@@ -908,7 +908,7 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
#line 91 "pars0lex.l"
#line 92 "pars0lex.l"
#line 914 "_flex_tmp.c"
......@@ -964,13 +964,13 @@ YY_DECL
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 394 )
if ( yy_current_state >= 396 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_current_state != 393 );
while ( yy_current_state != 395 );
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
......@@ -992,7 +992,7 @@ YY_DECL
case 1:
YY_RULE_SETUP
#line 93 "pars0lex.l"
#line 94 "pars0lex.l"
{
yylval = sym_tab_add_int_lit(pars_sym_tab_global,
atoi(yytext));
......@@ -1001,7 +1001,7 @@ YY_RULE_SETUP
YY_BREAK
case 2:
YY_RULE_SETUP
#line 99 "pars0lex.l"
#line 100 "pars0lex.l"
{
ut_error; /* not implemented */
......@@ -1010,7 +1010,7 @@ YY_RULE_SETUP
YY_BREAK
case 3:
YY_RULE_SETUP
#line 105 "pars0lex.l"
#line 106 "pars0lex.l"
{
ulint type;
......@@ -1022,7 +1022,17 @@ YY_RULE_SETUP
YY_BREAK
case 4:
YY_RULE_SETUP
#line 114 "pars0lex.l"
#line 115 "pars0lex.l"
{
yylval = sym_tab_add_bound_id(pars_sym_tab_global,
yytext + 1);
return(PARS_ID_TOKEN);
}
YY_BREAK
case 5:
YY_RULE_SETUP
#line 122 "pars0lex.l"
{
/* Quoted character string literals are handled in an explicit
start state 'quoted'. This state is entered and the buffer for
......@@ -1033,19 +1043,19 @@ In the state 'quoted', only two actions are possible (defined below). */
stringbuf_len = 0;
}
YY_BREAK
case 5:
/* rule 5 can match eol */
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
#line 123 "pars0lex.l"
#line 131 "pars0lex.l"
{
/* Got a sequence of characters other than "'":
append to string buffer */
string_append(yytext, yyleng);
}
YY_BREAK
case 6:
case 7:
YY_RULE_SETUP
#line 128 "pars0lex.l"
#line 136 "pars0lex.l"
{
/* Got a sequence of "'" characters:
append half of them to string buffer,
......@@ -1070,9 +1080,9 @@ YY_RULE_SETUP
}
}
YY_BREAK
case 7:
case 8:
YY_RULE_SETUP
#line 152 "pars0lex.l"
#line 160 "pars0lex.l"
{
/* Quoted identifiers are handled in an explicit start state 'id'.
This state is entered and the buffer for the scanned string is emptied
......@@ -1083,19 +1093,19 @@ In the state 'id', only two actions are possible (defined below). */
stringbuf_len = 0;
}
YY_BREAK
case 8:
/* rule 8 can match eol */
case 9:
/* rule 9 can match eol */
YY_RULE_SETUP
#line 161 "pars0lex.l"
#line 169 "pars0lex.l"
{
/* Got a sequence of characters other than '"':
append to string buffer */
string_append(yytext, yyleng);
}
YY_BREAK
case 9:
case 10:
YY_RULE_SETUP
#line 166 "pars0lex.l"
#line 174 "pars0lex.l"
{
/* Got a sequence of '"' characters:
append half of them to string buffer,
......@@ -1121,18 +1131,18 @@ YY_RULE_SETUP
}
}
YY_BREAK
case 10:
case 11:
YY_RULE_SETUP
#line 191 "pars0lex.l"
#line 199 "pars0lex.l"
{
yylval = sym_tab_add_null_lit(pars_sym_tab_global);
return(PARS_NULL_LIT);
}
YY_BREAK
case 11:
case 12:
YY_RULE_SETUP
#line 197 "pars0lex.l"
#line 205 "pars0lex.l"
{
/* Implicit cursor name */
yylval = sym_tab_add_str_lit(pars_sym_tab_global,
......@@ -1140,548 +1150,548 @@ YY_RULE_SETUP
return(PARS_SQL_TOKEN);
}
YY_BREAK
case 12:
case 13:
YY_RULE_SETUP
#line 204 "pars0lex.l"
#line 212 "pars0lex.l"
{
return(PARS_AND_TOKEN);
}
YY_BREAK
case 13:
case 14:
YY_RULE_SETUP
#line 208 "pars0lex.l"
#line 216 "pars0lex.l"
{
return(PARS_OR_TOKEN);
}
YY_BREAK
case 14:
case 15:
YY_RULE_SETUP
#line 212 "pars0lex.l"
#line 220 "pars0lex.l"
{
return(PARS_NOT_TOKEN);
}
YY_BREAK
case 15:
case 16:
YY_RULE_SETUP
#line 216 "pars0lex.l"
#line 224 "pars0lex.l"
{
return(PARS_PROCEDURE_TOKEN);
}
YY_BREAK
case 16:
case 17:
YY_RULE_SETUP
#line 220 "pars0lex.l"
#line 228 "pars0lex.l"
{
return(PARS_IN_TOKEN);
}
YY_BREAK
case 17:
case 18:
YY_RULE_SETUP
#line 224 "pars0lex.l"
#line 232 "pars0lex.l"
{
return(PARS_OUT_TOKEN);
}
YY_BREAK
case 18:
case 19:
YY_RULE_SETUP
#line 228 "pars0lex.l"
#line 236 "pars0lex.l"
{
return(PARS_BINARY_TOKEN);
}
YY_BREAK
case 19:
case 20:
YY_RULE_SETUP
#line 232 "pars0lex.l"
#line 240 "pars0lex.l"
{
return(PARS_BLOB_TOKEN);
}
YY_BREAK
case 20:
case 21:
YY_RULE_SETUP
#line 236 "pars0lex.l"
#line 244 "pars0lex.l"
{
return(PARS_INT_TOKEN);
}
YY_BREAK
case 21:
case 22:
YY_RULE_SETUP
#line 240 "pars0lex.l"
#line 248 "pars0lex.l"
{
return(PARS_INT_TOKEN);
}
YY_BREAK
case 22:
case 23:
YY_RULE_SETUP
#line 244 "pars0lex.l"
#line 252 "pars0lex.l"
{
return(PARS_FLOAT_TOKEN);
}
YY_BREAK
case 23:
case 24:
YY_RULE_SETUP
#line 248 "pars0lex.l"
#line 256 "pars0lex.l"
{
return(PARS_CHAR_TOKEN);
}
YY_BREAK
case 24:
case 25:
YY_RULE_SETUP
#line 252 "pars0lex.l"
#line 260 "pars0lex.l"
{
return(PARS_IS_TOKEN);
}
YY_BREAK
case 25:
case 26:
YY_RULE_SETUP
#line 256 "pars0lex.l"
#line 264 "pars0lex.l"
{
return(PARS_BEGIN_TOKEN);
}
YY_BREAK
case 26:
case 27:
YY_RULE_SETUP
#line 260 "pars0lex.l"
#line 268 "pars0lex.l"
{
return(PARS_END_TOKEN);
}
YY_BREAK
case 27:
case 28:
YY_RULE_SETUP
#line 264 "pars0lex.l"
#line 272 "pars0lex.l"
{
return(PARS_IF_TOKEN);
}
YY_BREAK
case 28:
case 29:
YY_RULE_SETUP
#line 268 "pars0lex.l"
#line 276 "pars0lex.l"
{
return(PARS_THEN_TOKEN);
}
YY_BREAK
case 29:
case 30:
YY_RULE_SETUP
#line 272 "pars0lex.l"
#line 280 "pars0lex.l"
{
return(PARS_ELSE_TOKEN);
}
YY_BREAK
case 30:
case 31:
YY_RULE_SETUP
#line 276 "pars0lex.l"
#line 284 "pars0lex.l"
{
return(PARS_ELSIF_TOKEN);
}
YY_BREAK
case 31:
case 32:
YY_RULE_SETUP
#line 280 "pars0lex.l"
#line 288 "pars0lex.l"
{
return(PARS_LOOP_TOKEN);
}
YY_BREAK
case 32:
case 33:
YY_RULE_SETUP
#line 284 "pars0lex.l"
#line 292 "pars0lex.l"
{
return(PARS_WHILE_TOKEN);
}
YY_BREAK
case 33:
case 34:
YY_RULE_SETUP
#line 288 "pars0lex.l"
#line 296 "pars0lex.l"
{
return(PARS_RETURN_TOKEN);
}
YY_BREAK
case 34:
case 35:
YY_RULE_SETUP
#line 292 "pars0lex.l"
#line 300 "pars0lex.l"
{
return(PARS_SELECT_TOKEN);
}
YY_BREAK
case 35:
case 36:
YY_RULE_SETUP
#line 296 "pars0lex.l"
#line 304 "pars0lex.l"
{
return(PARS_SUM_TOKEN);
}
YY_BREAK
case 36:
case 37:
YY_RULE_SETUP
#line 300 "pars0lex.l"
#line 308 "pars0lex.l"
{
return(PARS_COUNT_TOKEN);
}
YY_BREAK
case 37:
case 38:
YY_RULE_SETUP
#line 304 "pars0lex.l"
#line 312 "pars0lex.l"
{
return(PARS_DISTINCT_TOKEN);
}
YY_BREAK
case 38:
case 39:
YY_RULE_SETUP
#line 308 "pars0lex.l"
#line 316 "pars0lex.l"
{
return(PARS_FROM_TOKEN);
}
YY_BREAK
case 39:
case 40:
YY_RULE_SETUP
#line 312 "pars0lex.l"
#line 320 "pars0lex.l"
{
return(PARS_WHERE_TOKEN);
}
YY_BREAK
case 40:
case 41:
YY_RULE_SETUP
#line 316 "pars0lex.l"
#line 324 "pars0lex.l"
{
return(PARS_FOR_TOKEN);
}
YY_BREAK
case 41:
case 42:
YY_RULE_SETUP
#line 320 "pars0lex.l"
#line 328 "pars0lex.l"
{
return(PARS_CONSISTENT_TOKEN);
}
YY_BREAK
case 42:
case 43:
YY_RULE_SETUP
#line 324 "pars0lex.l"
#line 332 "pars0lex.l"
{
return(PARS_READ_TOKEN);
}
YY_BREAK
case 43:
case 44:
YY_RULE_SETUP
#line 328 "pars0lex.l"
#line 336 "pars0lex.l"
{
return(PARS_ORDER_TOKEN);
}
YY_BREAK
case 44:
case 45:
YY_RULE_SETUP
#line 332 "pars0lex.l"
#line 340 "pars0lex.l"
{
return(PARS_BY_TOKEN);
}
YY_BREAK
case 45:
case 46:
YY_RULE_SETUP
#line 336 "pars0lex.l"
#line 344 "pars0lex.l"
{
return(PARS_ASC_TOKEN);
}
YY_BREAK
case 46:
case 47:
YY_RULE_SETUP
#line 340 "pars0lex.l"
#line 348 "pars0lex.l"
{
return(PARS_DESC_TOKEN);
}
YY_BREAK
case 47:
case 48:
YY_RULE_SETUP
#line 344 "pars0lex.l"
#line 352 "pars0lex.l"
{
return(PARS_INSERT_TOKEN);
}
YY_BREAK
case 48:
case 49:
YY_RULE_SETUP
#line 348 "pars0lex.l"
#line 356 "pars0lex.l"
{
return(PARS_INTO_TOKEN);
}
YY_BREAK
case 49:
case 50:
YY_RULE_SETUP
#line 352 "pars0lex.l"
#line 360 "pars0lex.l"
{
return(PARS_VALUES_TOKEN);
}
YY_BREAK
case 50:
case 51:
YY_RULE_SETUP
#line 356 "pars0lex.l"
#line 364 "pars0lex.l"
{
return(PARS_UPDATE_TOKEN);
}
YY_BREAK
case 51:
case 52:
YY_RULE_SETUP
#line 360 "pars0lex.l"
#line 368 "pars0lex.l"
{
return(PARS_SET_TOKEN);
}
YY_BREAK
case 52:
case 53:
YY_RULE_SETUP
#line 364 "pars0lex.l"
#line 372 "pars0lex.l"
{
return(PARS_DELETE_TOKEN);
}
YY_BREAK
case 53:
case 54:
YY_RULE_SETUP
#line 368 "pars0lex.l"
#line 376 "pars0lex.l"
{
return(PARS_CURRENT_TOKEN);
}
YY_BREAK
case 54:
case 55:
YY_RULE_SETUP
#line 372 "pars0lex.l"
#line 380 "pars0lex.l"
{
return(PARS_OF_TOKEN);
}
YY_BREAK
case 55:
case 56:
YY_RULE_SETUP
#line 376 "pars0lex.l"
#line 384 "pars0lex.l"
{
return(PARS_CREATE_TOKEN);
}
YY_BREAK
case 56:
case 57:
YY_RULE_SETUP
#line 380 "pars0lex.l"
#line 388 "pars0lex.l"
{
return(PARS_TABLE_TOKEN);
}
YY_BREAK
case 57:
case 58:
YY_RULE_SETUP
#line 384 "pars0lex.l"
#line 392 "pars0lex.l"
{
return(PARS_INDEX_TOKEN);
}
YY_BREAK
case 58:
case 59:
YY_RULE_SETUP
#line 388 "pars0lex.l"
#line 396 "pars0lex.l"
{
return(PARS_UNIQUE_TOKEN);
}
YY_BREAK
case 59:
case 60:
YY_RULE_SETUP
#line 392 "pars0lex.l"
#line 400 "pars0lex.l"
{
return(PARS_CLUSTERED_TOKEN);
}
YY_BREAK
case 60:
case 61:
YY_RULE_SETUP
#line 396 "pars0lex.l"
#line 404 "pars0lex.l"
{
return(PARS_DOES_NOT_FIT_IN_MEM_TOKEN);
}
YY_BREAK
case 61:
case 62:
YY_RULE_SETUP
#line 400 "pars0lex.l"
#line 408 "pars0lex.l"
{
return(PARS_ON_TOKEN);
}
YY_BREAK
case 62:
case 63:
YY_RULE_SETUP
#line 404 "pars0lex.l"
#line 412 "pars0lex.l"
{
return(PARS_DECLARE_TOKEN);
}
YY_BREAK
case 63:
case 64:
YY_RULE_SETUP
#line 408 "pars0lex.l"
#line 416 "pars0lex.l"
{
return(PARS_CURSOR_TOKEN);
}
YY_BREAK
case 64:
case 65:
YY_RULE_SETUP
#line 412 "pars0lex.l"
#line 420 "pars0lex.l"
{
return(PARS_OPEN_TOKEN);
}
YY_BREAK
case 65:
case 66:
YY_RULE_SETUP
#line 416 "pars0lex.l"
#line 424 "pars0lex.l"
{
return(PARS_FETCH_TOKEN);
}
YY_BREAK
case 66:
case 67:
YY_RULE_SETUP
#line 420 "pars0lex.l"
#line 428 "pars0lex.l"
{
return(PARS_CLOSE_TOKEN);
}
YY_BREAK
case 67:
case 68:
YY_RULE_SETUP
#line 424 "pars0lex.l"
#line 432 "pars0lex.l"
{
return(PARS_NOTFOUND_TOKEN);
}
YY_BREAK
case 68:
case 69:
YY_RULE_SETUP
#line 428 "pars0lex.l"
#line 436 "pars0lex.l"
{
return(PARS_TO_CHAR_TOKEN);
}
YY_BREAK
case 69:
case 70:
YY_RULE_SETUP
#line 432 "pars0lex.l"
#line 440 "pars0lex.l"
{
return(PARS_TO_NUMBER_TOKEN);
}
YY_BREAK
case 70:
case 71:
YY_RULE_SETUP
#line 436 "pars0lex.l"
#line 444 "pars0lex.l"
{
return(PARS_TO_BINARY_TOKEN);
}
YY_BREAK
case 71:
case 72:
YY_RULE_SETUP
#line 440 "pars0lex.l"
#line 448 "pars0lex.l"
{
return(PARS_BINARY_TO_NUMBER_TOKEN);
}
YY_BREAK
case 72:
case 73:
YY_RULE_SETUP
#line 444 "pars0lex.l"
#line 452 "pars0lex.l"
{
return(PARS_SUBSTR_TOKEN);
}
YY_BREAK
case 73:
case 74:
YY_RULE_SETUP
#line 448 "pars0lex.l"
#line 456 "pars0lex.l"
{
return(PARS_REPLSTR_TOKEN);
}
YY_BREAK
case 74:
case 75:
YY_RULE_SETUP
#line 452 "pars0lex.l"
#line 460 "pars0lex.l"
{
return(PARS_CONCAT_TOKEN);
}
YY_BREAK
case 75:
case 76:
YY_RULE_SETUP
#line 456 "pars0lex.l"
#line 464 "pars0lex.l"
{
return(PARS_INSTR_TOKEN);
}
YY_BREAK
case 76:
case 77:
YY_RULE_SETUP
#line 460 "pars0lex.l"
#line 468 "pars0lex.l"
{
return(PARS_LENGTH_TOKEN);
}
YY_BREAK
case 77:
case 78:
YY_RULE_SETUP
#line 464 "pars0lex.l"
#line 472 "pars0lex.l"
{
return(PARS_SYSDATE_TOKEN);
}
YY_BREAK
case 78:
case 79:
YY_RULE_SETUP
#line 468 "pars0lex.l"
#line 476 "pars0lex.l"
{
return(PARS_PRINTF_TOKEN);
}
YY_BREAK
case 79:
case 80:
YY_RULE_SETUP
#line 472 "pars0lex.l"
#line 480 "pars0lex.l"
{
return(PARS_ASSERT_TOKEN);
}
YY_BREAK
case 80:
case 81:
YY_RULE_SETUP
#line 476 "pars0lex.l"
#line 484 "pars0lex.l"
{
return(PARS_RND_TOKEN);
}
YY_BREAK
case 81:
case 82:
YY_RULE_SETUP
#line 480 "pars0lex.l"
#line 488 "pars0lex.l"
{
return(PARS_RND_STR_TOKEN);
}
YY_BREAK
case 82:
case 83:
YY_RULE_SETUP
#line 484 "pars0lex.l"
#line 492 "pars0lex.l"
{
return(PARS_ROW_PRINTF_TOKEN);
}
YY_BREAK
case 83:
case 84:
YY_RULE_SETUP
#line 488 "pars0lex.l"
#line 496 "pars0lex.l"
{
return(PARS_COMMIT_TOKEN);
}
YY_BREAK
case 84:
case 85:
YY_RULE_SETUP
#line 492 "pars0lex.l"
#line 500 "pars0lex.l"
{
return(PARS_ROLLBACK_TOKEN);
}
YY_BREAK
case 85:
case 86:
YY_RULE_SETUP
#line 496 "pars0lex.l"
#line 504 "pars0lex.l"
{
return(PARS_WORK_TOKEN);
}
YY_BREAK
case 86:
case 87:
YY_RULE_SETUP
#line 500 "pars0lex.l"
#line 508 "pars0lex.l"
{
return(PARS_UNSIGNED_TOKEN);
}
YY_BREAK
case 87:
case 88:
YY_RULE_SETUP
#line 504 "pars0lex.l"
#line 512 "pars0lex.l"
{
return(PARS_EXIT_TOKEN);
}
YY_BREAK
case 88:
case 89:
YY_RULE_SETUP
#line 508 "pars0lex.l"
#line 516 "pars0lex.l"
{
return(PARS_FUNCTION_TOKEN);
}
YY_BREAK
case 89:
case 90:
YY_RULE_SETUP
#line 512 "pars0lex.l"
#line 520 "pars0lex.l"
{
yylval = sym_tab_add_id(pars_sym_tab_global,
(byte*)yytext,
......@@ -1689,52 +1699,44 @@ YY_RULE_SETUP
return(PARS_ID_TOKEN);
}
YY_BREAK
case 90:
YY_RULE_SETUP
#line 519 "pars0lex.l"
{
return(PARS_DDOT_TOKEN);
}
YY_BREAK
case 91:
YY_RULE_SETUP
#line 523 "pars0lex.l"
#line 527 "pars0lex.l"
{
return(PARS_ASSIGN_TOKEN);
return(PARS_DDOT_TOKEN);
}
YY_BREAK
case 92:
YY_RULE_SETUP
#line 527 "pars0lex.l"
#line 531 "pars0lex.l"
{
return(PARS_LE_TOKEN);
return(PARS_ASSIGN_TOKEN);
}
YY_BREAK
case 93:
YY_RULE_SETUP
#line 531 "pars0lex.l"
#line 535 "pars0lex.l"
{
return(PARS_GE_TOKEN);
return(PARS_LE_TOKEN);
}
YY_BREAK
case 94:
YY_RULE_SETUP
#line 535 "pars0lex.l"
#line 539 "pars0lex.l"
{
return(PARS_NE_TOKEN);
return(PARS_GE_TOKEN);
}
YY_BREAK
case 95:
YY_RULE_SETUP
#line 539 "pars0lex.l"
#line 543 "pars0lex.l"
{
return((int)(*yytext));
return(PARS_NE_TOKEN);
}
YY_BREAK
case 96:
YY_RULE_SETUP
#line 544 "pars0lex.l"
#line 547 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1742,7 +1744,7 @@ YY_RULE_SETUP
YY_BREAK
case 97:
YY_RULE_SETUP
#line 549 "pars0lex.l"
#line 552 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1750,7 +1752,7 @@ YY_RULE_SETUP
YY_BREAK
case 98:
YY_RULE_SETUP
#line 554 "pars0lex.l"
#line 557 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1758,7 +1760,7 @@ YY_RULE_SETUP
YY_BREAK
case 99:
YY_RULE_SETUP
#line 559 "pars0lex.l"
#line 562 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1766,7 +1768,7 @@ YY_RULE_SETUP
YY_BREAK
case 100:
YY_RULE_SETUP
#line 564 "pars0lex.l"
#line 567 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1774,7 +1776,7 @@ YY_RULE_SETUP
YY_BREAK
case 101:
YY_RULE_SETUP
#line 569 "pars0lex.l"
#line 572 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1782,7 +1784,7 @@ YY_RULE_SETUP
YY_BREAK
case 102:
YY_RULE_SETUP
#line 574 "pars0lex.l"
#line 577 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1790,7 +1792,7 @@ YY_RULE_SETUP
YY_BREAK
case 103:
YY_RULE_SETUP
#line 579 "pars0lex.l"
#line 582 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1798,7 +1800,7 @@ YY_RULE_SETUP
YY_BREAK
case 104:
YY_RULE_SETUP
#line 584 "pars0lex.l"
#line 587 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1806,7 +1808,7 @@ YY_RULE_SETUP
YY_BREAK
case 105:
YY_RULE_SETUP
#line 589 "pars0lex.l"
#line 592 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1814,7 +1816,7 @@ YY_RULE_SETUP
YY_BREAK
case 106:
YY_RULE_SETUP
#line 594 "pars0lex.l"
#line 597 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1822,7 +1824,7 @@ YY_RULE_SETUP
YY_BREAK
case 107:
YY_RULE_SETUP
#line 599 "pars0lex.l"
#line 602 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1830,7 +1832,7 @@ YY_RULE_SETUP
YY_BREAK
case 108:
YY_RULE_SETUP
#line 604 "pars0lex.l"
#line 607 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1838,7 +1840,7 @@ YY_RULE_SETUP
YY_BREAK
case 109:
YY_RULE_SETUP
#line 609 "pars0lex.l"
#line 612 "pars0lex.l"
{
return((int)(*yytext));
......@@ -1846,35 +1848,43 @@ YY_RULE_SETUP
YY_BREAK
case 110:
YY_RULE_SETUP
#line 614 "pars0lex.l"
BEGIN(comment); /* eat up comment */
#line 617 "pars0lex.l"
{
return((int)(*yytext));
}
YY_BREAK
case 111:
/* rule 111 can match eol */
YY_RULE_SETUP
#line 616 "pars0lex.l"
#line 622 "pars0lex.l"
BEGIN(comment); /* eat up comment */
YY_BREAK
case 112:
/* rule 112 can match eol */
YY_RULE_SETUP
#line 617 "pars0lex.l"
#line 624 "pars0lex.l"
YY_BREAK
case 113:
/* rule 113 can match eol */
YY_RULE_SETUP
#line 618 "pars0lex.l"
BEGIN(INITIAL);
#line 625 "pars0lex.l"
YY_BREAK
case 114:
/* rule 114 can match eol */
YY_RULE_SETUP
#line 620 "pars0lex.l"
/* eat up whitespace */
#line 626 "pars0lex.l"
BEGIN(INITIAL);
YY_BREAK
case 115:
/* rule 115 can match eol */
YY_RULE_SETUP
#line 623 "pars0lex.l"
#line 628 "pars0lex.l"
/* eat up whitespace */
YY_BREAK
case 116:
YY_RULE_SETUP
#line 631 "pars0lex.l"
{
fprintf(stderr,"Unrecognized character: %02x\n",
*yytext);
......@@ -1884,12 +1894,12 @@ YY_RULE_SETUP
return(0);
}
YY_BREAK
case 116:
case 117:
YY_RULE_SETUP
#line 632 "pars0lex.l"
#line 640 "pars0lex.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
#line 1892 "_flex_tmp.c"
#line 1902 "_flex_tmp.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(comment):
case YY_STATE_EOF(quoted):
......@@ -2177,7 +2187,7 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 394 )
if ( yy_current_state >= 396 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
......@@ -2205,11 +2215,11 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 394 )
if ( yy_current_state >= 396 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 393);
yy_is_jam = (yy_current_state == 395);
return yy_is_jam ? 0 : yy_current_state;
}
......@@ -2732,7 +2742,7 @@ void yyfree (void * ptr )
#undef YY_DECL_IS_OURS
#undef YY_DECL
#endif
#line 632 "pars0lex.l"
#line 640 "pars0lex.l"
......@@ -84,6 +84,7 @@ string_append(
DIGIT [0-9]
ID [a-z_A-Z][a-z_A-Z0-9]*
BOUND_LIT \:[a-z_A-Z0-9]+
BOUND_ID \$[a-z_A-Z0-9]+
%x comment
%x quoted
......@@ -111,6 +112,13 @@ BOUND_LIT \:[a-z_A-Z0-9]+
return(type);
}
{BOUND_ID} {
yylval = sym_tab_add_bound_id(pars_sym_tab_global,
yytext + 1);
return(PARS_ID_TOKEN);
}
"'" {
/* Quoted character string literals are handled in an explicit
start state 'quoted'. This state is entered and the buffer for
......
......@@ -1931,6 +1931,7 @@ pars_info_create(void)
info->heap = heap;
info->funcs = NULL;
info->bound_lits = NULL;
info->bound_ids = NULL;
info->graph_owns_us = TRUE;
return(info);
......@@ -2070,6 +2071,32 @@ pars_info_add_function(
ib_vector_push(info->funcs, puf);
}
/********************************************************************
Add bound id. */
void
pars_info_add_id(
/*=============*/
pars_info_t* info, /* in: info struct */
const char* name, /* in: name */
const char* id) /* in: id */
{
pars_bound_id_t* bid;
ut_ad(!pars_info_get_bound_id(info, name));
bid = mem_heap_alloc(info->heap, sizeof(*bid));
bid->name = name;
bid->id = id;
if (!info->bound_ids) {
info->bound_ids = ib_vector_create(info->heap, 8);
}
ib_vector_push(info->bound_ids, bid);
}
/********************************************************************
Get user function with the given name.*/
......@@ -2131,3 +2158,34 @@ pars_info_get_bound_lit(
return(NULL);
}
/********************************************************************
Get bound id with the given name.*/
pars_bound_id_t*
pars_info_get_bound_id(
/*===================*/
/* out: bound id, or NULL if not
found */
pars_info_t* info, /* in: info struct */
const char* name) /* in: bound id name to find */
{
ulint i;
ib_vector_t* vec;
if (!info || !info->bound_ids) {
return(NULL);
}
vec = info->bound_ids;
for (i = 0; i < ib_vector_size(vec); i++) {
pars_bound_id_t* bid = ib_vector_get(vec, i);
if (strcmp(bid->name, name) == 0) {
return(bid);
}
}
return(NULL);
}
......@@ -304,3 +304,42 @@ sym_tab_add_id(
return(node);
}
/**********************************************************************
Add a bound identifier to a symbol table. */
sym_node_t*
sym_tab_add_bound_id(
/*===========*/
/* out: symbol table node */
sym_tab_t* sym_tab, /* in: symbol table */
const char* name) /* in: name of bound id */
{
sym_node_t* node;
pars_bound_id_t* bid;
bid = pars_info_get_bound_id(sym_tab->info, name);
ut_a(bid);
node = mem_heap_alloc(sym_tab->heap, sizeof(sym_node_t));
node->common.type = QUE_NODE_SYMBOL;
node->resolved = FALSE;
node->indirection = NULL;
node->name = mem_heap_strdup(sym_tab->heap, bid->id);
node->name_len = strlen(node->name);
UT_LIST_ADD_LAST(sym_list, sym_tab->sym_list, node);
dfield_set_data(&(node->common.val), NULL, UNIV_SQL_NULL);
node->common.val_buf_size = 0;
node->prefetch_buf = NULL;
node->cursor_def = NULL;
node->sym_table = sym_tab;
return(node);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment