📄 sql.tab.c
字号:
if (yyn <= 0)
{
if (yyn == 0 || yyn == YYTABLE_NINF)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the look-ahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
yystate = yyn;
goto yynewstate;
/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state. |
`-----------------------------------------------------------*/
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
goto yyreduce;
/*-----------------------------.
| yyreduce -- Do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
`$$ = $1'.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
users should not rely upon it. Assigning to YYVAL
unconditionally makes the parser a bit smaller, and it avoids a
GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen];
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
case 2:
#line 124 "sql.y"
{
SQL_input* sql = (SQL_input*) info;
*sql->view = (yyvsp[0].query);
;}
break;
case 9:
#line 141 "sql.y"
{
SQL_input *sql = (SQL_input*) info;
MSIVIEW *insert = NULL;
UINT r;
r = INSERT_CreateView( sql->db, &insert, (yyvsp[-7].string), (yyvsp[-5].column_list), (yyvsp[-1].column_list), FALSE );
if( !insert )
YYABORT;
(yyval.query) = insert;
;}
break;
case 10:
#line 152 "sql.y"
{
SQL_input *sql = (SQL_input*) info;
MSIVIEW *insert = NULL;
INSERT_CreateView( sql->db, &insert, (yyvsp[-8].string), (yyvsp[-6].column_list), (yyvsp[-2].column_list), TRUE );
if( !insert )
YYABORT;
(yyval.query) = insert;
;}
break;
case 11:
#line 165 "sql.y"
{
SQL_input* sql = (SQL_input*) info;
MSIVIEW *create = NULL;
if( !(yyvsp[-1].column_list) )
YYABORT;
CREATE_CreateView( sql->db, &create, (yyvsp[-3].string), (yyvsp[-1].column_list), FALSE );
if( !create )
YYABORT;
(yyval.query) = create;
;}
break;
case 12:
#line 177 "sql.y"
{
SQL_input* sql = (SQL_input*) info;
MSIVIEW *create = NULL;
if( !(yyvsp[-2].column_list) )
YYABORT;
CREATE_CreateView( sql->db, &create, (yyvsp[-4].string), (yyvsp[-2].column_list), TRUE );
if( !create )
YYABORT;
(yyval.query) = create;
;}
break;
case 13:
#line 192 "sql.y"
{
SQL_input* sql = (SQL_input*) info;
MSIVIEW *update = NULL;
UPDATE_CreateView( sql->db, &update, (yyvsp[-4].string), (yyvsp[-2].column_list), (yyvsp[0].expr) );
if( !update )
YYABORT;
(yyval.query) = update;
;}
break;
case 14:
#line 202 "sql.y"
{
SQL_input* sql = (SQL_input*) info;
MSIVIEW *update = NULL;
UPDATE_CreateView( sql->db, &update, (yyvsp[-2].string), (yyvsp[0].column_list), NULL );
if( !update )
YYABORT;
(yyval.query) = update;
;}
break;
case 15:
#line 215 "sql.y"
{
SQL_input* sql = (SQL_input*) info;
MSIVIEW *delete = NULL;
DELETE_CreateView( sql->db, &delete, (yyvsp[0].query) );
if( !delete )
YYABORT;
(yyval.query) = delete;
;}
break;
case 16:
#line 228 "sql.y"
{
SQL_input* sql = (SQL_input*) info;
MSIVIEW *alter = NULL;
ALTER_CreateView( sql->db, &alter, (yyvsp[-1].string), (yyvsp[0].integer) );
if( !alter )
YYABORT;
(yyval.query) = alter;
;}
break;
case 17:
#line 241 "sql.y"
{
(yyval.integer) = 1;
;}
break;
case 18:
#line 245 "sql.y"
{
(yyval.integer) = -1;
;}
break;
case 19:
#line 252 "sql.y"
{
if( SQL_MarkPrimaryKeys( (yyvsp[-3].column_list), (yyvsp[0].column_list) ) )
(yyval.column_list) = (yyvsp[-3].column_list);
else
(yyval.column_list) = NULL;
;}
break;
case 20:
#line 262 "sql.y"
{
column_info *ci;
for( ci = (yyvsp[-2].column_list); ci->next; ci = ci->next )
;
ci->next = (yyvsp[0].column_list);
(yyval.column_list) = (yyvsp[-2].column_list);
;}
break;
case 21:
#line 272 "sql.y"
{
(yyval.column_list) = (yyvsp[0].column_list);
;}
break;
case 22:
#line 279 "sql.y"
{
(yyval.column_list) = (yyvsp[-1].column_list);
(yyval.column_list)->type = (yyvsp[0].column_type) | MSITYPE_VALID;
;}
break;
case 23:
#line 287 "sql.y"
{
(yyval.column_type) = (yyvsp[0].column_type);
;}
break;
case 24:
#line 291 "sql.y"
{
(yyval.column_type) = (yyvsp[-1].column_type) | MSITYPE_LOCALIZABLE;
;}
break;
case 25:
#line 295 "sql.y"
{
FIXME("temporary column\n");
;}
break;
case 26:
#line 302 "sql.y"
{
(yyval.column_type) |= MSITYPE_NULLABLE;
;}
break;
case 27:
#line 306 "sql.y"
{
(yyval.column_type) = (yyvsp[-2].column_type);
;}
break;
case 28:
#line 313 "sql.y"
{
(yyval.column_type) = MSITYPE_STRING | 1;
;}
break;
case 29:
#line 317 "sql.y"
{
(yyval.column_type) = MSITYPE_STRING | 0x400 | (yyvsp[-1].column_type);
;}
break;
case 30:
#line 321 "sql.y"
{
(yyval.column_type) = 2;
;}
break;
case 31:
#line 325 "sql.y"
{
(yyval.column_type) = 2;
;}
break;
case 32:
#line 329 "sql.y"
{
(yyval.column_type) = 2;
;}
break;
case 33:
#line 333 "sql.y"
{
(yyval.column_type) = 4;
;}
break;
case 34:
#line 337 "sql.y"
{
(yyval.column_type) = MSITYPE_STRING | MSITYPE_VALID;
;}
break;
case 35:
#line 344 "sql.y"
{
if( ( (yyvsp[0].integer) > 255 ) || ( (yyvsp[0].integer) < 0 ) )
YYABORT;
(yyval.column_type) = (yyvsp[0].integer);
;}
break;
case 36:
#line 353 "sql.y"
{
SQL_input* sql = (SQL_input*) info;
(yyval.query) = NULL;
if( (yyvsp[0].column_list) )
ORDER_CreateView( sql->db, &(yyval.query), (yyvsp[-3].query), (yyvsp[0].column_list) );
else
(yyval.query) = (yyvsp[-3].query);
if( !(yyval.query) )
YYABORT;
;}
break;
case 38:
#line 369 "sql.y"
{
(yyval.query) = (yyvsp[0].query);
;}
break;
case 39:
#line 373 "sql.y"
{
SQL_input* sql = (SQL_input*) info;
UINT r;
(yyval.query) = NULL;
r = DISTINCT_CreateView( sql->db, &(yyval.query), (yyvsp[0].query) );
if (r != ERROR_SUCCESS)
{
(yyvsp[0].query)->ops->delete((yyvsp[0].query));
YYABORT;
}
;}
break;
case 40:
#line 389 "sql.y"
{
SQL_input* sql = (SQL_input*) info;
UINT r;
(yyval.query) = NULL;
if( (yyvsp[-1].column_list) )
{
r = SELECT_CreateView( sql->db, &(yyval.query), (yyvsp[0].query), (yyvsp[-1].column_list) );
if (r != ERROR_SUCCESS)
{
(yyvsp[0].query)->ops->delete((yyvsp[0].query));
YYABORT;
}
}
else
(yyval.query) = (yyvsp[0].query);
;}
break;
case 42:
#line 411 "sql.y"
{
(yyvsp[-2].column_list)->next = (yyvsp[0].column_list);
;}
break;
case 43:
#line 415 "sql.y"
{
(yyval.column_list) = NULL;
;}
break;
case 45:
#line 423 "sql.y"
{
SQL_input* sql = (SQL_input*) info;
UINT r;
(yyval.query) = NULL;
r = WHERE_CreateView( sql->db, &(yyval.query), (yyvsp[-2].query), (yyvsp[0].expr) );
if( r != ERROR_SUCCESS )
{
(yyvsp[-2].query)->ops->delete( (yyvsp[-2].query) );
YYABORT;
}
;}
break;
case 46:
#line 439 "sql.y"
{
SQL_input* sql = (SQL_input*) info;
UINT r;
(yyval.query) = NULL;
r = TABLE_CreateView( sql->db, (yyvsp[0].string), &(yyval.query) );
if( r != ERROR_SUCCESS || !(yyval.query) )
YYABORT;
;}
break;
case 47:
#line 449 "sql.y"
{
SQL_input* sql = (SQL_input*) info;
UINT r;
/* only support inner joins on two tables */
r = JOIN_CreateView( sql->db, &(yyval.query), (yyvsp[-2].string), (yyvsp[0].string) );
if( r != ERROR_SUCCESS )
YYABORT;
;}
break;
case 48:
#line 462 "sql.y"
{
(yyval.expr) = (yyvsp[-1].expr);
if( !(yyval.expr) )
YYABORT;
;}
break;
case 49:
#line 468 "sql.y"
{
(yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_AND, (yyvsp[0].expr) );
if( !(yyval.expr) )
YYABORT;
;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -