⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 expspec_tab_cpp-source.html

📁 一个tabu search算法框架
💻 HTML
📖 第 1 页 / 共 5 页
字号:
00541     fprintf(stderr, <font class="stringliteral">"Starting parse\n"</font>);
00542 <font class="preprocessor">#endif</font>
00543 <font class="preprocessor"></font>
00544   yystate = 0;
00545   yyerrstatus = 0;
00546   yynerrs = 0;
00547   yychar = YYEMPTY;             <font class="comment">/* Cause a token to be read.  */</font>
00548 
00549   <font class="comment">/* Initialize stack pointers.</font>
00550 <font class="comment">     Waste one element of value and location stack</font>
00551 <font class="comment">     so that they stay on the same level as the state stack.</font>
00552 <font class="comment">     The wasted elements are never initialized.  */</font>
00553 
00554   yyssp = yyss - 1;
00555   yyvsp = yyvs;
00556 <font class="preprocessor">#ifdef YYLSP_NEEDED</font>
00557 <font class="preprocessor"></font>  yylsp = yyls;
00558 <font class="preprocessor">#endif</font>
00559 <font class="preprocessor"></font>
00560 <font class="comment">/* Push a new state, which is found in  yystate  .  */</font>
00561 <font class="comment">/* In all cases, when you get here, the value and location stacks</font>
00562 <font class="comment">   have just been pushed. so pushing a state here evens the stacks.  */</font>
00563 yynewstate:
00564 
00565   *++yyssp = yystate;
00566 
00567   <font class="keywordflow">if</font> (yyssp &gt;= yyss + yystacksize - 1)
00568     {
00569       <font class="comment">/* Give user a chance to reallocate the stack */</font>
00570       <font class="comment">/* Use copies of these so that the &amp;'s don't force the real ones into memory. */</font>
00571       YYSTYPE *yyvs1 = yyvs;
00572       <font class="keywordtype">short</font> *yyss1 = yyss;
00573 <font class="preprocessor">#ifdef YYLSP_NEEDED</font>
00574 <font class="preprocessor"></font>      YYLTYPE *yyls1 = yyls;
00575 <font class="preprocessor">#endif</font>
00576 <font class="preprocessor"></font>
00577       <font class="comment">/* Get the current used size of the three stacks, in elements.  */</font>
00578       <font class="keywordtype">int</font> size = yyssp - yyss + 1;
00579 
00580 <font class="preprocessor">#ifdef yyoverflow</font>
00581 <font class="preprocessor"></font>      <font class="comment">/* Each stack pointer address is followed by the size of</font>
00582 <font class="comment">         the data in use in that stack, in bytes.  */</font>
00583 <font class="preprocessor">#ifdef YYLSP_NEEDED</font>
00584 <font class="preprocessor"></font>      <font class="comment">/* This used to be a conditional around just the two extra args,</font>
00585 <font class="comment">         but that might be undefined if yyoverflow is a macro.  */</font>
00586       yyoverflow(<font class="stringliteral">"parser stack overflow"</font>,
00587                  &amp;yyss1, size * <font class="keyword">sizeof</font> (*yyssp),
00588                  &amp;yyvs1, size * <font class="keyword">sizeof</font> (*yyvsp),
00589                  &amp;yyls1, size * <font class="keyword">sizeof</font> (*yylsp),
00590                  &amp;yystacksize);
00591 <font class="preprocessor">#else</font>
00592 <font class="preprocessor"></font>      yyoverflow(<font class="stringliteral">"parser stack overflow"</font>,
00593                  &amp;yyss1, size * <font class="keyword">sizeof</font> (*yyssp),
00594                  &amp;yyvs1, size * <font class="keyword">sizeof</font> (*yyvsp),
00595                  &amp;yystacksize);
00596 <font class="preprocessor">#endif</font>
00597 <font class="preprocessor"></font>
00598       yyss = yyss1; yyvs = yyvs1;
00599 <font class="preprocessor">#ifdef YYLSP_NEEDED</font>
00600 <font class="preprocessor"></font>      yyls = yyls1;
00601 <font class="preprocessor">#endif</font>
00602 <font class="preprocessor"></font><font class="preprocessor">#else </font><font class="comment">/* no yyoverflow */</font>
00603       <font class="comment">/* Extend the stack our own way.  */</font>
00604       <font class="keywordflow">if</font> (yystacksize &gt;= YYMAXDEPTH)
00605         {
00606           yyerror(<font class="stringliteral">"parser stack overflow"</font>);
00607           <font class="keywordflow">if</font> (yyfree_stacks)
00608             {
00609               free (yyss);
00610               free (yyvs);
00611 <font class="preprocessor">#ifdef YYLSP_NEEDED</font>
00612 <font class="preprocessor"></font>              free (yyls);
00613 <font class="preprocessor">#endif</font>
00614 <font class="preprocessor"></font>            }
00615           <font class="keywordflow">return</font> 2;
00616         }
00617       yystacksize *= 2;
00618       <font class="keywordflow">if</font> (yystacksize &gt; YYMAXDEPTH)
00619         yystacksize = YYMAXDEPTH;
00620 <font class="preprocessor">#ifndef YYSTACK_USE_ALLOCA</font>
00621 <font class="preprocessor"></font>      yyfree_stacks = 1;
00622 <font class="preprocessor">#endif</font>
00623 <font class="preprocessor"></font>      yyss = (<font class="keywordtype">short</font> *) YYSTACK_ALLOC (yystacksize * <font class="keyword">sizeof</font> (*yyssp));
00624       __yy_memcpy ((<font class="keywordtype">char</font> *)yyss, (<font class="keywordtype">char</font> *)yyss1,
00625                    size * (<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font>) <font class="keyword">sizeof</font> (*yyssp));
00626       yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * <font class="keyword">sizeof</font> (*yyvsp));
00627       __yy_memcpy ((<font class="keywordtype">char</font> *)yyvs, (<font class="keywordtype">char</font> *)yyvs1,
00628                    size * (<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font>) <font class="keyword">sizeof</font> (*yyvsp));
00629 <font class="preprocessor">#ifdef YYLSP_NEEDED</font>
00630 <font class="preprocessor"></font>      yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * <font class="keyword">sizeof</font> (*yylsp));
00631       __yy_memcpy ((<font class="keywordtype">char</font> *)yyls, (<font class="keywordtype">char</font> *)yyls1,
00632                    size * (<font class="keywordtype">unsigned</font> <font class="keywordtype">int</font>) <font class="keyword">sizeof</font> (*yylsp));
00633 <font class="preprocessor">#endif</font>
00634 <font class="preprocessor"></font><font class="preprocessor">#endif </font><font class="comment">/* no yyoverflow */</font>
00635 
00636       yyssp = yyss + size - 1;
00637       yyvsp = yyvs + size - 1;
00638 <font class="preprocessor">#ifdef YYLSP_NEEDED</font>
00639 <font class="preprocessor"></font>      yylsp = yyls + size - 1;
00640 <font class="preprocessor">#endif</font>
00641 <font class="preprocessor"></font>
00642 <font class="preprocessor">#if YYDEBUG != 0</font>
00643 <font class="preprocessor"></font>      <font class="keywordflow">if</font> (yydebug)
00644         fprintf(stderr, <font class="stringliteral">"Stack size increased to %d\n"</font>, yystacksize);
00645 <font class="preprocessor">#endif</font>
00646 <font class="preprocessor"></font>
00647       <font class="keywordflow">if</font> (yyssp &gt;= yyss + yystacksize - 1)
00648         YYABORT;
00649     }
00650 
00651 <font class="preprocessor">#if YYDEBUG != 0</font>
00652 <font class="preprocessor"></font>  <font class="keywordflow">if</font> (yydebug)
00653     fprintf(stderr, <font class="stringliteral">"Entering state %d\n"</font>, yystate);
00654 <font class="preprocessor">#endif</font>
00655 <font class="preprocessor"></font>
00656   <font class="keywordflow">goto</font> yybackup;
00657  yybackup:
00658 
00659 <font class="comment">/* Do appropriate processing given the current state.  */</font>
00660 <font class="comment">/* Read a lookahead token if we need one and don't already have one.  */</font>
00661 <font class="comment">/* yyresume: */</font>
00662 
00663   <font class="comment">/* First try to decide what to do without reference to lookahead token.  */</font>
00664 
00665   yyn = yypact[yystate];
00666   <font class="keywordflow">if</font> (yyn == YYFLAG)
00667     <font class="keywordflow">goto</font> yydefault;
00668 
00669   <font class="comment">/* Not known =&gt; get a lookahead token if don't already have one.  */</font>
00670 
00671   <font class="comment">/* yychar is either YYEMPTY or YYEOF</font>
00672 <font class="comment">     or a valid token in external form.  */</font>
00673 
00674   <font class="keywordflow">if</font> (yychar == YYEMPTY)
00675     {
00676 <font class="preprocessor">#if YYDEBUG != 0</font>
00677 <font class="preprocessor"></font>      <font class="keywordflow">if</font> (yydebug)
00678         fprintf(stderr, <font class="stringliteral">"Reading a token: "</font>);
00679 <font class="preprocessor">#endif</font>
00680 <font class="preprocessor"></font>      yychar = YYLEX;
00681     }
00682 
00683   <font class="comment">/* Convert token to internal form (in yychar1) for indexing tables with */</font>
00684 
00685   <font class="keywordflow">if</font> (yychar &lt;= 0)              <font class="comment">/* This means end of input. */</font>
00686     {
00687       yychar1 = 0;
00688       yychar = YYEOF;           <font class="comment">/* Don't call YYLEX any more */</font>
00689 
00690 <font class="preprocessor">#if YYDEBUG != 0</font>
00691 <font class="preprocessor"></font>      <font class="keywordflow">if</font> (yydebug)
00692         fprintf(stderr, <font class="stringliteral">"Now at end of input.\n"</font>);
00693 <font class="preprocessor">#endif</font>
00694 <font class="preprocessor"></font>    }
00695   <font class="keywordflow">else</font>
00696     {
00697       yychar1 = YYTRANSLATE(yychar);
00698 
00699 <font class="preprocessor">#if YYDEBUG != 0</font>
00700 <font class="preprocessor"></font>      <font class="keywordflow">if</font> (yydebug)
00701         {
00702           fprintf (stderr, <font class="stringliteral">"Next token is %d (%s"</font>, yychar, yytname[yychar1]);
00703           <font class="comment">/* Give the individual parser a way to print the precise meaning</font>
00704 <font class="comment">             of a token, for further debugging info.  */</font>
00705 <font class="preprocessor">#ifdef YYPRINT</font>
00706 <font class="preprocessor"></font>          YYPRINT (stderr, yychar, yylval);
00707 <font class="preprocessor">#endif</font>
00708 <font class="preprocessor"></font>          fprintf (stderr, <font class="stringliteral">")\n"</font>);
00709         }
00710 <font class="preprocessor">#endif</font>
00711 <font class="preprocessor"></font>    }
00712 
00713   yyn += yychar1;
00714   <font class="keywordflow">if</font> (yyn &lt; 0 || yyn &gt; YYLAST || yycheck[yyn] != yychar1)
00715     <font class="keywordflow">goto</font> yydefault;
00716 
00717   yyn = yytable[yyn];
00718 
00719   <font class="comment">/* yyn is what to do for this token type in this state.</font>
00720 <font class="comment">     Negative =&gt; reduce, -yyn is rule number.</font>
00721 <font class="comment">     Positive =&gt; shift, yyn is new state.</font>
00722 <font class="comment">       New state is final state =&gt; don't bother to shift,</font>
00723 <font class="comment">       just return success.</font>
00724 <font class="comment">     0, or most negative number =&gt; error.  */</font>
00725 
00726   <font class="keywordflow">if</font> (yyn &lt; 0)
00727     {
00728       <font class="keywordflow">if</font> (yyn == YYFLAG)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -