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

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

?? yref.y

?? 編譯原理基礎
?? Y
字號:

/* YREF.Y: YREF cross reference utility, V1.1 5-1-91 AG

   This is a sample Yacc program which produces complete cross reference
   listings of Yacc source (.y) files. It is based on the same grammar
   which has actually been used to implement Yacc itself, and thus might
   also be useful for other utilities which have to parse Yacc sources.
   The lexical analyzer for this program can be found in YREFLEX.L. The
   units YRefTools and YRefTables supply the additional routines and data
   structures used by the program. To compile the program, issue the
   commands:
     yacc yref
     lex yreflex
     tpc /m yref

   The YREF program reads and parses a Yacc source file and produces
   a listing of the source file (with linenumbers), followed by a cross
   reference table of all (literal and nonterminal) identifiers used in the
   grammar, in alphabetical order. For each symbol, YREF lists the type of
   the symbol (if type tags are used), and the corresponding line numbers
   where the symbol occurs. Line numbers marked with an asterisk denote
   places where the corresponding symbol is "defined" (the lines where a
   terminal is introduced in a %token definition, or a nonterminal appears
   on the left-hand side of a rule). Symbols which do not have at least
   one defining position are listed as "undefined symbols" at the end of
   the list; this is useful to check Yacc grammars for "completeness."

   YREF does not handle syntactic errors in the source file; it is
   assumed that the input file is a syntactically correct Yacc program.
   If a syntax error is encountered, YREF simply gives an error message
   indicating the offending position, and exits with return code 1.

   The command line syntax is as follows:

   YREF yacc-file[.Y] [output-file[.REF]]

   Default extensions .Y for the input, and .REF for the output file
   are supplied automatically. If the output file name is ommitted,
   it defaults to the name of the input file with new suffix .REF.

*/

