📄 ce_parse.cpp
字号:
case 3:{ bool c = (yyvsp[-4].isInt() ? ((long)yyvsp[-4] != 0) : ((double)yyvsp[-4] != 0.0)); yyval = c ? yyvsp[-2] : yyvsp[0]; ; break;}case 4:{ yyval = yyvsp[0]; ; break;}case 5:{ yyval = CPPValue( (long)((long)yyvsp[-2] || (long)yyvsp[0]) ); ; break;}case 6:{ yyval = yyvsp[0]; ; break;}case 7:{ yyval = CPPValue( (long)((long)yyvsp[-2] && (long)yyvsp[0]) ); ; break;}case 8:{ yyval = yyvsp[0]; ; break;}case 9:{ yyval = CPPValue( (long)yyvsp[-2] | (long)yyvsp[0] ); ; break;}case 10:{ yyval = yyvsp[0]; ; break;}case 11:{ yyval = CPPValue( (long)yyvsp[-2] ^ (long)yyvsp[0] ); ; break;}case 12:{ yyval = yyvsp[0]; ; break;}case 13:{ yyval = CPPValue( (long)yyvsp[-2] & (long)yyvsp[0] ); ; break;}case 14:{ yyval = yyvsp[0]; ; break;}case 15:{ yyval = CPPValue( (long)((double)yyvsp[-2] == (double)yyvsp[0]) ); ; break;}case 16:{ yyval = CPPValue( (long)((double)yyvsp[-2] != (double)yyvsp[0]) ); ; break;}case 17:{ yyval = yyvsp[0]; ; break;}case 18:{ yyval = CPPValue( (long)((double)yyvsp[-2] < (double)yyvsp[0]) ); ; break;}case 19:{ yyval = CPPValue( (long)((double)yyvsp[-2] > (double)yyvsp[0]) ); ; break;}case 20:{ yyval = CPPValue( (long)((double)yyvsp[-2] <= (double)yyvsp[0]) ); ; break;}case 21:{ yyval = CPPValue( (long)((double)yyvsp[-2] >= (double)yyvsp[0]) ); ; break;}case 22:{ yyval = yyvsp[0]; ; break;}case 23:{ yyval = CPPValue( (long)yyvsp[-2] << (long)yyvsp[0] ); ; break;}case 24:{ yyval = CPPValue( (long)yyvsp[-2] >> (long)yyvsp[0] ); ; break;}case 25:{ yyval = yyvsp[0]; ; break;}case 26:{ if (!yyvsp[-2].isInt() || !yyvsp[0].isInt()) { yyval = CPPValue( (double)yyvsp[-2] + (double)yyvsp[0] ); } else { yyval = CPPValue( (long)yyvsp[-2] + (long)yyvsp[0] ); } ; break;}case 27:{ if (!yyvsp[-2].isInt() || !yyvsp[0].isInt()) { yyval = CPPValue( (double)yyvsp[-2] - (double)yyvsp[0] ); } else { yyval = CPPValue( (long)yyvsp[-2] - (long)yyvsp[0] ); } ; break;}case 28:{ yyval = yyvsp[0]; ; break;}case 29:{ if (!yyvsp[-2].isInt() || !yyvsp[0].isInt()) { yyval = CPPValue( (double)yyvsp[-2] * (double)yyvsp[0] ); } else { yyval = CPPValue( (long)yyvsp[-2] * (long)yyvsp[0] ); } ; break;}case 30:{ if (!yyvsp[-2].isInt() || !yyvsp[0].isInt()) { yyval = CPPValue( (double)yyvsp[-2] / (double)yyvsp[0] ); } else { long value = yyvsp[0]; if (value==0) value=1; yyval = CPPValue( (long)yyvsp[-2] / value ); } ; break;}case 31:{ long value = yyvsp[0]; if (value==0) value=1; yyval = CPPValue( (long)yyvsp[-2] % value ); ; break;}case 32:{ yyval = yyvsp[0]; ; break;}case 33:{ yyval = yyvsp[-1]; ; break;}case 34:{ if (yyvsp[0].isInt()) yyval = CPPValue(-(long)yyvsp[0]); else yyval = CPPValue(-(double)yyvsp[0]); ; break;}case 35:{ yyval = CPPValue(~(long)yyvsp[0]); ; break;}case 36:{ yyval = CPPValue((long)!(long)yyvsp[0]); ; break;}case 37:{ yyval = yyvsp[0]; ; break;}case 38:{ yyval = yyvsp[-1]; ; break;}case 39:{ yyval = parseOctal(); ; break;}case 40:{ yyval = parseDecimal(); ; break;}case 41:{ yyval = parseHexadecimal(); ; break;}case 42:{ yyval = parseCharacter(); ; break;}case 43:{ yyval = parseFloat(); ; break;}} yyvsp -= yylen; yyssp -= yylen;#if YYLSP_NEEDED yylsp -= yylen;#endif#if YYDEBUG if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); }#endif *++yyvsp = yyval;#if YYLSP_NEEDED *++yylsp = yyloc;#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 |`------------------------------------*/yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++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 < (int) (sizeof (yytname) / sizeof (char *)); x++) if (yycheck[x + yyn] == x) size += strlen (yytname[x]) + 15, count++; size += strlen ("parse error, unexpected `") + 1; size += strlen (yytname[YYTRANSLATE (yychar)]); msg = (char *) malloc (size); if (msg != 0) { strcpy (msg, "parse error, unexpected `"); strcat (msg, yytname[YYTRANSLATE (yychar)]); strcat (msg, "'"); if (count < 5) { count = 0; for (x = (yyn < 0 ? -yyn : 0); x < (int) (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 -- error raised explicitly by an action |`--------------------------------------------------*/yyerrlab1: 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; YYDPRINTF ((stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1])); 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. |`-------------------------------------------------------------------*/yyerrdefault:#if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ /* If its default is to accept any token, ok. Otherwise pop it. */ yyn = yydefact[yystate]; if (yyn) goto yydefault;#endif/*---------------------------------------------------------------.| yyerrpop -- pop the current state because it cannot handle the || error token |`---------------------------------------------------------------*/yyerrpop: if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp;#if YYLSP_NEEDED yylsp--;#endif#if YYDEBUG if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "Error: state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); }#endif/*--------------.| yyerrhandle. |`--------------*/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; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval;#if YYLSP_NEEDED *++yylsp = yylloc;#endif yystate = yyn; goto yynewstate;/*-------------------------------------.| yyacceptlab -- YYACCEPT comes here. |`-------------------------------------*/yyacceptlab: if (yyfree_stacks) { free (yyss); free (yyvs);#if YYLSP_NEEDED free (yyls);#endif } return 0;/*-----------------------------------.| yyabortlab -- YYABORT comes here. |`-----------------------------------*/yyabortlab: if (yyfree_stacks) { free (yyss); free (yyvs);#if YYLSP_NEEDED free (yyls);#endif } return 1;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -