亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲成人高清在线| 国产一区二区中文字幕| 9i看片成人免费高清| 久久精品人人爽人人爽| 久久精品999| 日韩欧美亚洲一区二区| 免费成人你懂的| 日韩视频中午一区| 久久av中文字幕片| 精品国产伦一区二区三区观看方式| 亚洲成人第一页| 欧美疯狂性受xxxxx喷水图片| 亚洲国产日韩a在线播放性色| 91国产视频在线观看| 一卡二卡欧美日韩| 欧美日韩在线观看一区二区 | 色综合天天综合网国产成人综合天| 久久精品在线免费观看| 国产精品一二二区| 亚洲精品在线一区二区| 狠狠色狠狠色综合系列| 久久蜜桃一区二区| 日本怡春院一区二区| 欧美xxxxxxxxx| 国产高清亚洲一区| 国产精品欧美精品| 在线精品视频一区二区三四| 18欧美亚洲精品| 91久久精品国产91性色tv| 五月综合激情婷婷六月色窝| 91精品视频网| 国产大陆精品国产| 亚洲一区影音先锋| 欧美日韩久久一区| 久久国产人妖系列| 国产精品毛片a∨一区二区三区| 色综合天天综合色综合av| 亚洲九九爱视频| 欧美久久久久中文字幕| 国产综合色视频| 中文字幕在线观看一区| 欧美蜜桃一区二区三区| 精品亚洲国产成人av制服丝袜| 欧美激情中文字幕一区二区| 色婷婷国产精品综合在线观看| 麻豆专区一区二区三区四区五区| 国产精品妹子av| 精品国产91久久久久久久妲己 | 欧美精品日韩一本| 不卡的av中国片| 国内精品嫩模私拍在线| 一区二区三区日本| 国产精品无码永久免费888| 555www色欧美视频| 色噜噜狠狠成人网p站| 国产剧情一区二区三区| 美国十次了思思久久精品导航| 亚洲国产色一区| 亚洲免费观看高清完整版在线观看| 国产欧美中文在线| 久久精品这里都是精品| 精品国产乱码久久久久久久| 在线综合亚洲欧美在线视频| 欧洲精品一区二区| 大胆亚洲人体视频| 国产一区不卡视频| 精品一区二区三区在线视频| 午夜精品一区在线观看| 夜夜精品浪潮av一区二区三区| 中国色在线观看另类| 国产欧美日韩卡一| 久久久电影一区二区三区| 26uuu精品一区二区在线观看| 日韩欧美的一区二区| 欧美大片免费久久精品三p| 69堂成人精品免费视频| 91精品国产综合久久蜜臀| 91精品国产麻豆| 欧美日韩高清不卡| 欧美精品一二三| 欧美日韩的一区二区| 欧美日产国产精品| 在线播放国产精品二区一二区四区| 欧美日韩一区二区三区高清| 欧美日韩国产在线观看| 欧美一区二区三区四区视频| 69精品人人人人| 欧美成人精品1314www| 一本到高清视频免费精品| 天天av天天翘天天综合网色鬼国产| 亚洲欧美偷拍另类a∨色屁股| 亚洲国产成人午夜在线一区| 日韩伦理av电影| 亚洲aaa精品| 老司机午夜精品99久久| 国产成人自拍在线| av激情综合网| 欧美日韩美少妇| 精品久久久久久久久久久久包黑料 | 视频一区欧美日韩| 日本中文一区二区三区| 久久国内精品视频| 粉嫩久久99精品久久久久久夜 | 久久99精品一区二区三区三区| 韩国成人福利片在线播放| 国产99久久久精品| 色系网站成人免费| 91精品福利在线一区二区三区 | 国产精品久久久久婷婷| 亚洲精品欧美二区三区中文字幕| 亚洲成av人片一区二区三区| 看电影不卡的网站| 97久久精品人人爽人人爽蜜臀 | 麻豆久久一区二区| 成人免费观看男女羞羞视频| 欧美色综合久久| 2023国产精品视频| 洋洋成人永久网站入口| 久久国产人妖系列| 91在线观看地址| 精品久久久久久久久久久院品网| 国产精品国产馆在线真实露脸 | 怡红院av一区二区三区| 七七婷婷婷婷精品国产| 国产盗摄一区二区| 欧美日韩一本到| 亚洲国产成人午夜在线一区| 日韩中文字幕一区二区三区| 国产99精品国产| 欧美一区二区网站| 亚洲欧美国产三级| 国产一区免费电影| 欧美另类一区二区三区| 国产精品第四页| 国内精品免费在线观看| 欧美日韩免费一区二区三区视频 | 欧美精品一区二区三区蜜桃| 亚洲精品写真福利| 韩国女主播一区二区三区| 精品污污网站免费看| 国产精品久久久一本精品| 精品在线亚洲视频| 欧美日韩成人综合在线一区二区| 亚洲欧洲精品一区二区三区不卡| 久久电影网站中文字幕| 欧美日韩国产经典色站一区二区三区| 国产精品丝袜91| 国产大陆亚洲精品国产| 精品国产自在久精品国产| 无吗不卡中文字幕| 欧美三级三级三级爽爽爽| 中文字幕在线不卡| 成人一区在线观看| 国产日韩综合av| 精品在线播放免费| 91精品国产乱码| 日韩国产欧美在线播放| 在线看国产日韩| 一区二区三区.www| 欧洲亚洲精品在线| 一区二区三区在线观看欧美| 99久久精品国产麻豆演员表| 国产精品动漫网站| aaa亚洲精品| 亚洲欧洲无码一区二区三区| 懂色一区二区三区免费观看| 中文字幕精品一区| 成人免费av在线| 国产精品福利电影一区二区三区四区| 国产高清精品在线| 国产精品色一区二区三区| 国产suv精品一区二区883| 欧美精品一区二区三区视频| 国产乱码精品一区二区三区忘忧草| 337p日本欧洲亚洲大胆精品| 国产成人免费视频精品含羞草妖精| 久久久亚洲精品石原莉奈 | 久久精品国产在热久久| 日韩一级片在线观看| 精油按摩中文字幕久久| 国产网站一区二区三区| 国产成人av资源| 国产精品国产三级国产aⅴ原创| 成人97人人超碰人人99| 亚洲久草在线视频| 制服丝袜国产精品| 久久99精品视频| 中文字幕国产精品一区二区| 91香蕉视频污| 婷婷综合在线观看| 久久精品在这里| 欧美午夜在线一二页| 久久精品国产99久久6| 中文字幕久久午夜不卡| 欧洲精品视频在线观看| 捆绑变态av一区二区三区| 国产精品国产馆在线真实露脸 | 九九精品一区二区| 国产精品传媒入口麻豆| 欧美一区二区三区四区高清|