亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? yacclook.pas

?? Compiler generator toolset for Turbo/Borland/Free Pascal and Delphi
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
{
  Yacc lookahead computation. This implementation is based on the
  lookahead set algorithm described in Aho/Sethi/Ullman, 1986,
  Section 4.7.


  Copyright (c) 1990-92  Albert Graef <ag@muwiinfa.geschichte.uni-mainz.de>
  Copyright (C) 1996     Berend de Boer <berend@pobox.com>

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


$Revision: 2 $
$Modtime: 96-07-31 14:09 $

$History: YACCLOOK.PAS $
 * 
 * *****************  Version 2  *****************
 * User: Berend       Date: 96-10-10   Time: 21:16
 * Updated in $/Lex and Yacc/tply
 * Updated for protected mode, windows and Delphi 1.X and 2.X.

}


unit YaccLook;

interface


procedure lookaheads;
  (* computes the LALR lookahead sets and enters corresponding reductions
     into the redn table (sorted w.r.t. rule numbers) *)

implementation

uses YaccBase, YaccTabl,sysutils;

(* This implementation is based on algorithms 4.12 and 4.13 in Aho/Sethi/
   Ullman 1986 (with some optimizations added), which avoid the need to
   construct the full LR(1) set, and are able to compute lookaheads from
   LR(0) kernel items only.

   We start off with the LR(0) state set together with corresponding (shift
   and goto) transitions already computed. We compute the LALR(1) lookahead
   sets for kernel items and also record all corresponding reduce actions
   in the reduction table (where we also have to consider nonkernel items
   with empty right-hand side; these items also call for a reduction, but
   never appear in the kernel item table).

   This implementation uses some simple optimizations to speed up the
   algorithm. The lookahead sets are represented by (IntSet) pointers.
   Lookahead sets are associated with each kernel item in the item table,
   and with each reduction in the reduction table. A kernel item
   calling for a reduction shares its lookahead set pointer with the
   corresponding entry in the reduction table. The lookahead set for
   a nonkernel reduction item (item with empty right-hand side) only
   appears in the reduction table.

   The algorithm consists of two phases:

   1. Initialization:

      The initialization phase consists of a single traversal of the LR(0)
      set, where we compute lookahead sets generated spontaneously (lookaheads
      which are passed on from nonkernel items to the corresponding items in
      successor states), initialize lookahead sets and enter them into the
      lookahead and reduction table. Furthermore, during the initialization
      phase we also initialize the links for the propagation of lookaheads
      in the second phase.

      To determine lookaheads and propagation links, we compute the look-
      aheads for the closures of single LR(0) sets "in the small", according
      to the method in Aho/Sethi/Ullman 1986 (with some modifications),
      where we associate with each kernel item i a corresponding endmarker
      symbol #i as its lookahead symbol.

      The initialization phase proceeds as follows:

      1) Initialize all nonkernel item lookahead sets to empty.

      Now we pass over each state s in the LR0 set, repeating steps 2) thru
      5) specified below:

      2) Compute the closure closure(K(s)) of the states's kernel set K(s).

      3) Compute the lookahead sets for closure(K(s)) (described in detail
         below) where each kernel item i is associated with a special
         endmarker symbol #i as lookahead.

      Now the lookahead symbols, reductions and propagation links are entered
      into the corresponding tables as follows:

      4) Process kernel items: Add a propagation link from the kernel item
         to the lookahead set of the linked item in the corresponding
         successor state (as specified by the next field). If there is no
         successor item (kernel item calling for a reduction), add a
         corresponding entry into the reduction table instead.

      5) Process nonkernel items: find the corresponding kernel item in the
         successor state which is generated spontaneously from the nonkernel
         item. Add the spontaneous lookahead symbols (except endmarker
         symbols) of the nonkernel item determined in step 3) to the kernel
         item. If the nonkernel item has an empty right-hand side (nonkernel
         item calling for a reduction), add a corresponding entry into the
         reduction table instead. Furthermore, for each endmarker symbol
         #i in the spontaneous lookahead set of the nonkernel item, add
         a corresponding propagation link from the ith kernel item to the
         lookahead set of the spontaneous kernel item.

      To compute the spontaneous lookaheads (step 3)), we proceed as follows:

      3a) First compute the first sets of tail strings of all items in
          closure(K(s)). The "tail string" of an item [ X -> v.Yw ], where
          Y is a nonterminal, is the symbol sequence w, whose first set
          induces corresponding spontaneous lookaheads in the nonkernel
          items of the state with left-hand side Y; note that the first
          sets of "tail strings" in items [ X -> v.yw ], where y is a
          *terminal* symbol, are not required and hence it is not
          necessary to compute them. We also record for each item whether
          its tail string is "nullable", i.e., may be derived to the empty
          string. In this case, the item also passes on its own lookaheads,
          in addition to the first symbols of its tail string. First sets
          and nullable flags are computed using the information in YaccTable's
          first and nullable tables.

      3b) Now follows an initialization part in which each item [ X -> v.Yw ]
          passes on the first symbols of its tail string to the lookahead
          sets of each corresponding nonkernel item [ Y -> .u ].

      3c) Finally, we repeatedly pass over the item set, passing on
          lookaheads from items with nullable tail strings. Each item
          [ X -> v.Yw ] with nullable w propagates its own lookaheads to
          all corresponding nonkernel items [ Y -> .u]. Step 3c) terminates
          as soon as no lookahead sets have been modified during the previous
          pass.

   2. Propagation:

      The second phase of the lookahead computation algorithm now is quite
      simple. We repeatedly pass over all kernel items, propagating lookaheads
      according to the propagation links determined in the initialization
      phase. The algorithm terminates as soon as no lookahead sets have been
      modified during the previous pass. *)

