📄 dal.c
字号:
previnst = loopstack[loop_lvl]; } break; case 14:#line 103 "dal.y" { yyerrok; dderror( DB_TEXT("While loop aborted"), yyvsp[0].tnum.numline ); loop_lvl--; freeloop( &loopstack[loop_lvl] ); } break; case 15:#line 111 "dal.y" { int i; newinst( &curinst ); if ( curinst == NULL ) return(1); loopstack[loop_lvl++] = curinst; vtstrcpy( curinst->i_name, DB_TEXT("while") ); if ( loop_lvl > 1 ) { if ( previnst == NULL ) loopstack[loop_lvl-2]->i_loop = curinst; else previnst->i_next = curinst; } previnst = NULL; if ( !batch ) { for (i=0; i<loop_lvl; i++ ) vtprintf( DB_TEXT(" ") ); vtprintf( DB_TEXT("d_") ); } } break; case 16:#line 135 "dal.y" { if (loop_lvl ==0 ) { dalexec( curinst ); freeinst( &curinst ); } } break; case 17:#line 143 "dal.y" { yyerrok; dderror( DB_TEXT("Characters following closing paren"), yyvsp[0].tnum.numline ); } break; case 18:#line 148 "dal.y" { yyerrok; dderror( DB_TEXT("Missing closing paren"), yyvsp[0].tnum.numline ); } break; case 19:#line 153 "dal.y" { yyerrok; dderror( DB_TEXT("Invalid function call"), yyvsp[0].tnum.numline ); } break; case 20:#line 159 "dal.y" { newinst( &curinst ); if ( curinst == NULL ) return(1); vtstrncpy( curinst->i_name, yyvsp[0].tstr.str, 9 ); nparams = 0; fld[0][0] = fld[1][0] = fld[2][0] = 0; if ( loop_lvl ) { if ( previnst == NULL ) loopstack[loop_lvl-1]->i_loop = curinst; else previnst->i_next = curinst; previnst = curinst; } } break; case 22:#line 178 "dal.y" { vtstrncpy( curinst->i_p1, yyvsp[0].tstr.str, NAMELEN ); vtstrncpy( curinst->i_f1, fld[0], NAMELEN ); } break; case 23:#line 183 "dal.y" { vtstrncpy( curinst->i_p1, yyvsp[-2].tstr.str, NAMELEN ); vtstrncpy( curinst->i_f1, fld[0], NAMELEN ); vtstrncpy( curinst->i_p2, yyvsp[0].tstr.str, NAMELEN ); vtstrncpy( curinst->i_f2, fld[1], NAMELEN ); } break; case 24:#line 190 "dal.y" { vtstrncpy( curinst->i_p1, yyvsp[-4].tstr.str, NAMELEN ); vtstrncpy( curinst->i_f1, fld[0], NAMELEN ); vtstrncpy( curinst->i_p2, yyvsp[-2].tstr.str, NAMELEN ); vtstrncpy( curinst->i_f2, fld[1], NAMELEN ); vtstrncpy( curinst->i_p3, yyvsp[0].tstr.str, NAMELEN ); vtstrncpy( curinst->i_f3, fld[2], NAMELEN ); } break; case 25:#line 199 "dal.y" { yyerrok; dderror(DB_TEXT("Too many parameters"), yyvsp[0].tnum.numline); } break; case 26:#line 205 "dal.y" { vtstrcpy( yyval.tstr.str, yyvsp[0].tstr.str ); nparams++; } break; case 27:#line 210 "dal.y" { vtstrcpy( fld[nparams], yyvsp[0].tstr.str ); nparams++; } break; case 28:#line 215 "dal.y" { vtstrcpy( yyval.tstr.str, genlit( yyvsp[0].tstr.str ) ); fld[nparams][0] = 0; nparams++; } break; case 29:#line 222 "dal.y" { if ( loop_lvl == 0) { dalexec( curinst ); freeinst( &curinst ); } } break; case 30:#line 230 "dal.y" { vtstrcpy( curinst->i_p1, yyvsp[-3].tstr.str ); if ( loop_lvl == 0 ) { dalexec( curinst ); freeinst( &curinst ); } } break; case 33:#line 243 "dal.y" { newinst( &curinst ); if ( curinst == NULL ) return(1); vtstrcpy( curinst->i_name, yyvsp[0].tstr.str ); if ( loop_lvl ) { if ( previnst == NULL ) loopstack[loop_lvl-1]->i_loop = curinst; else previnst->i_next = curinst; previnst = curinst; } } break; case 34:#line 259 "dal.y" { vtstrcpy( yyval.tstr.str, DB_TEXT("print") ); } break; case 35:#line 263 "dal.y" { vtstrcpy( yyval.tstr.str, DB_TEXT("input") ); } break; case 36:#line 268 "dal.y" { newprint( &curprint ); if ( curprint == NULL ) return(1); curinst->i_pfld = curprint; vtstrcpy( curprint->pf_rec, prflds.pf_rec ); vtstrcpy( curprint->pf_fld, prflds.pf_fld ); } break; case 37:#line 277 "dal.y" { newprint( &(curprint->pf_next) ); if ( curprint == NULL ) return(1); curprint = curprint->pf_next; vtstrcpy( curprint->pf_rec, prflds.pf_rec ); vtstrcpy( curprint->pf_fld, prflds.pf_fld ); } break; case 38:#line 287 "dal.y" { vtstrcpy( prflds.pf_rec, yyvsp[0].tstr.str ); prflds.pf_fld[0] = 0; } break; case 39:#line 292 "dal.y" { vtstrcpy( prflds.pf_rec, yyvsp[-2].tstr.str ); vtstrcpy( prflds.pf_fld, yyvsp[0].tstr.str ); } break; case 40:#line 297 "dal.y" { vtstrcpy( prflds.pf_rec, genlit( yyvsp[0].tstr.str ) ); prflds.pf_fld[0] = 0; } break; case 41:#line 303 "dal.y" { newinst( &curinst ); if ( curinst == NULL ) return(1); vtstrcpy( curinst->i_p1, yyvsp[-1].tstr.str ); vtstrcpy( curinst->i_name, DB_TEXT("rewind") ); if ( loop_lvl ) { if ( previnst == NULL ) loopstack[loop_lvl-1]->i_loop = curinst; else previnst->i_next = curinst; previnst = curinst; } if ( loop_lvl == 0 ) { dalexec( curinst ); freeinst( &curinst ); } } break; case 42:#line 325 "dal.y" { dalschem( DB_TEXT("") ); } break; case 43:#line 329 "dal.y" { dalschem( yyvsp[-1].tstr.str ); } break; case 44:#line 333 "dal.y" { yyerrok; dderror( DB_TEXT(" Invalid Parameter (s)"), yyvsp[0].tnum.numline ); } break; case 45:#line 339 "dal.y" { newinst( &curinst ); if ( curinst == NULL ) return(1); vtstrcpy( curinst->i_name, DB_TEXT("currency") ); if ( loop_lvl ) { if ( previnst == NULL ) loopstack[loop_lvl-1]->i_loop = curinst; else previnst->i_next = curinst; previnst = curinst; } if (loop_lvl ==0 ) { dalexec( curinst ); freeinst( &curinst ); } } break; case 46:#line 360 "dal.y" { dalio_close(); d_close(DalDbTask); return(0); } break; case 47:#line 366 "dal.y" { dalio_close(); return(1); } break; }/* Line 1000 of yacc.c. */#line 1519 "dal.c" yyvsp -= yylen; yyssp -= yylen; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* 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 - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate;/*------------------------------------.| yyerrlab -- here on detecting error |`------------------------------------*/yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs;#if YYERROR_VERBOSE yyn = yypact[yystate]; if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); const char* yyprefix; char *yymsg; int yyx; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 0; yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); yycount += 1; if (yycount == 5) { yysize = 0; break; } } yysize += (sizeof ("syntax error, unexpected ") + yystrlen (yytname[yytype])); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yyp = yystpcpy (yyp, yyprefix); yyp = yystpcpy (yyp, yytname[yyx]); yyprefix = " or "; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("syntax error; also virtual memory exhausted"); } else#endif /* YYERROR_VERBOSE */ yyerror ("syntax error"); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* If at end of input, pop the error token, then the rest of the stack, then return failure. */ if (yychar == YYEOF) for (;;) { YYPOPSTACK; if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[*yyssp], yyvsp); } } else { YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); yydestruct (yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1;/*---------------------------------------------------.| yyerrorlab -- error raised explicitly by YYERROR. |`---------------------------------------------------*/yyerrorlab:#ifdef __GNUC__ /* Pacify GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) goto yyerrorlab;#endif yyvsp -= yylen; yyssp -= yylen; yystate = *yyssp; goto yyerrlab1;/*-------------------------------------------------------------.| yyerrlab1 -- common code for both syntax error and YYERROR. |`-------------------------------------------------------------*/yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp); YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; yystate = yyn; goto yynewstate;/*-------------------------------------.| yyacceptlab -- YYACCEPT comes here. |`-------------------------------------*/yyacceptlab: yyresult = 0; goto yyreturn;/*-----------------------------------.| yyabortlab -- YYABORT comes here. |`-----------------------------------*/yyabortlab: yyresult = 1; goto yyreturn;#ifndef yyoverflow/*----------------------------------------------.| yyoverflowlab -- parser overflow comes here. |`----------------------------------------------*/yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */#endifyyreturn:#ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss);#endif return yyresult;}#line 371 "dal.y"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -