preproc.c
上传用户:blenddy
上传日期:2007-01-07
资源大小:6495k
文件大小:764k
- case 963:
- #line 4375 "preproc.y"
- { yyval.str = make1_str("cache"); ;
- break;}
- case 964:
- #line 4376 "preproc.y"
- { yyval.str = make1_str("committed"); ;
- break;}
- case 965:
- #line 4377 "preproc.y"
- { yyval.str = make1_str("createdb"); ;
- break;}
- case 966:
- #line 4378 "preproc.y"
- { yyval.str = make1_str("createuser"); ;
- break;}
- case 967:
- #line 4379 "preproc.y"
- { yyval.str = make1_str("cycle"); ;
- break;}
- case 968:
- #line 4380 "preproc.y"
- { yyval.str = make1_str("database"); ;
- break;}
- case 969:
- #line 4381 "preproc.y"
- { yyval.str = make1_str("delimiters"); ;
- break;}
- case 970:
- #line 4382 "preproc.y"
- { yyval.str = make1_str("double"); ;
- break;}
- case 971:
- #line 4383 "preproc.y"
- { yyval.str = make1_str("each"); ;
- break;}
- case 972:
- #line 4384 "preproc.y"
- { yyval.str = make1_str("encoding"); ;
- break;}
- case 973:
- #line 4385 "preproc.y"
- { yyval.str = make1_str("exclusive"); ;
- break;}
- case 974:
- #line 4386 "preproc.y"
- { yyval.str = make1_str("forward"); ;
- break;}
- case 975:
- #line 4387 "preproc.y"
- { yyval.str = make1_str("function"); ;
- break;}
- case 976:
- #line 4388 "preproc.y"
- { yyval.str = make1_str("handler"); ;
- break;}
- case 977:
- #line 4389 "preproc.y"
- { yyval.str = make1_str("increment"); ;
- break;}
- case 978:
- #line 4390 "preproc.y"
- { yyval.str = make1_str("index"); ;
- break;}
- case 979:
- #line 4391 "preproc.y"
- { yyval.str = make1_str("inherits"); ;
- break;}
- case 980:
- #line 4392 "preproc.y"
- { yyval.str = make1_str("insensitive"); ;
- break;}
- case 981:
- #line 4393 "preproc.y"
- { yyval.str = make1_str("instead"); ;
- break;}
- case 982:
- #line 4394 "preproc.y"
- { yyval.str = make1_str("isnull"); ;
- break;}
- case 983:
- #line 4395 "preproc.y"
- { yyval.str = make1_str("key"); ;
- break;}
- case 984:
- #line 4396 "preproc.y"
- { yyval.str = make1_str("language"); ;
- break;}
- case 985:
- #line 4397 "preproc.y"
- { yyval.str = make1_str("lancompiler"); ;
- break;}
- case 986:
- #line 4398 "preproc.y"
- { yyval.str = make1_str("location"); ;
- break;}
- case 987:
- #line 4399 "preproc.y"
- { yyval.str = make1_str("match"); ;
- break;}
- case 988:
- #line 4400 "preproc.y"
- { yyval.str = make1_str("maxvalue"); ;
- break;}
- case 989:
- #line 4401 "preproc.y"
- { yyval.str = make1_str("minvalue"); ;
- break;}
- case 990:
- #line 4402 "preproc.y"
- { yyval.str = make1_str("mode"); ;
- break;}
- case 991:
- #line 4403 "preproc.y"
- { yyval.str = make1_str("next"); ;
- break;}
- case 992:
- #line 4404 "preproc.y"
- { yyval.str = make1_str("nocreatedb"); ;
- break;}
- case 993:
- #line 4405 "preproc.y"
- { yyval.str = make1_str("nocreateuser"); ;
- break;}
- case 994:
- #line 4406 "preproc.y"
- { yyval.str = make1_str("nothing"); ;
- break;}
- case 995:
- #line 4407 "preproc.y"
- { yyval.str = make1_str("notnull"); ;
- break;}
- case 996:
- #line 4408 "preproc.y"
- { yyval.str = make1_str("of"); ;
- break;}
- case 997:
- #line 4409 "preproc.y"
- { yyval.str = make1_str("oids"); ;
- break;}
- case 998:
- #line 4410 "preproc.y"
- { yyval.str = make1_str("only"); ;
- break;}
- case 999:
- #line 4411 "preproc.y"
- { yyval.str = make1_str("operator"); ;
- break;}
- case 1000:
- #line 4412 "preproc.y"
- { yyval.str = make1_str("option"); ;
- break;}
- case 1001:
- #line 4413 "preproc.y"
- { yyval.str = make1_str("password"); ;
- break;}
- case 1002:
- #line 4414 "preproc.y"
- { yyval.str = make1_str("prior"); ;
- break;}
- case 1003:
- #line 4415 "preproc.y"
- { yyval.str = make1_str("privileges"); ;
- break;}
- case 1004:
- #line 4416 "preproc.y"
- { yyval.str = make1_str("procedural"); ;
- break;}
- case 1005:
- #line 4417 "preproc.y"
- { yyval.str = make1_str("read"); ;
- break;}
- case 1006:
- #line 4419 "preproc.y"
- { yyval.str = make1_str("relative"); ;
- break;}
- case 1007:
- #line 4420 "preproc.y"
- { yyval.str = make1_str("rename"); ;
- break;}
- case 1008:
- #line 4421 "preproc.y"
- { yyval.str = make1_str("returns"); ;
- break;}
- case 1009:
- #line 4422 "preproc.y"
- { yyval.str = make1_str("row"); ;
- break;}
- case 1010:
- #line 4423 "preproc.y"
- { yyval.str = make1_str("rule"); ;
- break;}
- case 1011:
- #line 4424 "preproc.y"
- { yyval.str = make1_str("scroll"); ;
- break;}
- case 1012:
- #line 4425 "preproc.y"
- { yyval.str = make1_str("sequence"); ;
- break;}
- case 1013:
- #line 4426 "preproc.y"
- { yyval.str = make1_str("serial"); ;
- break;}
- case 1014:
- #line 4427 "preproc.y"
- { yyval.str = make1_str("serializable"); ;
- break;}
- case 1015:
- #line 4428 "preproc.y"
- { yyval.str = make1_str("share"); ;
- break;}
- case 1016:
- #line 4429 "preproc.y"
- { yyval.str = make1_str("start"); ;
- break;}
- case 1017:
- #line 4430 "preproc.y"
- { yyval.str = make1_str("statement"); ;
- break;}
- case 1018:
- #line 4431 "preproc.y"
- { yyval.str = make1_str("stdin"); ;
- break;}
- case 1019:
- #line 4432 "preproc.y"
- { yyval.str = make1_str("stdout"); ;
- break;}
- case 1020:
- #line 4433 "preproc.y"
- { yyval.str = make1_str("time"); ;
- break;}
- case 1021:
- #line 4434 "preproc.y"
- { yyval.str = make1_str("timestamp"); ;
- break;}
- case 1022:
- #line 4435 "preproc.y"
- { yyval.str = make1_str("timezone_hour"); ;
- break;}
- case 1023:
- #line 4436 "preproc.y"
- { yyval.str = make1_str("timezone_minute"); ;
- break;}
- case 1024:
- #line 4437 "preproc.y"
- { yyval.str = make1_str("trigger"); ;
- break;}
- case 1025:
- #line 4438 "preproc.y"
- { yyval.str = make1_str("trusted"); ;
- break;}
- case 1026:
- #line 4439 "preproc.y"
- { yyval.str = make1_str("type"); ;
- break;}
- case 1027:
- #line 4440 "preproc.y"
- { yyval.str = make1_str("valid"); ;
- break;}
- case 1028:
- #line 4441 "preproc.y"
- { yyval.str = make1_str("version"); ;
- break;}
- case 1029:
- #line 4442 "preproc.y"
- { yyval.str = make1_str("zone"); ;
- break;}
- case 1030:
- #line 4443 "preproc.y"
- { yyval.str = make1_str("at"); ;
- break;}
- case 1031:
- #line 4444 "preproc.y"
- { yyval.str = make1_str("bool"); ;
- break;}
- case 1032:
- #line 4445 "preproc.y"
- { yyval.str = make1_str("break"); ;
- break;}
- case 1033:
- #line 4446 "preproc.y"
- { yyval.str = make1_str("call"); ;
- break;}
- case 1034:
- #line 4447 "preproc.y"
- { yyval.str = make1_str("connect"); ;
- break;}
- case 1035:
- #line 4448 "preproc.y"
- { yyval.str = make1_str("continue"); ;
- break;}
- case 1036:
- #line 4449 "preproc.y"
- { yyval.str = make1_str("deallocate"); ;
- break;}
- case 1037:
- #line 4450 "preproc.y"
- { yyval.str = make1_str("disconnect"); ;
- break;}
- case 1038:
- #line 4451 "preproc.y"
- { yyval.str = make1_str("found"); ;
- break;}
- case 1039:
- #line 4452 "preproc.y"
- { yyval.str = make1_str("go"); ;
- break;}
- case 1040:
- #line 4453 "preproc.y"
- { yyval.str = make1_str("goto"); ;
- break;}
- case 1041:
- #line 4454 "preproc.y"
- { yyval.str = make1_str("identified"); ;
- break;}
- case 1042:
- #line 4455 "preproc.y"
- { yyval.str = make1_str("immediate"); ;
- break;}
- case 1043:
- #line 4456 "preproc.y"
- { yyval.str = make1_str("indicator"); ;
- break;}
- case 1044:
- #line 4457 "preproc.y"
- { yyval.str = make1_str("int"); ;
- break;}
- case 1045:
- #line 4458 "preproc.y"
- { yyval.str = make1_str("long"); ;
- break;}
- case 1046:
- #line 4459 "preproc.y"
- { yyval.str = make1_str("off"); ;
- break;}
- case 1047:
- #line 4460 "preproc.y"
- { yyval.str = make1_str("open"); ;
- break;}
- case 1048:
- #line 4461 "preproc.y"
- { yyval.str = make1_str("prepare"); ;
- break;}
- case 1049:
- #line 4462 "preproc.y"
- { yyval.str = make1_str("release"); ;
- break;}
- case 1050:
- #line 4463 "preproc.y"
- { yyval.str = make1_str("section"); ;
- break;}
- case 1051:
- #line 4464 "preproc.y"
- { yyval.str = make1_str("short"); ;
- break;}
- case 1052:
- #line 4465 "preproc.y"
- { yyval.str = make1_str("signed"); ;
- break;}
- case 1053:
- #line 4466 "preproc.y"
- { yyval.str = make1_str("sqlerror"); ;
- break;}
- case 1054:
- #line 4467 "preproc.y"
- { yyval.str = make1_str("sqlprint"); ;
- break;}
- case 1055:
- #line 4468 "preproc.y"
- { yyval.str = make1_str("sqlwarning"); ;
- break;}
- case 1056:
- #line 4469 "preproc.y"
- { yyval.str = make1_str("stop"); ;
- break;}
- case 1057:
- #line 4470 "preproc.y"
- { yyval.str = make1_str("struct"); ;
- break;}
- case 1058:
- #line 4471 "preproc.y"
- { yyval.str = make1_str("unsigned"); ;
- break;}
- case 1059:
- #line 4472 "preproc.y"
- { yyval.str = make1_str("var"); ;
- break;}
- case 1060:
- #line 4473 "preproc.y"
- { yyval.str = make1_str("whenever"); ;
- break;}
- case 1061:
- #line 4485 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1062:
- #line 4486 "preproc.y"
- { yyval.str = make1_str("abort"); ;
- break;}
- case 1063:
- #line 4487 "preproc.y"
- { yyval.str = make1_str("analyze"); ;
- break;}
- case 1064:
- #line 4488 "preproc.y"
- { yyval.str = make1_str("binary"); ;
- break;}
- case 1065:
- #line 4489 "preproc.y"
- { yyval.str = make1_str("case"); ;
- break;}
- case 1066:
- #line 4490 "preproc.y"
- { yyval.str = make1_str("cluster"); ;
- break;}
- case 1067:
- #line 4491 "preproc.y"
- { yyval.str = make1_str("coalesce"); ;
- break;}
- case 1068:
- #line 4492 "preproc.y"
- { yyval.str = make1_str("constraint"); ;
- break;}
- case 1069:
- #line 4493 "preproc.y"
- { yyval.str = make1_str("copy"); ;
- break;}
- case 1070:
- #line 4494 "preproc.y"
- { yyval.str = make1_str("current"); ;
- break;}
- case 1071:
- #line 4495 "preproc.y"
- { yyval.str = make1_str("do"); ;
- break;}
- case 1072:
- #line 4496 "preproc.y"
- { yyval.str = make1_str("else"); ;
- break;}
- case 1073:
- #line 4497 "preproc.y"
- { yyval.str = make1_str("end"); ;
- break;}
- case 1074:
- #line 4498 "preproc.y"
- { yyval.str = make1_str("explain"); ;
- break;}
- case 1075:
- #line 4499 "preproc.y"
- { yyval.str = make1_str("extend"); ;
- break;}
- case 1076:
- #line 4500 "preproc.y"
- { yyval.str = make1_str("false"); ;
- break;}
- case 1077:
- #line 4501 "preproc.y"
- { yyval.str = make1_str("foreign"); ;
- break;}
- case 1078:
- #line 4502 "preproc.y"
- { yyval.str = make1_str("group"); ;
- break;}
- case 1079:
- #line 4503 "preproc.y"
- { yyval.str = make1_str("listen"); ;
- break;}
- case 1080:
- #line 4504 "preproc.y"
- { yyval.str = make1_str("load"); ;
- break;}
- case 1081:
- #line 4505 "preproc.y"
- { yyval.str = make1_str("lock"); ;
- break;}
- case 1082:
- #line 4506 "preproc.y"
- { yyval.str = make1_str("move"); ;
- break;}
- case 1083:
- #line 4507 "preproc.y"
- { yyval.str = make1_str("new"); ;
- break;}
- case 1084:
- #line 4508 "preproc.y"
- { yyval.str = make1_str("none"); ;
- break;}
- case 1085:
- #line 4509 "preproc.y"
- { yyval.str = make1_str("nullif"); ;
- break;}
- case 1086:
- #line 4510 "preproc.y"
- { yyval.str = make1_str("order"); ;
- break;}
- case 1087:
- #line 4511 "preproc.y"
- { yyval.str = make1_str("position"); ;
- break;}
- case 1088:
- #line 4512 "preproc.y"
- { yyval.str = make1_str("precision"); ;
- break;}
- case 1089:
- #line 4513 "preproc.y"
- { yyval.str = make1_str("reset"); ;
- break;}
- case 1090:
- #line 4514 "preproc.y"
- { yyval.str = make1_str("setof"); ;
- break;}
- case 1091:
- #line 4515 "preproc.y"
- { yyval.str = make1_str("show"); ;
- break;}
- case 1092:
- #line 4516 "preproc.y"
- { yyval.str = make1_str("table"); ;
- break;}
- case 1093:
- #line 4517 "preproc.y"
- { yyval.str = make1_str("then"); ;
- break;}
- case 1094:
- #line 4518 "preproc.y"
- { yyval.str = make1_str("transaction"); ;
- break;}
- case 1095:
- #line 4519 "preproc.y"
- { yyval.str = make1_str("true"); ;
- break;}
- case 1096:
- #line 4520 "preproc.y"
- { yyval.str = make1_str("vacuum"); ;
- break;}
- case 1097:
- #line 4521 "preproc.y"
- { yyval.str = make1_str("verbose"); ;
- break;}
- case 1098:
- #line 4522 "preproc.y"
- { yyval.str = make1_str("when"); ;
- break;}
- case 1099:
- #line 4526 "preproc.y"
- {
- if (QueryIsRule)
- yyval.str = make1_str("current");
- else
- yyerror("CURRENT used in non-rule query");
- ;
- break;}
- case 1100:
- #line 4533 "preproc.y"
- {
- if (QueryIsRule)
- yyval.str = make1_str("new");
- else
- yyerror("NEW used in non-rule query");
- ;
- break;}
- case 1101:
- #line 4549 "preproc.y"
- {
- yyval.str = make5_str(yyvsp[-2].str, make1_str(","), yyvsp[0].str, make1_str(","), yyvsp[-1].str);
- ;
- break;}
- case 1102:
- #line 4553 "preproc.y"
- {
- yyval.str = make1_str("NULL,NULL,NULL,"DEFAULT"");
- ;
- break;}
- case 1103:
- #line 4558 "preproc.y"
- {
- yyval.str = make3_str(make1_str("NULL,"), yyvsp[0].str, make1_str(",NULL"));
- ;
- break;}
- case 1104:
- #line 4563 "preproc.y"
- {
- /* old style: dbname[@server][:port] */
- if (strlen(yyvsp[-1].str) > 0 && *(yyvsp[-1].str) != '@')
- {
- sprintf(errortext, "parse error at or near '%s'", yyvsp[-1].str);
- yyerror(errortext);
- }
- yyval.str = make5_str(make1_str("""), yyvsp[-2].str, yyvsp[-1].str, yyvsp[0].str, make1_str("""));
- ;
- break;}
- case 1105:
- #line 4574 "preproc.y"
- {
- /* new style: <tcp|unix>:postgresql://server[:port][/dbname] */
- if (strncmp(yyvsp[-4].str, "://", 3) != 0)
- {
- sprintf(errortext, "parse error at or near '%s'", yyvsp[-4].str);
- yyerror(errortext);
- }
- if (strncmp(yyvsp[-5].str, "unix", 4) == 0 && strncmp(yyvsp[-4].str + 3, "localhost", 9) != 0)
- {
- sprintf(errortext, "unix domain sockets only work on 'localhost' but not on '%9.9s'", yyvsp[-4].str);
- yyerror(errortext);
- }
- if (strncmp(yyvsp[-5].str, "unix", 4) != 0 && strncmp(yyvsp[-5].str, "tcp", 3) != 0)
- {
- sprintf(errortext, "only protocols 'tcp' and 'unix' are supported");
- yyerror(errortext);
- }
-
- yyval.str = make4_str(make5_str(make1_str("""), yyvsp[-5].str, yyvsp[-4].str, yyvsp[-3].str, make1_str("/")), yyvsp[-1].str, yyvsp[0].str, make1_str("""));
- ;
- break;}
- case 1106:
- #line 4597 "preproc.y"
- {
- yyval.str = yyvsp[0].str;
- ;
- break;}
- case 1107:
- #line 4601 "preproc.y"
- {
- yyval.str = mm_strdup(yyvsp[0].str);
- yyval.str[0] = '"';
- yyval.str[strlen(yyval.str) - 1] = '"';
- free(yyvsp[0].str);
- ;
- break;}
- case 1108:
- #line 4609 "preproc.y"
- {
- if (strcmp(yyvsp[0].str, "postgresql") != 0 && strcmp(yyvsp[0].str, "postgres") != 0)
- {
- sprintf(errortext, "parse error at or near '%s'", yyvsp[0].str);
- yyerror(errortext);
- }
- if (strcmp(yyvsp[-1].str, "tcp") != 0 && strcmp(yyvsp[-1].str, "unix") != 0)
- {
- sprintf(errortext, "Illegal connection type %s", yyvsp[-1].str);
- yyerror(errortext);
- }
- yyval.str = make3_str(yyvsp[-1].str, make1_str(":"), yyvsp[0].str);
- ;
- break;}
- case 1109:
- #line 4626 "preproc.y"
- {
- if (strcmp(yyvsp[-1].str, "@") != 0 && strcmp(yyvsp[-1].str, "://") != 0)
- {
- sprintf(errortext, "parse error at or near '%s'", yyvsp[-1].str);
- yyerror(errortext);
- }
- yyval.str = make2_str(yyvsp[-1].str, yyvsp[0].str);
- ;
- break;}
- case 1110:
- #line 4636 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1111:
- #line 4637 "preproc.y"
- { yyval.str = make1_str(""); ;
- break;}
- case 1112:
- #line 4639 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1113:
- #line 4640 "preproc.y"
- { yyval.str = make3_str(yyvsp[-2].str, make1_str("."), yyvsp[0].str); ;
- break;}
- case 1114:
- #line 4642 "preproc.y"
- { yyval.str = make2_str(make1_str(":"), yyvsp[0].str); ;
- break;}
- case 1115:
- #line 4643 "preproc.y"
- { yyval.str = make1_str(""); ;
- break;}
- case 1116:
- #line 4645 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1117:
- #line 4646 "preproc.y"
- { yyval.str = make1_str("NULL"); ;
- break;}
- case 1118:
- #line 4648 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1119:
- #line 4649 "preproc.y"
- { yyval.str = make1_str("NULL,NULL"); ;
- break;}
- case 1120:
- #line 4652 "preproc.y"
- {
- yyval.str = make2_str(yyvsp[0].str, make1_str(",NULL"));
- ;
- break;}
- case 1121:
- #line 4656 "preproc.y"
- {
- yyval.str = make3_str(yyvsp[-2].str, make1_str(","), yyvsp[0].str);
- ;
- break;}
- case 1122:
- #line 4660 "preproc.y"
- {
- yyval.str = make3_str(yyvsp[-3].str, make1_str(","), yyvsp[0].str);
- ;
- break;}
- case 1123:
- #line 4664 "preproc.y"
- {
- yyval.str = make3_str(yyvsp[-2].str, make1_str(","), yyvsp[0].str);
- ;
- break;}
- case 1124:
- #line 4668 "preproc.y"
- { if (yyvsp[0].str[0] == '"')
- yyval.str = yyvsp[0].str;
- else
- yyval.str = make3_str(make1_str("""), yyvsp[0].str, make1_str("""));
- ;
- break;}
- case 1125:
- #line 4673 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1126:
- #line 4674 "preproc.y"
- { yyval.str = make3_str(make1_str("""), yyvsp[0].str, make1_str(""")); ;
- break;}
- case 1127:
- #line 4677 "preproc.y"
- { /* check if we have a char variable */
- struct variable *p = find_variable(yyvsp[0].str);
- enum ECPGttype typ = p->type->typ;
- /* if array see what's inside */
- if (typ == ECPGt_array)
- typ = p->type->u.element->typ;
- switch (typ)
- {
- case ECPGt_char:
- case ECPGt_unsigned_char:
- yyval.str = yyvsp[0].str;
- break;
- case ECPGt_varchar:
- yyval.str = make2_str(yyvsp[0].str, make1_str(".arr"));
- break;
- default:
- yyerror("invalid datatype");
- break;
- }
- ;
- break;}
- case 1128:
- #line 4701 "preproc.y"
- {
- if (strlen(yyvsp[-1].str) == 0)
- yyerror("parse error");
-
- if (strcmp(yyvsp[-1].str, "?") != 0)
- {
- sprintf(errortext, "parse error at or near %s", yyvsp[-1].str);
- yyerror(errortext);
- }
-
- yyval.str = make2_str(make1_str("?"), yyvsp[0].str);
- ;
- break;}
- case 1129:
- #line 4713 "preproc.y"
- { yyval.str = make1_str(""); ;
- break;}
- case 1130:
- #line 4720 "preproc.y"
- {
- struct cursor *ptr, *this;
- struct variable *thisquery = (struct variable *)mm_alloc(sizeof(struct variable));
- for (ptr = cur; ptr != NULL; ptr = ptr->next)
- {
- if (strcmp(yyvsp[-4].str, ptr->name) == 0)
- {
- /* re-definition is a bug */
- sprintf(errortext, "cursor %s already defined", yyvsp[-4].str);
- yyerror(errortext);
- }
- }
- this = (struct cursor *) mm_alloc(sizeof(struct cursor));
- /* initial definition */
- this->next = cur;
- this->name = yyvsp[-4].str;
- this->connection = connection;
- this->command = cat4_str(make1_str("declare"), mm_strdup(yyvsp[-4].str), yyvsp[-3].str, make1_str("cursor for ?"));
- this->argsresult = NULL;
- thisquery->type = &ecpg_query;
- thisquery->brace_level = 0;
- thisquery->next = NULL;
- thisquery->name = (char *) mm_alloc(sizeof("ECPGprepared_statement("")") + strlen(yyvsp[0].str));
- sprintf(thisquery->name, "ECPGprepared_statement("%s")", yyvsp[0].str);
- this->argsinsert = NULL;
- add_variable(&(this->argsinsert), thisquery, &no_indicator);
- cur = this;
-
- yyval.str = cat3_str(make1_str("/*"), mm_strdup(this->command), make1_str("*/"));
- ;
- break;}
- case 1131:
- #line 4762 "preproc.y"
- { yyval.str = make3_str(make1_str("ECPGdeallocate(__LINE__, ""), yyvsp[0].str, make1_str("");")); ;
- break;}
- case 1132:
- #line 4768 "preproc.y"
- {
- fputs("/* exec sql begin declare section */", yyout);
- output_line_number();
- ;
- break;}
- case 1133:
- #line 4773 "preproc.y"
- {
- fprintf(yyout, "%s/* exec sql end declare section */", yyvsp[-1].str);
- free(yyvsp[-1].str);
- output_line_number();
- ;
- break;}
- case 1134:
- #line 4779 "preproc.y"
- {;
- break;}
- case 1135:
- #line 4781 "preproc.y"
- {;
- break;}
- case 1136:
- #line 4784 "preproc.y"
- {
- yyval.str = make1_str("");
- ;
- break;}
- case 1137:
- #line 4788 "preproc.y"
- {
- yyval.str = cat2_str(yyvsp[-1].str, yyvsp[0].str);
- ;
- break;}
- case 1138:
- #line 4793 "preproc.y"
- {
- actual_storage[struct_level] = mm_strdup(yyvsp[0].str);
- ;
- break;}
- case 1139:
- #line 4797 "preproc.y"
- {
- actual_type[struct_level].type_enum = yyvsp[0].type.type_enum;
- actual_type[struct_level].type_dimension = yyvsp[0].type.type_dimension;
- actual_type[struct_level].type_index = yyvsp[0].type.type_index;
- ;
- break;}
- case 1140:
- #line 4803 "preproc.y"
- {
- yyval.str = cat4_str(yyvsp[-5].str, yyvsp[-3].type.type_str, yyvsp[-1].str, make1_str(";n"));
- ;
- break;}
- case 1141:
- #line 4807 "preproc.y"
- { yyval.str = make1_str("extern"); ;
- break;}
- case 1142:
- #line 4808 "preproc.y"
- { yyval.str = make1_str("static"); ;
- break;}
- case 1143:
- #line 4809 "preproc.y"
- { yyval.str = make1_str("signed"); ;
- break;}
- case 1144:
- #line 4810 "preproc.y"
- { yyval.str = make1_str("const"); ;
- break;}
- case 1145:
- #line 4811 "preproc.y"
- { yyval.str = make1_str("register"); ;
- break;}
- case 1146:
- #line 4812 "preproc.y"
- { yyval.str = make1_str("auto"); ;
- break;}
- case 1147:
- #line 4813 "preproc.y"
- { yyval.str = make1_str(""); ;
- break;}
- case 1148:
- #line 4816 "preproc.y"
- {
- yyval.type.type_enum = yyvsp[0].type_enum;
- yyval.type.type_str = mm_strdup(ECPGtype_name(yyvsp[0].type_enum));
- yyval.type.type_dimension = -1;
- yyval.type.type_index = -1;
- ;
- break;}
- case 1149:
- #line 4823 "preproc.y"
- {
- yyval.type.type_enum = ECPGt_varchar;
- yyval.type.type_str = make1_str("");
- yyval.type.type_dimension = -1;
- yyval.type.type_index = -1;
- ;
- break;}
- case 1150:
- #line 4830 "preproc.y"
- {
- yyval.type.type_enum = ECPGt_struct;
- yyval.type.type_str = yyvsp[0].str;
- yyval.type.type_dimension = -1;
- yyval.type.type_index = -1;
- ;
- break;}
- case 1151:
- #line 4837 "preproc.y"
- {
- yyval.type.type_enum = ECPGt_union;
- yyval.type.type_str = yyvsp[0].str;
- yyval.type.type_dimension = -1;
- yyval.type.type_index = -1;
- ;
- break;}
- case 1152:
- #line 4844 "preproc.y"
- {
- yyval.type.type_str = yyvsp[0].str;
- yyval.type.type_enum = ECPGt_int;
-
- yyval.type.type_dimension = -1;
- yyval.type.type_index = -1;
- ;
- break;}
- case 1153:
- #line 4852 "preproc.y"
- {
- /* this is for typedef'ed types */
- struct typedefs *this = get_typedef(yyvsp[0].str);
- yyval.type.type_str = (this->type->type_enum == ECPGt_varchar) ? make1_str("") : mm_strdup(this->name);
- yyval.type.type_enum = this->type->type_enum;
- yyval.type.type_dimension = this->type->type_dimension;
- yyval.type.type_index = this->type->type_index;
- struct_member_list[struct_level] = ECPGstruct_member_dup(this->struct_member_list);
- ;
- break;}
- case 1154:
- #line 4864 "preproc.y"
- {
- yyval.str = cat4_str(yyvsp[-3].str, make1_str("{"), yyvsp[-1].str, make1_str("}"));
- ;
- break;}
- case 1155:
- #line 4868 "preproc.y"
- { yyval.str = cat2_str(make1_str("enum"), yyvsp[0].str); ;
- break;}
- case 1156:
- #line 4871 "preproc.y"
- {
- ECPGfree_struct_member(struct_member_list[struct_level]);
- free(actual_storage[struct_level--]);
- yyval.str = cat4_str(yyvsp[-3].str, make1_str("{"), yyvsp[-1].str, make1_str("}"));
- ;
- break;}
- case 1157:
- #line 4878 "preproc.y"
- {
- ECPGfree_struct_member(struct_member_list[struct_level]);
- free(actual_storage[struct_level--]);
- yyval.str = cat4_str(yyvsp[-3].str, make1_str("{"), yyvsp[-1].str, make1_str("}"));
- ;
- break;}
- case 1158:
- #line 4885 "preproc.y"
- {
- struct_member_list[struct_level++] = NULL;
- if (struct_level >= STRUCT_DEPTH)
- yyerror("Too many levels in nested structure definition");
- yyval.str = cat2_str(make1_str("struct"), yyvsp[0].str);
- ;
- break;}
- case 1159:
- #line 4893 "preproc.y"
- {
- struct_member_list[struct_level++] = NULL;
- if (struct_level >= STRUCT_DEPTH)
- yyerror("Too many levels in nested structure definition");
- yyval.str = cat2_str(make1_str("union"), yyvsp[0].str);
- ;
- break;}
- case 1160:
- #line 4900 "preproc.y"
- { yyval.str = make1_str(""); ;
- break;}
- case 1161:
- #line 4901 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1162:
- #line 4903 "preproc.y"
- { yyval.type_enum = ECPGt_short; ;
- break;}
- case 1163:
- #line 4904 "preproc.y"
- { yyval.type_enum = ECPGt_unsigned_short; ;
- break;}
- case 1164:
- #line 4905 "preproc.y"
- { yyval.type_enum = ECPGt_int; ;
- break;}
- case 1165:
- #line 4906 "preproc.y"
- { yyval.type_enum = ECPGt_unsigned_int; ;
- break;}
- case 1166:
- #line 4907 "preproc.y"
- { yyval.type_enum = ECPGt_long; ;
- break;}
- case 1167:
- #line 4908 "preproc.y"
- { yyval.type_enum = ECPGt_unsigned_long; ;
- break;}
- case 1168:
- #line 4909 "preproc.y"
- { yyval.type_enum = ECPGt_float; ;
- break;}
- case 1169:
- #line 4910 "preproc.y"
- { yyval.type_enum = ECPGt_double; ;
- break;}
- case 1170:
- #line 4911 "preproc.y"
- { yyval.type_enum = ECPGt_bool; ;
- break;}
- case 1171:
- #line 4912 "preproc.y"
- { yyval.type_enum = ECPGt_char; ;
- break;}
- case 1172:
- #line 4913 "preproc.y"
- { yyval.type_enum = ECPGt_unsigned_char; ;
- break;}
- case 1173:
- #line 4915 "preproc.y"
- { yyval.type_enum = ECPGt_varchar; ;
- break;}
- case 1174:
- #line 4918 "preproc.y"
- {
- yyval.str = yyvsp[0].str;
- ;
- break;}
- case 1175:
- #line 4922 "preproc.y"
- {
- yyval.str = cat3_str(yyvsp[-2].str, make1_str(","), yyvsp[0].str);
- ;
- break;}
- case 1176:
- #line 4927 "preproc.y"
- {
- struct ECPGtype * type;
- int dimension = yyvsp[-1].index.index1; /* dimension of array */
- int length = yyvsp[-1].index.index2; /* lenght of string */
- char dim[14L], ascii_len[12];
- adjust_array(actual_type[struct_level].type_enum, &dimension, &length, actual_type[struct_level].type_dimension, actual_type[struct_level].type_index, strlen(yyvsp[-3].str));
- switch (actual_type[struct_level].type_enum)
- {
- case ECPGt_struct:
- case ECPGt_union:
- if (dimension < 0)
- type = ECPGmake_struct_type(struct_member_list[struct_level], actual_type[struct_level].type_enum);
- else
- type = ECPGmake_array_type(ECPGmake_struct_type(struct_member_list[struct_level], actual_type[struct_level].type_enum), dimension);
- yyval.str = make4_str(yyvsp[-3].str, mm_strdup(yyvsp[-2].str), yyvsp[-1].index.str, yyvsp[0].str);
- break;
- case ECPGt_varchar:
- if (dimension == -1)
- type = ECPGmake_simple_type(actual_type[struct_level].type_enum, length);
- else
- type = ECPGmake_array_type(ECPGmake_simple_type(actual_type[struct_level].type_enum, length), dimension);
- switch(dimension)
- {
- case 0:
- case -1:
- case 1:
- *dim = ' ';
- break;
- default:
- sprintf(dim, "[%d]", dimension);
- break;
- }
- sprintf(ascii_len, "%d", length);
- if (length == 0)
- yyerror ("pointer to varchar are not implemented");
- if (dimension == 0)
- yyval.str = make4_str(make5_str(mm_strdup(actual_storage[struct_level]), make1_str(" struct varchar_"), mm_strdup(yyvsp[-2].str), make1_str(" { int len; char arr["), mm_strdup(ascii_len)), make1_str("]; } *"), mm_strdup(yyvsp[-2].str), yyvsp[0].str);
- else
- yyval.str = make5_str(make5_str(mm_strdup(actual_storage[struct_level]), make1_str(" struct varchar_"), mm_strdup(yyvsp[-2].str), make1_str(" { int len; char arr["), mm_strdup(ascii_len)), make1_str("]; } "), mm_strdup(yyvsp[-2].str), mm_strdup(dim), yyvsp[0].str);
- break;
- case ECPGt_char:
- case ECPGt_unsigned_char:
- if (dimension == -1)
- type = ECPGmake_simple_type(actual_type[struct_level].type_enum, length);
- else
- type = ECPGmake_array_type(ECPGmake_simple_type(actual_type[struct_level].type_enum, length), dimension);
- yyval.str = make4_str(yyvsp[-3].str, mm_strdup(yyvsp[-2].str), yyvsp[-1].index.str, yyvsp[0].str);
- break;
- default:
- if (dimension < 0)
- type = ECPGmake_simple_type(actual_type[struct_level].type_enum, 1);
- else
- type = ECPGmake_array_type(ECPGmake_simple_type(actual_type[struct_level].type_enum, 1), dimension);
- yyval.str = make4_str(yyvsp[-3].str, mm_strdup(yyvsp[-2].str), yyvsp[-1].index.str, yyvsp[0].str);
- break;
- }
- if (struct_level == 0)
- new_variable(yyvsp[-2].str, type);
- else
- ECPGmake_struct_member(yyvsp[-2].str, type, &(struct_member_list[struct_level - 1]));
- free(yyvsp[-2].str);
- ;
- break;}
- case 1177:
- #line 5001 "preproc.y"
- { yyval.str = make1_str(""); ;
- break;}
- case 1178:
- #line 5002 "preproc.y"
- { yyval.str = make2_str(make1_str("="), yyvsp[0].str); ;
- break;}
- case 1179:
- #line 5004 "preproc.y"
- { yyval.str = make1_str(""); ;
- break;}
- case 1180:
- #line 5005 "preproc.y"
- { yyval.str = make1_str("*"); ;
- break;}
- case 1181:
- #line 5012 "preproc.y"
- {
- /* this is only supported for compatibility */
- yyval.str = cat3_str(make1_str("/* declare statement"), yyvsp[0].str, make1_str("*/"));
- ;
- break;}
- case 1182:
- #line 5019 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1183:
- #line 5021 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1184:
- #line 5022 "preproc.y"
- { yyval.str = make1_str("CURRENT"); ;
- break;}
- case 1185:
- #line 5023 "preproc.y"
- { yyval.str = make1_str("ALL"); ;
- break;}
- case 1186:
- #line 5024 "preproc.y"
- { yyval.str = make1_str("CURRENT"); ;
- break;}
- case 1187:
- #line 5026 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1188:
- #line 5027 "preproc.y"
- { yyval.str = make1_str("DEFAULT"); ;
- break;}
- case 1189:
- #line 5033 "preproc.y"
- {
- struct variable *thisquery = (struct variable *)mm_alloc(sizeof(struct variable));
- thisquery->type = &ecpg_query;
- thisquery->brace_level = 0;
- thisquery->next = NULL;
- thisquery->name = yyvsp[0].str;
- add_variable(&argsinsert, thisquery, &no_indicator);
- yyval.str = make1_str("?");
- ;
- break;}
- case 1190:
- #line 5046 "preproc.y"
- {
- struct variable *thisquery = (struct variable *)mm_alloc(sizeof(struct variable));
- thisquery->type = &ecpg_query;
- thisquery->brace_level = 0;
- thisquery->next = NULL;
- thisquery->name = (char *) mm_alloc(sizeof("ECPGprepared_statement("")") + strlen(yyvsp[0].str));
- sprintf(thisquery->name, "ECPGprepared_statement("%s")", yyvsp[0].str);
- add_variable(&argsinsert, thisquery, &no_indicator);
- ;
- break;}
- case 1191:
- #line 5057 "preproc.y"
- {
- yyval.str = make1_str("?");
- ;
- break;}
- case 1193:
- #line 5062 "preproc.y"
- { yyval.str = make3_str(make1_str("""), yyvsp[0].str, make1_str(""")); ;
- break;}
- case 1194:
- #line 5068 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1195:
- #line 5073 "preproc.y"
- {
- yyval.str = yyvsp[-1].str;
- ;
- break;}
- case 1196:
- #line 5077 "preproc.y"
- { yyval.str = make1_str(""); ;
- break;}
- case 1197:
- #line 5078 "preproc.y"
- {
- /* yyerror ("open cursor with variables not implemented yet"); */
- yyval.str = make1_str("");
- ;
- break;}
- case 1200:
- #line 5090 "preproc.y"
- {
- yyval.str = make4_str(make1_str("""), yyvsp[-2].str, make1_str("", "), yyvsp[0].str);
- ;
- break;}
- case 1201:
- #line 5100 "preproc.y"
- {
- if (strncmp(yyvsp[-1].str, "begin", 5) == 0)
- yyerror("RELEASE does not make sense when beginning a transaction");
- fprintf(yyout, "ECPGtrans(__LINE__, %s, "%s");", connection, yyvsp[-1].str);
- whenever_action(0);
- fprintf(yyout, "ECPGdisconnect("");");
- whenever_action(0);
- free(yyvsp[-1].str);
- ;
- break;}
- case 1202:
- #line 5116 "preproc.y"
- {
- yyval.str = yyvsp[0].str;
- ;
- break;}
- case 1203:
- #line 5120 "preproc.y"
- { yyval.str = make1_str("on"); ;
- break;}
- case 1204:
- #line 5121 "preproc.y"
- { yyval.str = make1_str("off"); ;
- break;}
- case 1207:
- #line 5130 "preproc.y"
- {
- yyval.str = yyvsp[0].str;
- ;
- break;}
- case 1208:
- #line 5138 "preproc.y"
- {
- /* add entry to list */
- struct typedefs *ptr, *this;
- int dimension = yyvsp[-1].index.index1;
- int length = yyvsp[-1].index.index2;
- for (ptr = types; ptr != NULL; ptr = ptr->next)
- {
- if (strcmp(yyvsp[-4].str, ptr->name) == 0)
- {
- /* re-definition is a bug */
- sprintf(errortext, "type %s already defined", yyvsp[-4].str);
- yyerror(errortext);
- }
- }
- adjust_array(yyvsp[-2].type.type_enum, &dimension, &length, yyvsp[-2].type.type_dimension, yyvsp[-2].type.type_index, strlen(yyvsp[0].str));
- this = (struct typedefs *) mm_alloc(sizeof(struct typedefs));
- /* initial definition */
- this->next = types;
- this->name = yyvsp[-4].str;
- this->type = (struct this_type *) mm_alloc(sizeof(struct this_type));
- this->type->type_enum = yyvsp[-2].type.type_enum;
- this->type->type_str = mm_strdup(yyvsp[-4].str);
- this->type->type_dimension = dimension; /* dimension of array */
- this->type->type_index = length; /* lenght of string */
- this->struct_member_list = struct_member_list[struct_level];
- if (yyvsp[-2].type.type_enum != ECPGt_varchar &&
- yyvsp[-2].type.type_enum != ECPGt_char &&
- yyvsp[-2].type.type_enum != ECPGt_unsigned_char &&
- this->type->type_index >= 0)
- yyerror("No multi-dimensional array support for simple data types");
- types = this;
- yyval.str = cat5_str(cat3_str(make1_str("/* exec sql type"), mm_strdup(yyvsp[-4].str), make1_str("is")), mm_strdup(yyvsp[-2].type.type_str), mm_strdup(yyvsp[-1].index.str), yyvsp[0].str, make1_str("*/"));
- ;
- break;}
- case 1209:
- #line 5180 "preproc.y"
- {
- yyval.index.index1 = 0;
- yyval.index.index2 = yyvsp[0].index.index1;
- yyval.index.str = cat2_str(make1_str("[]"), yyvsp[0].index.str);
- ;
- break;}
- case 1210:
- #line 5186 "preproc.y"
- {
- yyval.index.index1 = 0;
- yyval.index.index2 = yyvsp[0].index.index1;
- yyval.index.str = cat2_str(make1_str("[]"), yyvsp[0].index.str);
- ;
- break;}
- case 1211:
- #line 5192 "preproc.y"
- {
- char *txt = mm_alloc(20L);
- sprintf (txt, "%d", yyvsp[-2].ival);
- yyval.index.index1 = yyvsp[-2].ival;
- yyval.index.index2 = yyvsp[0].index.index1;
- yyval.index.str = cat4_str(make1_str("["), txt, make1_str("]"), yyvsp[0].index.str);
- ;
- break;}
- case 1212:
- #line 5201 "preproc.y"
- {
- char *txt = mm_alloc(20L);
- sprintf (txt, "%d", yyvsp[-2].ival);
- yyval.index.index1 = yyvsp[-2].ival;
- yyval.index.index2 = yyvsp[0].index.index1;
- yyval.index.str = cat4_str(make1_str("["), txt, make1_str("]"), yyvsp[0].index.str);
- ;
- break;}
- case 1213:
- #line 5210 "preproc.y"
- {
- yyval.index.index1 = -1;
- yyval.index.index2 = -1;
- yyval.index.str= make1_str("");
- ;
- break;}
- case 1214:
- #line 5218 "preproc.y"
- {
- yyval.index.index1 = 0;
- yyval.index.index2 = yyvsp[0].index.index1;
- yyval.index.str = cat2_str(make1_str("[]"), yyvsp[0].index.str);
- ;
- break;}
- case 1215:
- #line 5224 "preproc.y"
- {
- yyval.index.index1 = 0;
- yyval.index.index2 = yyvsp[0].index.index1;
- yyval.index.str = cat2_str(make1_str("[]"), yyvsp[0].index.str);
- ;
- break;}
- case 1216:
- #line 5230 "preproc.y"
- {
- char *txt = mm_alloc(20L);
- sprintf (txt, "%d", yyvsp[-2].ival);
- yyval.index.index1 = yyvsp[-2].ival;
- yyval.index.index2 = yyvsp[0].index.index1;
- yyval.index.str = cat4_str(make1_str("["), txt, make1_str("]"), yyvsp[0].index.str);
- ;
- break;}
- case 1217:
- #line 5239 "preproc.y"
- {
- char *txt = mm_alloc(20L);
- sprintf (txt, "%d", yyvsp[-2].ival);
- yyval.index.index1 = yyvsp[-2].ival;
- yyval.index.index2 = yyvsp[0].index.index1;
- yyval.index.str = cat4_str(make1_str("["), txt, make1_str("]"), yyvsp[0].index.str);
- ;
- break;}
- case 1218:
- #line 5248 "preproc.y"
- {
- yyval.index.index1 = -1;
- yyval.index.index2 = -1;
- yyval.index.str= make1_str("");
- ;
- break;}
- case 1219:
- #line 5254 "preproc.y"
- { yyval.str = make1_str("reference"); ;
- break;}
- case 1220:
- #line 5255 "preproc.y"
- { yyval.str = make1_str(""); ;
- break;}
- case 1221:
- #line 5258 "preproc.y"
- {
- yyval.type.type_str = make1_str("char");
- yyval.type.type_enum = ECPGt_char;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1222:
- #line 5265 "preproc.y"
- {
- yyval.type.type_str = make1_str("varchar");
- yyval.type.type_enum = ECPGt_varchar;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1223:
- #line 5272 "preproc.y"
- {
- yyval.type.type_str = make1_str("float");
- yyval.type.type_enum = ECPGt_float;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1224:
- #line 5279 "preproc.y"
- {
- yyval.type.type_str = make1_str("double");
- yyval.type.type_enum = ECPGt_double;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1225:
- #line 5286 "preproc.y"
- {
- yyval.type.type_str = make1_str("int");
- yyval.type.type_enum = ECPGt_int;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1226:
- #line 5293 "preproc.y"
- {
- yyval.type.type_str = make1_str("int");
- yyval.type.type_enum = ECPGt_int;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1227:
- #line 5300 "preproc.y"
- {
- yyval.type.type_str = make1_str("short");
- yyval.type.type_enum = ECPGt_short;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1228:
- #line 5307 "preproc.y"
- {
- yyval.type.type_str = make1_str("long");
- yyval.type.type_enum = ECPGt_long;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1229:
- #line 5314 "preproc.y"
- {
- yyval.type.type_str = make1_str("bool");
- yyval.type.type_enum = ECPGt_bool;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1230:
- #line 5321 "preproc.y"
- {
- yyval.type.type_str = make1_str("unsigned int");
- yyval.type.type_enum = ECPGt_unsigned_int;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1231:
- #line 5328 "preproc.y"
- {
- yyval.type.type_str = make1_str("unsigned short");
- yyval.type.type_enum = ECPGt_unsigned_short;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1232:
- #line 5335 "preproc.y"
- {
- yyval.type.type_str = make1_str("unsigned long");
- yyval.type.type_enum = ECPGt_unsigned_long;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1233:
- #line 5342 "preproc.y"
- {
- struct_member_list[struct_level++] = NULL;
- if (struct_level >= STRUCT_DEPTH)
- yyerror("Too many levels in nested structure definition");
- ;
- break;}
- case 1234:
- #line 5347 "preproc.y"
- {
- ECPGfree_struct_member(struct_member_list[struct_level--]);
- yyval.type.type_str = cat3_str(make1_str("struct {"), yyvsp[-1].str, make1_str("}"));
- yyval.type.type_enum = ECPGt_struct;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1235:
- #line 5355 "preproc.y"
- {
- struct_member_list[struct_level++] = NULL;
- if (struct_level >= STRUCT_DEPTH)
- yyerror("Too many levels in nested structure definition");
- ;
- break;}
- case 1236:
- #line 5360 "preproc.y"
- {
- ECPGfree_struct_member(struct_member_list[struct_level--]);
- yyval.type.type_str = cat3_str(make1_str("union {"), yyvsp[-1].str, make1_str("}"));
- yyval.type.type_enum = ECPGt_union;
- yyval.type.type_index = -1;
- yyval.type.type_dimension = -1;
- ;
- break;}
- case 1237:
- #line 5368 "preproc.y"
- {
- struct typedefs *this = get_typedef(yyvsp[0].str);
- yyval.type.type_str = mm_strdup(yyvsp[0].str);
- yyval.type.type_enum = this->type->type_enum;
- yyval.type.type_dimension = this->type->type_dimension;
- yyval.type.type_index = this->type->type_index;
- struct_member_list[struct_level] = this->struct_member_list;
- ;
- break;}
- case 1240:
- #line 5381 "preproc.y"
- {
- yyval.str = make1_str("");
- ;
- break;}
- case 1241:
- #line 5385 "preproc.y"
- {
- yyval.str = cat2_str(yyvsp[-1].str, yyvsp[0].str);
- ;
- break;}
- case 1242:
- #line 5391 "preproc.y"
- {
- actual_type[struct_level].type_enum = yyvsp[0].type.type_enum;
- actual_type[struct_level].type_dimension = yyvsp[0].type.type_dimension;
- actual_type[struct_level].type_index = yyvsp[0].type.type_index;
- ;
- break;}
- case 1243:
- #line 5397 "preproc.y"
- {
- yyval.str = cat3_str(yyvsp[-3].type.type_str, yyvsp[-1].str, make1_str(";"));
- ;
- break;}
- case 1244:
- #line 5402 "preproc.y"
- {
- yyval.str = yyvsp[0].str;
- ;
- break;}
- case 1245:
- #line 5406 "preproc.y"
- {
- yyval.str = make3_str(yyvsp[-2].str, make1_str(","), yyvsp[0].str);
- ;
- break;}
- case 1246:
- #line 5411 "preproc.y"
- {
- int dimension = yyvsp[0].index.index1;
- int length = yyvsp[0].index.index2;
- struct ECPGtype * type;
- char dim[14L];
- adjust_array(actual_type[struct_level].type_enum, &dimension, &length, actual_type[struct_level].type_dimension, actual_type[struct_level].type_index, strlen(yyvsp[-2].str));
- switch (actual_type[struct_level].type_enum)
- {
- case ECPGt_struct:
- case ECPGt_union:
- if (dimension < 0)
- type = ECPGmake_struct_type(struct_member_list[struct_level], actual_type[struct_level].type_enum);
- else
- type = ECPGmake_array_type(ECPGmake_struct_type(struct_member_list[struct_level], actual_type[struct_level].type_enum), dimension);
- break;
- case ECPGt_varchar:
- if (dimension == -1)
- type = ECPGmake_simple_type(actual_type[struct_level].type_enum, length);
- else
- type = ECPGmake_array_type(ECPGmake_simple_type(actual_type[struct_level].type_enum, length), dimension);
- switch(dimension)
- {
- case 0:
- strcpy(dim, "[]");
- break;
- case -1:
- case 1:
- *dim = ' ';
- break;
- default:
- sprintf(dim, "[%d]", dimension);
- break;
- }
- break;
- case ECPGt_char:
- case ECPGt_unsigned_char:
- if (dimension == -1)
- type = ECPGmake_simple_type(actual_type[struct_level].type_enum, length);
- else
- type = ECPGmake_array_type(ECPGmake_simple_type(actual_type[struct_level].type_enum, length), dimension);
- break;
- default:
- if (length >= 0)
- yyerror("No multi-dimensional array support for simple data types");
- if (dimension < 0)
- type = ECPGmake_simple_type(actual_type[struct_level].type_enum, 1);
- else
- type = ECPGmake_array_type(ECPGmake_simple_type(actual_type[struct_level].type_enum, 1), dimension);
- break;
- }
- if (struct_level == 0)
- new_variable(yyvsp[-1].str, type);
- else
- ECPGmake_struct_member(yyvsp[-1].str, type, &(struct_member_list[struct_level - 1]));
- yyval.str = cat3_str(yyvsp[-2].str, yyvsp[-1].str, yyvsp[0].index.str);
- ;
- break;}
- case 1247:
- #line 5482 "preproc.y"
- {
- struct variable *p = find_variable(yyvsp[-4].str);
- int dimension = yyvsp[-1].index.index1;
- int length = yyvsp[-1].index.index2;
- struct ECPGtype * type;
- adjust_array(yyvsp[-2].type.type_enum, &dimension, &length, yyvsp[-2].type.type_dimension, yyvsp[-2].type.type_index, strlen(yyvsp[0].str));
- switch (yyvsp[-2].type.type_enum)
- {
- case ECPGt_struct:
- case ECPGt_union:
- if (dimension < 0)
- type = ECPGmake_struct_type(struct_member_list[struct_level], yyvsp[-2].type.type_enum);
- else
- type = ECPGmake_array_type(ECPGmake_struct_type(struct_member_list[struct_level], yyvsp[-2].type.type_enum), dimension);
- break;
- case ECPGt_varchar:
- if (dimension == -1)
- type = ECPGmake_simple_type(yyvsp[-2].type.type_enum, length);
- else
- type = ECPGmake_array_type(ECPGmake_simple_type(yyvsp[-2].type.type_enum, length), dimension);
- break;
- case ECPGt_char:
- case ECPGt_unsigned_char:
- if (dimension == -1)
- type = ECPGmake_simple_type(yyvsp[-2].type.type_enum, length);
- else
- type = ECPGmake_array_type(ECPGmake_simple_type(yyvsp[-2].type.type_enum, length), dimension);
- break;
- default:
- if (length >= 0)
- yyerror("No multi-dimensional array support for simple data types");
- if (dimension < 0)
- type = ECPGmake_simple_type(yyvsp[-2].type.type_enum, 1);
- else
- type = ECPGmake_array_type(ECPGmake_simple_type(yyvsp[-2].type.type_enum, 1), dimension);
- break;
- }
- ECPGfree_type(p->type);
- p->type = type;
- yyval.str = cat5_str(cat3_str(make1_str("/* exec sql var"), mm_strdup(yyvsp[-4].str), make1_str("is")), mm_strdup(yyvsp[-2].type.type_str), mm_strdup(yyvsp[-1].index.str), yyvsp[0].str, make1_str("*/"));
- ;
- break;}
- case 1248:
- #line 5536 "preproc.y"
- {
- when_error.code = yyvsp[0].action.code;
- when_error.command = yyvsp[0].action.command;
- yyval.str = cat3_str(make1_str("/* exec sql whenever sqlerror "), yyvsp[0].action.str, make1_str("; */n"));
- ;
- break;}
- case 1249:
- #line 5541 "preproc.y"
- {
- when_nf.code = yyvsp[0].action.code;
- when_nf.command = yyvsp[0].action.command;
- yyval.str = cat3_str(make1_str("/* exec sql whenever not found "), yyvsp[0].action.str, make1_str("; */n"));
- ;
- break;}
- case 1250:
- #line 5546 "preproc.y"
- {
- when_warn.code = yyvsp[0].action.code;
- when_warn.command = yyvsp[0].action.command;
- yyval.str = cat3_str(make1_str("/* exec sql whenever sql_warning "), yyvsp[0].action.str, make1_str("; */n"));
- ;
- break;}
- case 1251:
- #line 5552 "preproc.y"
- {
- yyval.action.code = W_NOTHING;
- yyval.action.command = NULL;
- yyval.action.str = make1_str("continue");
- ;
- break;}
- case 1252:
- #line 5557 "preproc.y"
- {
- yyval.action.code = W_SQLPRINT;
- yyval.action.command = NULL;
- yyval.action.str = make1_str("sqlprint");
- ;
- break;}
- case 1253:
- #line 5562 "preproc.y"
- {
- yyval.action.code = W_STOP;
- yyval.action.command = NULL;
- yyval.action.str = make1_str("stop");
- ;
- break;}
- case 1254:
- #line 5567 "preproc.y"
- {
- yyval.action.code = W_GOTO;
- yyval.action.command = strdup(yyvsp[0].str);
- yyval.action.str = cat2_str(make1_str("goto "), yyvsp[0].str);
- ;
- break;}
- case 1255:
- #line 5572 "preproc.y"
- {
- yyval.action.code = W_GOTO;
- yyval.action.command = strdup(yyvsp[0].str);
- yyval.action.str = cat2_str(make1_str("goto "), yyvsp[0].str);
- ;
- break;}
- case 1256:
- #line 5577 "preproc.y"
- {
- yyval.action.code = W_DO;
- yyval.action.command = make4_str(yyvsp[-3].str, make1_str("("), yyvsp[-1].str, make1_str(")"));
- yyval.action.str = cat2_str(make1_str("do"), mm_strdup(yyval.action.command));
- ;
- break;}
- case 1257:
- #line 5582 "preproc.y"
- {
- yyval.action.code = W_BREAK;
- yyval.action.command = NULL;
- yyval.action.str = make1_str("break");
- ;
- break;}
- case 1258:
- #line 5587 "preproc.y"
- {
- yyval.action.code = W_DO;
- yyval.action.command = make4_str(yyvsp[-3].str, make1_str("("), yyvsp[-1].str, make1_str(")"));
- yyval.action.str = cat2_str(make1_str("call"), mm_strdup(yyval.action.command));
- ;
- break;}
- case 1259:
- #line 5595 "preproc.y"
- {
- yyval.str = cat2_str(yyvsp[-1].str, yyvsp[0].str);
- ;
- break;}
- case 1260:
- #line 5599 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1261:
- #line 5601 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1262:
- #line 5603 "preproc.y"
- {
- yyval.str = yyvsp[0].str;
- ;
- break;}
- case 1263:
- #line 5607 "preproc.y"
- { yyval.str = cat2_str(make1_str("-"), yyvsp[0].str); ;
- break;}
- case 1264:
- #line 5609 "preproc.y"
- { yyval.str = cat2_str(make1_str("%"), yyvsp[0].str); ;
- break;}
- case 1265:
- #line 5611 "preproc.y"
- { yyval.str = cat2_str(yyvsp[-1].str, make1_str("%")); ;
- break;}
- case 1266:
- #line 5613 "preproc.y"
- { yyval.str = cat3_str(yyvsp[-2].str, make1_str("+"), yyvsp[0].str); ;
- break;}
- case 1267:
- #line 5615 "preproc.y"
- { yyval.str = cat3_str(yyvsp[-2].str, make1_str("-"), yyvsp[0].str); ;
- break;}
- case 1268:
- #line 5617 "preproc.y"
- { yyval.str = cat3_str(yyvsp[-2].str, make1_str("/"), yyvsp[0].str); ;
- break;}
- case 1269:
- #line 5619 "preproc.y"
- { yyval.str = cat3_str(yyvsp[-2].str, make1_str("%"), yyvsp[0].str); ;
- break;}
- case 1270:
- #line 5621 "preproc.y"
- { yyval.str = cat3_str(yyvsp[-2].str, make1_str("*"), yyvsp[0].str); ;
- break;}
- case 1271:
- #line 5623 "preproc.y"
- { yyval.str = cat3_str(yyvsp[-2].str, make1_str("<"), yyvsp[0].str); ;
- break;}
- case 1272:
- #line 5625 "preproc.y"
- { yyval.str = cat3_str(yyvsp[-2].str, make1_str(">"), yyvsp[0].str); ;
- break;}
- case 1273:
- #line 5627 "preproc.y"
- { yyval.str = cat2_str(yyvsp[-2].str, make1_str("= NULL")); ;
- break;}
- case 1274:
- #line 5629 "preproc.y"
- { yyval.str = cat2_str(make1_str("= NULL"), yyvsp[0].str); ;
- break;}
- case 1275:
- #line 5631 "preproc.y"
- { yyval.str = cat3_str(yyvsp[-2].str, make1_str("="), yyvsp[0].str); ;
- break;}
- case 1276:
- #line 5635 "preproc.y"
- { yyval.str = cat2_str(make1_str(";"), yyvsp[0].str); ;
- break;}
- case 1277:
- #line 5637 "preproc.y"
- { yyval.str = cat2_str(make1_str("|"), yyvsp[0].str); ;
- break;}
- case 1278:
- #line 5639 "preproc.y"
- {
- yyval.str = cat3_str(yyvsp[-2].str, make1_str("::"), yyvsp[0].str);
- ;
- break;}
- case 1279:
- #line 5643 "preproc.y"
- {
- yyval.str = cat3_str(make2_str(make1_str("cast("), yyvsp[-3].str), make1_str("as"), make2_str(yyvsp[-1].str, make1_str(")")));
- ;
- break;}
- case 1280:
- #line 5647 "preproc.y"
- { yyval.str = make3_str(make1_str("("), yyvsp[-1].str, make1_str(")")); ;
- break;}
- case 1281:
- #line 5649 "preproc.y"
- { yyval.str = cat3_str(yyvsp[-2].str, yyvsp[-1].str, yyvsp[0].str); ;
- break;}
- case 1282:
- #line 5651 "preproc.y"
- { yyval.str = cat3_str(yyvsp[-2].str, make1_str("like"), yyvsp[0].str); ;
- break;}
- case 1283:
- #line 5653 "preproc.y"
- { yyval.str = cat3_str(yyvsp[-3].str, make1_str("not like"), yyvsp[0].str); ;
- break;}
- case 1284:
- #line 5655 "preproc.y"
- { yyval.str = cat2_str(yyvsp[-1].str, yyvsp[0].str); ;
- break;}
- case 1285:
- #line 5657 "preproc.y"
- { yyval.str = cat2_str(yyvsp[-1].str, yyvsp[0].str); ;
- break;}
- case 1286:
- #line 5659 "preproc.y"
- {
- yyval.str = cat2_str(yyvsp[-3].str, make1_str("(*)"));
- ;
- break;}
- case 1287:
- #line 5663 "preproc.y"
- {
- yyval.str = cat2_str(yyvsp[-2].str, make1_str("()"));
- ;
- break;}
- case 1288:
- #line 5667 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-3].str, make1_str("("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1289:
- #line 5671 "preproc.y"
- {
- yyval.str = make1_str("current_date");
- ;
- break;}
- case 1290:
- #line 5675 "preproc.y"
- {
- yyval.str = make1_str("current_time");
- ;
- break;}
- case 1291:
- #line 5679 "preproc.y"
- {
- if (atol(yyvsp[-1].str) != 0)
- fprintf(stderr,"CURRENT_TIME(%s) precision not implemented; zero used instead", yyvsp[-1].str);
- yyval.str = make1_str("current_time");
- ;
- break;}
- case 1292:
- #line 5685 "preproc.y"
- {
- yyval.str = make1_str("current_timestamp");
- ;
- break;}
- case 1293:
- #line 5689 "preproc.y"
- {
- if (atol(yyvsp[-1].str) != 0)
- fprintf(stderr,"CURRENT_TIMESTAMP(%s) precision not implemented; zero used instead",yyvsp[-1].str);
- yyval.str = make1_str("current_timestamp");
- ;
- break;}
- case 1294:
- #line 5695 "preproc.y"
- {
- yyval.str = make1_str("current_user");
- ;
- break;}
- case 1295:
- #line 5699 "preproc.y"
- {
- yyval.str = make1_str("user");
- ;
- break;}
- case 1296:
- #line 5703 "preproc.y"
- {
- yyval.str = make3_str(make1_str("exists("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1297:
- #line 5707 "preproc.y"
- {
- yyval.str = make3_str(make1_str("extract("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1298:
- #line 5711 "preproc.y"
- {
- yyval.str = make3_str(make1_str("position("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1299:
- #line 5715 "preproc.y"
- {
- yyval.str = make3_str(make1_str("substring("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1300:
- #line 5720 "preproc.y"
- {
- yyval.str = make3_str(make1_str("trim(both"), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1301:
- #line 5724 "preproc.y"
- {
- yyval.str = make3_str(make1_str("trim(leading"), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1302:
- #line 5728 "preproc.y"
- {
- yyval.str = make3_str(make1_str("trim(trailing"), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1303:
- #line 5732 "preproc.y"
- {
- yyval.str = make3_str(make1_str("trim("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1304:
- #line 5736 "preproc.y"
- { yyval.str = cat2_str(yyvsp[-1].str, make1_str("isnull")); ;
- break;}
- case 1305:
- #line 5738 "preproc.y"
- { yyval.str = cat2_str(yyvsp[-2].str, make1_str("is null")); ;
- break;}
- case 1306:
- #line 5740 "preproc.y"
- { yyval.str = cat2_str(yyvsp[-1].str, make1_str("notnull")); ;
- break;}
- case 1307:
- #line 5742 "preproc.y"
- { yyval.str = cat2_str(yyvsp[-3].str, make1_str("is not null")); ;
- break;}
- case 1308:
- #line 5749 "preproc.y"
- {
- { yyval.str = cat2_str(yyvsp[-2].str, make1_str("is true")); }
- ;
- break;}
- case 1309:
- #line 5753 "preproc.y"
- {
- { yyval.str = cat2_str(yyvsp[-3].str, make1_str("is not false")); }
- ;
- break;}
- case 1310:
- #line 5757 "preproc.y"
- {
- { yyval.str = cat2_str(yyvsp[-2].str, make1_str("is false")); }
- ;
- break;}
- case 1311:
- #line 5761 "preproc.y"
- {
- { yyval.str = cat2_str(yyvsp[-3].str, make1_str("is not true")); }
- ;
- break;}
- case 1312:
- #line 5765 "preproc.y"
- {
- yyval.str = cat5_str(yyvsp[-4].str, make1_str("between"), yyvsp[-2].str, make1_str("and"), yyvsp[0].str);
- ;
- break;}
- case 1313:
- #line 5769 "preproc.y"
- {
- yyval.str = cat5_str(yyvsp[-5].str, make1_str("not between"), yyvsp[-2].str, make1_str("and"), yyvsp[0].str);
- ;
- break;}
- case 1314:
- #line 5773 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-4].str, make1_str(" in ("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1315:
- #line 5777 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str(" not in ("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1316:
- #line 5781 "preproc.y"
- {
- yyval.str = cat3_str(yyvsp[-4].str, yyvsp[-3].str, make3_str(make1_str("("), yyvsp[-1].str, make1_str(")")));
- ;
- break;}
- case 1317:
- #line 5785 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-4].str, make1_str("+("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1318:
- #line 5789 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-4].str, make1_str("-("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1319:
- #line 5793 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-4].str, make1_str("/("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1320:
- #line 5797 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-4].str, make1_str("%("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1321:
- #line 5801 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-4].str, make1_str("*("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1322:
- #line 5805 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-4].str, make1_str("<("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1323:
- #line 5809 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-4].str, make1_str(">("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1324:
- #line 5813 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-4].str, make1_str("=("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1325:
- #line 5817 "preproc.y"
- {
- yyval.str = cat3_str(yyvsp[-5].str, yyvsp[-4].str, make3_str(make1_str("any ("), yyvsp[-1].str, make1_str(")")));
- ;
- break;}
- case 1326:
- #line 5821 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("+ any("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1327:
- #line 5825 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("- any("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1328:
- #line 5829 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("/ any("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1329:
- #line 5833 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("% any("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1330:
- #line 5837 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("* any("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1331:
- #line 5841 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("< any("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1332:
- #line 5845 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("> any("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1333:
- #line 5849 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("= any("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1334:
- #line 5853 "preproc.y"
- {
- yyval.str = cat3_str(yyvsp[-5].str, yyvsp[-4].str, make3_str(make1_str("all ("), yyvsp[-1].str, make1_str(")")));
- ;
- break;}
- case 1335:
- #line 5857 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("+ all("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1336:
- #line 5861 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("- all("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1337:
- #line 5865 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("/ all("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1338:
- #line 5869 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("% all("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1339:
- #line 5873 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("* all("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1340:
- #line 5877 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("< all("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1341:
- #line 5881 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("> all("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1342:
- #line 5885 "preproc.y"
- {
- yyval.str = make4_str(yyvsp[-5].str, make1_str("=all("), yyvsp[-1].str, make1_str(")"));
- ;
- break;}
- case 1343:
- #line 5889 "preproc.y"
- { yyval.str = cat3_str(yyvsp[-2].str, make1_str("and"), yyvsp[0].str); ;
- break;}
- case 1344:
- #line 5891 "preproc.y"
- { yyval.str = cat3_str(yyvsp[-2].str, make1_str("or"), yyvsp[0].str); ;
- break;}
- case 1345:
- #line 5893 "preproc.y"
- { yyval.str = cat2_str(make1_str("not"), yyvsp[0].str); ;
- break;}
- case 1346:
- #line 5895 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1347:
- #line 5897 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1350:
- #line 5902 "preproc.y"
- { reset_variables();;
- break;}
- case 1351:
- #line 5904 "preproc.y"
- { yyval.str = make1_str(""); ;
- break;}
- case 1352:
- #line 5905 "preproc.y"
- { yyval.str = make2_str(yyvsp[-1].str, yyvsp[0].str); ;
- break;}
- case 1353:
- #line 5907 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1354:
- #line 5908 "preproc.y"
- { yyval.str = make2_str(yyvsp[-1].str, yyvsp[0].str); ;
- break;}
- case 1355:
- #line 5910 "preproc.y"
- {
- add_variable(&argsresult, find_variable(yyvsp[-1].str), (yyvsp[0].str == NULL) ? &no_indicator : find_variable(yyvsp[0].str));
- ;
- break;}
- case 1356:
- #line 5914 "preproc.y"
- {
- add_variable(&argsinsert, find_variable(yyvsp[-1].str), (yyvsp[0].str == NULL) ? &no_indicator : find_variable(yyvsp[0].str));
- ;
- break;}
- case 1357:
- #line 5918 "preproc.y"
- {
- add_variable(&argsinsert, find_variable(yyvsp[0].str), &no_indicator);
- yyval.str = make1_str("?");
- ;
- break;}
- case 1358:
- #line 5923 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1359:
- #line 5925 "preproc.y"
- { yyval.str = NULL; ;
- break;}
- case 1360:
- #line 5926 "preproc.y"
- { check_indicator((find_variable(yyvsp[0].str))->type); yyval.str = yyvsp[0].str; ;
- break;}
- case 1361:
- #line 5927 "preproc.y"
- { check_indicator((find_variable(yyvsp[0].str))->type); yyval.str = yyvsp[0].str; ;
- break;}
- case 1362:
- #line 5928 "preproc.y"
- { check_indicator((find_variable(yyvsp[0].str))->type); yyval.str = yyvsp[0].str; ;
- break;}
- case 1363:
- #line 5930 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1364:
- #line 5931 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1365:
- #line 5936 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1366:
- #line 5938 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1367:
- #line 5940 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1368:
- #line 5942 "preproc.y"
- {
- yyval.str = make2_str(yyvsp[-1].str, yyvsp[0].str);
- ;
- break;}
- case 1370:
- #line 5946 "preproc.y"
- { yyval.str = make1_str(";"); ;
- break;}
- case 1371:
- #line 5948 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1372:
- #line 5949 "preproc.y"
- { yyval.str = make3_str(make1_str("""), yyvsp[0].str, make1_str(""")); ;
- break;}
- case 1373:
- #line 5950 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1374:
- #line 5951 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1375:
- #line 5952 "preproc.y"
- { yyval.str = make1_str("*"); ;
- break;}
- case 1376:
- #line 5953 "preproc.y"
- { yyval.str = make1_str("+"); ;
- break;}
- case 1377:
- #line 5954 "preproc.y"
- { yyval.str = make1_str("-"); ;
- break;}
- case 1378:
- #line 5955 "preproc.y"
- { yyval.str = make1_str("/"); ;
- break;}
- case 1379:
- #line 5956 "preproc.y"
- { yyval.str = make1_str("%"); ;
- break;}
- case 1380:
- #line 5957 "preproc.y"
- { yyval.str = make1_str("auto"); ;
- break;}
- case 1381:
- #line 5958 "preproc.y"
- { yyval.str = make1_str("bool"); ;
- break;}
- case 1382:
- #line 5959 "preproc.y"
- { yyval.str = make1_str("char"); ;
- break;}
- case 1383:
- #line 5960 "preproc.y"
- { yyval.str = make1_str("const"); ;
- break;}
- case 1384:
- #line 5961 "preproc.y"
- { yyval.str = make1_str("double"); ;
- break;}
- case 1385:
- #line 5962 "preproc.y"
- { yyval.str = make1_str("enum"); ;
- break;}
- case 1386:
- #line 5963 "preproc.y"
- { yyval.str = make1_str("extern"); ;
- break;}
- case 1387:
- #line 5964 "preproc.y"
- { yyval.str = make1_str("float"); ;
- break;}
- case 1388:
- #line 5965 "preproc.y"
- { yyval.str = make1_str("int"); ;
- break;}
- case 1389:
- #line 5966 "preproc.y"
- { yyval.str = make1_str("long"); ;
- break;}
- case 1390:
- #line 5967 "preproc.y"
- { yyval.str = make1_str("register"); ;
- break;}
- case 1391:
- #line 5968 "preproc.y"
- { yyval.str = make1_str("short"); ;
- break;}
- case 1392:
- #line 5969 "preproc.y"
- { yyval.str = make1_str("signed"); ;
- break;}
- case 1393:
- #line 5970 "preproc.y"
- { yyval.str = make1_str("static"); ;
- break;}
- case 1394:
- #line 5971 "preproc.y"
- { yyval.str = make1_str("struct"); ;
- break;}
- case 1395:
- #line 5972 "preproc.y"
- { yyval.str = make1_str("union"); ;
- break;}
- case 1396:
- #line 5973 "preproc.y"
- { yyval.str = make1_str("unsigned"); ;
- break;}
- case 1397:
- #line 5974 "preproc.y"
- { yyval.str = make1_str("varchar"); ;
- break;}
- case 1398:
- #line 5975 "preproc.y"
- { yyval.str = make_name(); ;
- break;}
- case 1399:
- #line 5976 "preproc.y"
- { yyval.str = make1_str("["); ;
- break;}
- case 1400:
- #line 5977 "preproc.y"
- { yyval.str = make1_str("]"); ;
- break;}
- case 1401:
- #line 5978 "preproc.y"
- { yyval.str = make1_str("("); ;
- break;}
- case 1402:
- #line 5979 "preproc.y"
- { yyval.str = make1_str(")"); ;
- break;}
- case 1403:
- #line 5980 "preproc.y"
- { yyval.str = make1_str("="); ;
- break;}
- case 1404:
- #line 5981 "preproc.y"
- { yyval.str = make1_str(","); ;
- break;}
- case 1405:
- #line 5983 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1406:
- #line 5984 "preproc.y"
- { yyval.str = make3_str(make1_str("""), yyvsp[0].str, make1_str("""));;
- break;}
- case 1407:
- #line 5985 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1408:
- #line 5986 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1409:
- #line 5987 "preproc.y"
- { yyval.str = make1_str(","); ;
- break;}
- case 1410:
- #line 5989 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1411:
- #line 5990 "preproc.y"
- { yyval.str = make3_str(make1_str("""), yyvsp[0].str, make1_str(""")); ;
- break;}
- case 1412:
- #line 5991 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1413:
- #line 5992 "preproc.y"
- { yyval.str = yyvsp[0].str; ;
- break;}
- case 1414:
- #line 5993 "preproc.y"
- { yyval.str = make3_str(make1_str("{"), yyvsp[-1].str, make1_str("}")); ;
- break;}
- case 1415:
- #line 5995 "preproc.y"
- {
- braces_open++;
- yyval.str = make1_str("{");
- ;
- break;}
- case 1416:
- #line 6000 "preproc.y"
- {
- remove_variables(braces_open--);
- yyval.str = make1_str("}");
- ;
- break;}
- }
- /* the action file gets copied in in place of this dollarsign */
- #line 543 "/usr/share/misc/bison.simple"
- yyvsp -= yylen;
- yyssp -= yylen;
- #ifdef YYLSP_NEEDED
- yylsp -= yylen;
- #endif
- #if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "n");
- }
- #endif
- *++yyvsp = yyval;
- #ifdef YYLSP_NEEDED
- yylsp++;
- if (yylen == 0)
- {
- yylsp->first_line = yylloc.first_line;
- yylsp->first_column = yylloc.first_column;
- yylsp->last_line = (yylsp-1)->last_line;
- yylsp->last_column = (yylsp-1)->last_column;
- yylsp->text = 0;
- }
- else
- {
- yylsp->last_line = (yylsp+yylen-1)->last_line;
- yylsp->last_column = (yylsp+yylen-1)->last_column;
- }
- #endif
- /* Now "shift" the result of the reduction.
- Determine what state that goes to,
- based on the state we popped back to
- and the rule number reduced by. */
- yyn = yyr1[yyn];
- yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
- if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTBASE];
- goto yynewstate;
- yyerrlab: /* here on detecting error */
- if (! yyerrstatus)
- /* If not already recovering from an error, report this error. */
- {
- ++yynerrs;
- #ifdef YYERROR_VERBOSE
- yyn = yypact[yystate];
- if (yyn > YYFLAG && yyn < YYLAST)
- {
- int size = 0;
- char *msg;
- int x, count;
- count = 0;
- /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
- for (x = (yyn < 0 ? -yyn : 0);
- x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
- size += strlen(yytname[x]) + 15, count++;
- msg = (char *) malloc(size + 15);
- if (msg != 0)
- {
- strcpy(msg, "parse error");
- if (count < 5)
- {
- count = 0;
- for (x = (yyn < 0 ? -yyn : 0);
- x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
- {
- strcat(msg, count == 0 ? ", expecting `" : " or `");
- strcat(msg, yytname[x]);
- strcat(msg, "'");
- count++;
- }
- }
- yyerror(msg);
- free(msg);
- }
- else
- yyerror ("parse error; also virtual memory exceeded");
- }
- else
- #endif /* YYERROR_VERBOSE */
- yyerror("parse error");
- }
- goto yyerrlab1;
- yyerrlab1: /* here on error raised explicitly by an action */
- if (yyerrstatus == 3)
- {
- /* if just tried and failed to reuse lookahead token after an error, discard it. */
- /* return failure if at end of input */
- if (yychar == YYEOF)
- YYABORT;
- #if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Discarding token %d (%s).n", yychar, yytname[yychar1]);
- #endif
- yychar = YYEMPTY;
- }
- /* Else will try to reuse lookahead token
- after shifting the error token. */
- yyerrstatus = 3; /* Each real token shifted decrements this */
- goto yyerrhandle;
- yyerrdefault: /* current state does not do anything special for the error token. */
- #if 0
- /* This is wrong; only states that explicitly want error tokens
- should shift them. */
- yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
- if (yyn) goto yydefault;
- #endif
- yyerrpop: /* pop the current state because it cannot handle the error token */
- if (yyssp == yyss) YYABORT;
- yyvsp--;
- yystate = *--yyssp;
- #ifdef YYLSP_NEEDED
- yylsp--;
- #endif
- #if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "Error: state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "n");
- }
- #endif
- yyerrhandle:
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yyerrdefault;
- yyn += YYTERROR;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
- goto yyerrdefault;
- yyn = yytable[yyn];
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrpop;
- yyn = -yyn;
- goto yyreduce;
- }
- else if (yyn == 0)
- goto yyerrpop;
- if (yyn == YYFINAL)
- YYACCEPT;
- #if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting error token, ");
- #endif
- *++yyvsp = yylval;
- #ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
- #endif
- yystate = yyn;
- goto yynewstate;
- yyacceptlab:
- /* YYACCEPT comes here. */
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
- #ifdef YYLSP_NEEDED
- free (yyls);
- #endif
- }
- return 0;
- yyabortlab:
- /* YYABORT comes here. */
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
- #ifdef YYLSP_NEEDED
- free (yyls);
- #endif
- }
- return 1;
- }
- #line 6005 "preproc.y"
- void yyerror(char * error)
- {
- fprintf(stderr, "%s:%d: %sn", input_filename, yylineno, error);
- exit(PARSE_ERROR);
- }