%{

{$I-}

uses YaccLib, LexLib, Dos, YRefTools, YRefTables;

procedure yyerror ( msg : String );
  begin
    writeln(msg , ' in line ', yylineno, ' at or near `', yytext, '''');
  end(*yyerror*);

var tag : Integer;       (* type tag *)
    symlineno : Integer; (* line number of last identifier *)

procedure scan ( var c : Char ); forward;
  (* scan for nonempty character, skipping comments *)

procedure skip ( delim : String ); forward;
  (* skip up to next occurrence of delim *)

procedure search ( delim : String ); forward;
  (* like skip, but retain found delimiter, and handle embedded strings *)

%}

/* Tokens of the Yacc language:

   Note the use of C_ID to distinguish identifiers which start a new rule.
   This is necessary because the parser is limited to one-symbol lookahead
   and hence could not determine whether an identifier is followed by a
   colon, starting a new rule, or is simply just another nonterminal or
   token identifier in the right-hand of a rule. Thus the lexical analyzer
   performs the necessary lookahead, and returns C_ID if the identifier is
   followed by a colon (skipping blanks and comments), and ID otherwise. */

%token
  ID		/* identifiers: {letter}{letter_or_digit}* */
  C_ID		/* identifier which forms left side of rule, i.e. is
		   followed by a colon */
  LITERAL       /* literals (strings enclosed in single or double quotes) */
  NUMBER	/* nonnegative integers: {digit}+ */
  PTOKEN PLEFT PRIGHT PNONASSOC PTYPE PSTART PPREC
  		/* reserved words: PTOKEN=%token, etc. */
  PP		/* source sections separator %% */
  LCURL		/* curly braces: %{ and %} */
  RCURL
  ',' ':' ';' '|' '{' '}' '<' '>' '='
		/* literals */

%start grammar

%%

grammar		: defs PP rules aux_procs
		;

aux_procs	: /* empty: aux_procs is optional */

		| PP { yyaccept; }

		;


defs		: /* empty */

		| defs def

		;

def		: PSTART ID

		| LCURL { search('%}'); } RCURL

		| PTOKEN tag token_list

		| PLEFT tag token_list

		| PRIGHT tag token_list

		| PNONASSOC tag token_list

		| PTYPE tag nonterm_list

                | PTYPE tag

		;

tag		: /* empty: type tag is optional */
				{ tag := 0; }
		| '<' ID '>'
                		{ tag := $2; }
		;

token_list	: token_num

		| token_list token_num

		| token_list ',' token_num

		;

token_num	: LITERAL opt_num

               	| ID
				{ add_ref($1, symlineno, true);
                                  set_type($1, tag); }
                  opt_num

		;

opt_num         : /* empty */

                | NUMBER

                ;

nonterm_list	: nonterm

		| nonterm_list nonterm

		| nonterm_list ',' nonterm

		;

nonterm		: ID
				{ add_ref($1, symlineno, false);
                                  set_type($1, tag); }
		;


rules		: rule1

		| LCURL { search('%}'); } RCURL rule1
					/* rules section may be prefixed
					   with `local' Turbo Pascal
					   declarations */
		| rules rule

		;

rule1		: C_ID
				{ add_ref($1, symlineno, true); }
		  ':' body prec

		;

rule		: rule1

		| '|' body prec

		;

body		: /* empty */

		| body LITERAL

		| body ID
				{ add_ref($2, symlineno, false); }
                | body action

		;

action		: '{' { search('}'); } '}'

		| '=' { skip(';'); }
                		/* old language feature; code must be
				   single statement ending with `;' */
		;

prec		: /* empty */

		| PPREC LITERAL opt_action

		| PPREC ID
				{ add_ref($2, symlineno, false); }
		  opt_action

		| prec ';'

		;

opt_action	: /* empty */

		| action

		;

%%

procedure scan ( var c : Char );
  label next;
  const tab = #9; nl = #10;
  begin
next:
    c := get_char;
    case c of
      ' ', tab, nl: goto next;
      '/': begin
             c := get_char;
             if c='*' then
               begin
                 skip('*/');
                 goto next;
               end
             else
               begin
                 unget_char(c);
                 unget_char('/');
                 c := '/';
               end;
           end;
      else unget_char(c);
    end;
  end(*scan*);

procedure skip ( delim : String );
  var i, j : Integer; c : Char;
  begin
    i := 1;
    while i<=length(delim) do
      begin
        c := get_char;
        if c=delim[i] then
          inc(i)
        else if c<>#0 then
          begin
            for j := i-1 downto 2 do unget_char(delim[j]);
            i := 1;
          end
        else
          exit;
      end;
  end(*skip*);

procedure search ( delim : String );
  var i, j : Integer; c : Char;
  begin
    i := 1;
    while i<=length(delim) do
      begin
        c := get_char;
        if c=delim[i] then
          inc(i)
        else if c<>#0 then
          begin
            for j := i-1 downto 2 do unget_char(delim[j]);
            i := 1;
            if c='''' then
              (* skip string *)
              skip('''');
          end
        else
          exit;
      end;
    for i := length(delim) downto 1 do
      unget_char(delim[i]);
  end(*search*);

(* Lexical analyzer: *)

{$I YRefLex}

(* Main program: *)

function addExt ( filename, ext : String ) : String;
  (* add default extension to filename *)
  var d : DirStr; n : NameStr; e : ExtStr;
  begin
    fsplit(filename, d, n, e);
    if e='' then e := '.'+ext;
    addExt := d+n+e;
  end(*addExt*);

function root ( filename : String ) : String;
  (* return filename with extension stripped off *)
  var d : DirStr; n : NameStr; e : ExtStr;
  begin
    fsplit(filename, d, n, e);
    root := d+n;
  end(*root*);

var result, lineno : Integer;
    yfile, reffile, line : String;

begin

  (* sign-on: *)

  writeln('YREF Version 1.0 [Mar 91], Copyright (c) 1991 by Albert Graef');

  (* parse command line: *)

  case paramCount of
    1 : begin
          yfile   := addExt(paramStr(1), 'y');
          reffile := root(paramStr(1))+'.ref';
        end;
    2 : begin
          yfile   := addExt(paramStr(1), 'y');
          reffile := addExt(paramStr(2), 'ref');
        end;
    else
      begin
        writeln('Usage: YREF yacc-file[.Y] [output-file[.REF]]');
        halt(0);
      end;
  end;

  (* open files: *)

  assign(yyinput,  yfile);
  assign(yyoutput, reffile);

  reset(yyinput);
  if ioresult<>0 then
    begin
      writeln('cannot open file '+yfile);
      halt(1);
    end;

  rewrite(yyoutput);
  if ioresult<>0 then
    begin
      writeln('cannot open file '+reffile);
      halt(1);
    end;

  (* produce numbered listing: *)

  lineno := 1;
  while not eof(yyinput) do
    begin
      readln(yyinput, line); 
      writeln(yyoutput, lineno:5, ':  ', line);
      inc(lineno);
    end;

  close(yyinput); reset(yyinput);

  (* parse: *)

  result := yyparse;

  (* produce cross reference listing *)

  if result=0 then ref_list;

  (* close files: *)

  close(yyinput); close(yyoutput);
  if result>0 then erase(yyoutput);

  (* terminate: *)

  if (result=0) and (n_undef>0) then
    writeln(n_undef, ' undefined symbol(s)');

  halt(result);

end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品在线观| 日韩一区中文字幕| 久久久久久久电影| 亚洲欧美偷拍卡通变态| 亚洲一区在线观看视频| 国内一区二区在线| 91免费在线看| 91精品国产手机| 中国av一区二区三区| 一区二区激情视频| 国产一区二区中文字幕| 一本大道久久a久久综合| 日韩三级精品电影久久久 | 麻豆精品久久久| heyzo一本久久综合| 欧美另类变人与禽xxxxx| 国产人妖乱国产精品人妖| 亚洲一区二区中文在线| 国产精一品亚洲二区在线视频| 欧美亚洲动漫制服丝袜| 久久久久久久综合| 亚洲一区二区三区四区在线 | 久久综合丝袜日本网| 亚洲自拍偷拍九九九| 国产在线精品一区在线观看麻豆| 色视频一区二区| 久久久久亚洲综合| 亚洲成av人片一区二区| 成人美女视频在线观看18| 欧美一区二区在线不卡| 国产精品不卡一区| 国产在线视频精品一区| 欧美日韩国产综合视频在线观看| 中文字幕电影一区| 精品系列免费在线观看| 欧美日韩在线观看一区二区| 国产精品毛片久久久久久久| 毛片不卡一区二区| 欧美三级韩国三级日本一级| 国产精品水嫩水嫩| 国内不卡的二区三区中文字幕| 在线观看日韩精品| 亚洲欧美怡红院| 国产在线播放一区| 日韩视频一区二区三区| 亚洲成人精品一区二区| 一本大道久久a久久综合婷婷| 日本一区二区综合亚洲| 国产在线视频一区二区三区| 日韩丝袜情趣美女图片| 日韩高清在线不卡| 欧美性一级生活| 亚洲码国产岛国毛片在线| 成人av网站免费| 国产午夜精品美女毛片视频| 久久国内精品视频| 91精品国产综合久久精品性色| 一区二区三区蜜桃| 91色九色蝌蚪| 亚洲黄色在线视频| 91社区在线播放| 最新国产の精品合集bt伙计| 不卡的av在线| 欧美韩日一区二区三区四区| 国产91丝袜在线18| 中文字幕欧美三区| 国产成人啪免费观看软件| 久久久久久免费网| 国产剧情一区二区三区| 日本一区二区视频在线| 成人免费视频视频在线观看免费| 国产偷v国产偷v亚洲高清| 国产一区二区在线电影| 久久先锋资源网| 国产麻豆欧美日韩一区| 久久精品视频一区二区| 国产精品99久| 国产精品色哟哟| 91在线小视频| 亚洲伦在线观看| 欧美影院一区二区三区| 亚洲丶国产丶欧美一区二区三区| 欧美日韩在线三区| 免费欧美高清视频| 亚洲精品一区在线观看| 国产盗摄一区二区| 国产精品久久久久久福利一牛影视| 99re66热这里只有精品3直播| 亚洲人成人一区二区在线观看| 一本一道久久a久久精品| 一区二区国产视频| 欧美一区二区三区四区视频| 极品尤物av久久免费看| 国产拍欧美日韩视频二区| 91蜜桃免费观看视频| 亚洲一区二区三区四区在线免费观看 | 欧美日韩成人高清| 免费美女久久99| 日本一区二区免费在线观看视频| 91在线观看污| 午夜视黄欧洲亚洲| 欧美mv和日韩mv国产网站| 成人黄色777网| 亚洲一区二区三区激情| 日韩欧美色电影| av电影在线观看一区| 五月综合激情婷婷六月色窝| 久久综合给合久久狠狠狠97色69| 成人av网站在线| 日韩 欧美一区二区三区| 久久色.com| 在线免费不卡电影| 久久国产剧场电影| 日韩毛片精品高清免费| 9191成人精品久久| 高清不卡在线观看av| 亚洲香肠在线观看| 亚洲精品一区二区三区四区高清| 国产91精品一区二区| 亚洲午夜精品17c| 久久青草欧美一区二区三区| 在线免费不卡电影| 国产成人午夜电影网| 日韩影院在线观看| 中文一区一区三区高中清不卡| 欧美日韩一区二区欧美激情| 国产精品一区二区不卡| 亚洲www啪成人一区二区麻豆| 国产欧美日韩精品在线| 5566中文字幕一区二区电影| 白白色 亚洲乱淫| 美女脱光内衣内裤视频久久影院| 亚洲女人的天堂| 久久婷婷综合激情| 欧美日韩国产a| caoporn国产一区二区| 麻豆精品新av中文字幕| 亚洲狠狠爱一区二区三区| 国产女主播在线一区二区| 日韩一区二区三区三四区视频在线观看| 不卡大黄网站免费看| 久久99久久精品| 天天综合天天综合色| 亚洲人成亚洲人成在线观看图片 | 激情综合一区二区三区| 一区二区三区不卡在线观看| 久久午夜老司机| 日韩一区二区在线观看视频| 在线观看日韩国产| 99视频超级精品| 国产一区二区三区精品视频| 天天做天天摸天天爽国产一区| 中文字幕一区二区三区在线观看| 亚洲精品一区二区精华| 欧美精品免费视频| 日本高清无吗v一区| 不卡在线视频中文字幕| 国产精品一区在线观看你懂的| 青娱乐精品视频在线| 亚洲成人资源在线| 亚洲免费观看高清完整版在线 | 91一区二区三区在线观看| 久久99国产精品尤物| 日本不卡高清视频| 日韩经典中文字幕一区| 亚洲综合久久久久| 一区二区不卡在线播放| 亚洲私人黄色宅男| 亚洲欧洲精品一区二区三区| 日本一区二区综合亚洲| 欧美激情综合五月色丁香| 国产亚洲一本大道中文在线| 2014亚洲片线观看视频免费| 91精品国产一区二区| 欧美一级黄色录像| 欧美成人高清电影在线| 日韩一区二区在线看| 日韩一区二区免费视频| 欧美一区二区三区免费观看视频| 8x8x8国产精品| 欧美高清你懂得| 日韩欧美国产系列| 精品国产亚洲在线| 久久午夜色播影院免费高清| 久久这里只有精品首页| 日韩精品一区在线| 久久久久久久久久美女| 久久久精品蜜桃| 国产精品福利av| 亚洲免费av在线| 午夜精品影院在线观看| 日韩国产精品大片| 精品一区二区成人精品| 国产精品综合视频| 成人一道本在线| 91视频在线观看| 6080日韩午夜伦伦午夜伦| 日韩一区二区免费高清| 国产视频亚洲色图| 综合在线观看色|