(* Data structures used in lookahead computation: *)
 
type

SymSetArray = array [1..max_set_items] of IntSet;
BoolArray   = array [1..max_set_items] of Boolean;

var

item_set       : ItemSet;
lookahead_set  : SymSetArray;
n_kernel_items : Integer;
      first_syms : SymSetArray;
      nullable : BoolArray;

procedure spontaneous_lookaheads;

  (* compute spontaneous lookaheads for item_set; negative symbols are
     used for endmarkers (-i denotes endmarker #i) *)

  var count, last_count, i : Integer;

  function sym_count ( n : Integer ) : Integer;
    (* count lookahead symbols *)
    var count, i : Integer;
    begin
      count := 0;
      for i := 1 to n do
        inc(count, size(lookahead_set[i]));
      sym_count := count;
    end(*sym_count*);

  procedure compute_first_syms ( i : Integer );
    (* compute first set and nullable flag for tail string of item
       number i *)
    var j : Integer;
    begin
      empty(first_syms[i]); nullable[i] := true;
      with item_set, item[i], rule_table^[rule_no]^ do
        if (pos_no<=rhs_len) and (rhs_sym[pos_no]<0) then
          begin
            j := pos_no+1;
            while (j<=rhs_len) and nullable[i] do
              begin
                if rhs_sym[j]<0 then
                  begin
                    setunion(first_syms[i], first_set_table^[-rhs_sym[j]]^);
                    nullable[i] := YaccTabl.nullable^[-rhs_sym[j]];
                  end
                else
                  begin
                    include(first_syms[i], rhs_sym[j]);
                    nullable[i] := false;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产一区二区在线播放| 亚洲精品伦理在线| 欧美日韩国产中文| 色视频成人在线观看免| av亚洲精华国产精华| av不卡免费电影| 91视频观看视频| 色综合久久久久综合体桃花网| 成人免费高清在线| 91网站在线观看视频| 91视频免费播放| 欧美日韩国产一二三| 日韩一区二区三区四区| 日韩亚洲欧美在线| 欧美国产禁国产网站cc| 亚洲欧美一区二区视频| 一区二区三区91| 人人狠狠综合久久亚洲| 国产一区 二区 三区一级| 波多野结衣视频一区| 在线观看国产一区二区| 欧美精品在线观看播放| 精品粉嫩aⅴ一区二区三区四区 | 亚洲精品午夜久久久| 一区二区三区中文字幕| 麻豆91在线播放| 不卡在线视频中文字幕| 7777精品久久久大香线蕉| 精品国产一区二区三区不卡| 国产精品久久毛片| 视频一区中文字幕国产| 成人国产一区二区三区精品| 欧美色图第一页| 国产调教视频一区| 日韩高清一区二区| 成人精品视频网站| 欧美一区二区三区播放老司机| 欧美极品aⅴ影院| 日韩精品一级中文字幕精品视频免费观看| 极品尤物av久久免费看| 91亚洲国产成人精品一区二三| 日韩一区二区在线免费观看| 亚洲女子a中天字幕| 韩国成人福利片在线播放| 欧美日韩国产一区二区三区地区| 国产欧美一区二区精品性色 | 亚洲一区自拍偷拍| 国产高清不卡一区二区| 欧美一区二区三区小说| 亚洲欧洲精品一区二区精品久久久| 美女视频黄免费的久久| 日本韩国欧美国产| 中文字幕免费观看一区| 国内偷窥港台综合视频在线播放| 欧美日韩免费观看一区二区三区| 中文字幕精品综合| 国产一区二区不卡在线| 欧美一区二区视频网站| 亚洲午夜电影在线| 色香蕉成人二区免费| 成人欧美一区二区三区小说| 大陆成人av片| 国产日产精品1区| 国产乱码字幕精品高清av| 欧美一区二区三区播放老司机| 亚洲gay无套男同| 色综合av在线| 亚洲精品videosex极品| 91浏览器打开| 亚洲精品国产第一综合99久久| 99久久国产综合色|国产精品| 欧美激情在线看| 成熟亚洲日本毛茸茸凸凹| 国产色婷婷亚洲99精品小说| 国产精品1区2区3区在线观看| 26uuu精品一区二区| 国产精品中文字幕一区二区三区| 精品成人一区二区三区| 国产精品888| 国产精品麻豆网站| 91一区二区在线| 亚洲一区二区三区四区五区黄 | 99精品欧美一区二区三区小说 | 亚洲综合色丁香婷婷六月图片| 色久综合一二码| 婷婷久久综合九色综合绿巨人 | 五月天激情综合| 欧美精品第1页| 看电视剧不卡顿的网站| 久久精品一区二区三区不卡牛牛| 福利电影一区二区| 亚洲精品久久久久久国产精华液| 欧美日韩在线观看一区二区 | 国产成人精品免费网站| 国产精品久久久久7777按摩| 在线免费一区三区| 蜜桃在线一区二区三区| 欧美激情综合在线| 欧美日韩一区久久| 国产美女精品人人做人人爽| 国产精品久久久久aaaa| 5858s免费视频成人| 国产精品77777竹菊影视小说| 亚洲激情图片qvod| 欧美videofree性高清杂交| 成人免费高清视频在线观看| 亚洲成人你懂的| 国产农村妇女毛片精品久久麻豆 | 欧洲国内综合视频| 久久97超碰国产精品超碰| 国产精品久久久久国产精品日日| 欧美在线制服丝袜| 国产一区在线看| 偷拍一区二区三区四区| 欧美激情一区二区在线| 欧美精三区欧美精三区| aaa亚洲精品| 国精品**一区二区三区在线蜜桃| 亚洲三级在线免费观看| 久久这里只有精品视频网| 欧洲视频一区二区| 国产999精品久久久久久绿帽| 爽好多水快深点欧美视频| 国产精品激情偷乱一区二区∴| 欧美一二三区在线| 欧美亚洲一区二区三区四区| 国产成人免费在线观看不卡| 麻豆91精品视频| 天天综合网天天综合色| 一区二区三区在线视频观看58| 国产欧美在线观看一区| 日韩视频在线你懂得| 欧美午夜寂寞影院| 色欲综合视频天天天| 成人h精品动漫一区二区三区| 日韩精品一二区| 五月天国产精品| 视频一区二区欧美| 亚洲国产视频a| 亚洲一区二区欧美日韩| 亚洲精品自拍动漫在线| 亚洲欧美日本韩国| 亚洲色图.com| 椎名由奈av一区二区三区| 中文字幕一区二区三区视频| 国产精品久久久久7777按摩| 亚洲国产精品成人综合色在线婷婷| 久久久亚洲精品石原莉奈| 精品少妇一区二区| 精品日韩一区二区三区| 亚洲精品一区二区三区香蕉| 欧美一区二区三区免费大片 | 日韩欧美一区二区视频| 欧美精品在线一区二区| 91麻豆精品国产91久久久更新时间 | 成人18精品视频| 99久久99久久精品免费看蜜桃| av电影在线观看不卡| 暴力调教一区二区三区| 色婷婷综合久久久| 欧美日韩免费观看一区三区| 欧美精品日日鲁夜夜添| 日韩亚洲欧美在线观看| 国产日韩欧美制服另类| 久久精品亚洲麻豆av一区二区| 国产精品久久午夜| 一个色在线综合| 六月婷婷色综合| 丁香天五香天堂综合| 91福利资源站| 精品久久国产97色综合| 国产无人区一区二区三区| 亚洲人妖av一区二区| 五月天一区二区三区| 国产麻豆精品视频| 色综合天天综合网天天看片| 欧美日韩国产系列| 久久精品夜色噜噜亚洲aⅴ| 亚洲精品视频在线观看免费| 轻轻草成人在线| 白白色亚洲国产精品| 欧美日韩激情一区二区| 久久久久久久电影| 午夜私人影院久久久久| 成人综合婷婷国产精品久久 | 色综合 综合色| 精品日产卡一卡二卡麻豆| 国产精品久久久久久久裸模| 图片区小说区区亚洲影院| 国产a视频精品免费观看| 欧美亚洲国产bt| 欧美激情在线免费观看| 午夜精品视频在线观看| 成人免费毛片嘿嘿连载视频| 欧美日韩国产天堂| 亚洲图片另类小说| 国产在线播放一区二区三区| 欧美美女黄视频| 亚洲人成精品久久久久| 狠狠色丁香婷婷综合久久片|