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

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

?? yref.y

?? YACC和LEX的資料書籍 以及一些源碼 很有幫助
?? 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一区二区三区免费野_久草精品视频
亚洲丝袜另类动漫二区| 久久久久九九视频| 在线影院国内精品| 99久久亚洲一区二区三区青草| 精品一区二区三区久久久| 亚洲线精品一区二区三区 | 在线看一区二区| 成人开心网精品视频| 国产在线播放一区三区四| 久久99精品久久久久久久久久久久| 日韩亚洲欧美成人一区| 欧美一区二区成人6969| 日韩一区二区免费电影| 欧美一二三区精品| 精品粉嫩aⅴ一区二区三区四区| 福利一区在线观看| 99久久综合国产精品| 色成人在线视频| 91精品国产色综合久久| 日韩一区二区三区免费观看| 欧美电视剧在线看免费| 亚洲国产高清aⅴ视频| 五月婷婷激情综合| 天天操天天干天天综合网| 久久国产精品一区二区| 本田岬高潮一区二区三区| 在线精品观看国产| 欧美mv日韩mv| 一区二区在线看| 久久99久久久欧美国产| www.欧美色图| 91精品国产综合久久精品图片| av亚洲精华国产精华精| 欧美日韩免费高清一区色橹橹| 国产在线一区二区综合免费视频| 一区二区三区四区亚洲| 久久99精品久久久| 色婷婷激情一区二区三区| 日韩无一区二区| 亚洲精品国产无天堂网2021| 久久成人羞羞网站| 欧美视频自拍偷拍| 国产精品久久久久久久久快鸭| 欧美视频中文一区二区三区在线观看| 国产精品一卡二卡| 精品视频在线视频| 中文字幕免费一区| 麻豆成人免费电影| 欧美日韩综合不卡| 国产欧美久久久精品影院| 午夜精品福利一区二区蜜股av | 日韩精品亚洲一区| 成人午夜视频在线| 日韩一区二区三区免费观看 | 天天射综合影视| 91网站最新地址| 久久久久久久久久久久久久久99| 日韩欧美一区二区三区在线| 综合久久一区二区三区| 懂色av中文一区二区三区| 精品久久人人做人人爽| 香蕉乱码成人久久天堂爱免费| 亚洲精品视频在线看| 国产精品一区二区x88av| 日韩欧美区一区二| 日韩激情在线观看| 欧美日韩专区在线| 亚洲成人一二三| 欧美三级视频在线播放| 一区二区国产盗摄色噜噜| 91一区二区三区在线播放| 国产精品美女久久久久久久| 国产精品一区二区在线观看网站| 成人免费高清视频| 欧美高清一级片在线观看| 国产精品一级黄| 日韩欧美一区二区久久婷婷| 蜜桃精品视频在线| 精品国产人成亚洲区| 精油按摩中文字幕久久| 亚洲精品在线观| 懂色av中文字幕一区二区三区| 91在线观看视频| 亚洲精品视频一区二区| 欧美日韩一区国产| 亚洲最大色网站| 6080午夜不卡| 国产麻豆视频精品| 国产精品亲子乱子伦xxxx裸| 99久久精品免费精品国产| 亚洲欧洲制服丝袜| 欧美日韩激情一区二区三区| 婷婷激情综合网| 久久综合国产精品| www.成人在线| 亚洲国产一区二区视频| 欧美久久高跟鞋激| 国产一区二区视频在线| 一区在线观看免费| 欧美美女bb生活片| 国产尤物一区二区在线| 亚洲欧美自拍偷拍色图| 欧美日韩精品一区视频| 国模套图日韩精品一区二区 | 美国十次综合导航| 精品国产污污免费网站入口| 粉嫩一区二区三区在线看| 一区二区激情小说| www激情久久| 99久久国产综合精品色伊| 日韩影院免费视频| 国产精品国产三级国产三级人妇| 日本成人在线电影网| 久久久综合视频| 日本韩国精品在线| 韩国毛片一区二区三区| 一级精品视频在线观看宜春院| 激情图片小说一区| 一区二区三区在线播放| 日韩丝袜美女视频| 欧美性猛交xxxxxx富婆| 国产不卡在线视频| 蜜桃av一区二区| 亚洲国产三级在线| 中文字幕av一区 二区| 日韩一区二区电影| 在线中文字幕一区| av在线播放成人| 国产精品一二三四五| 日本中文字幕一区二区视频| 亚洲日本乱码在线观看| 国产欧美日韩在线视频| 欧美第一区第二区| 欧美精品视频www在线观看| 99久久国产综合色|国产精品| 国产精品国产三级国产有无不卡 | 色婷婷av一区二区三区大白胸| 国产精品免费久久| 欧美成人猛片aaaaaaa| 精品视频1区2区3区| 99精品国产99久久久久久白柏| 中文字幕一区免费在线观看| 欧美一级在线视频| 欧美日韩一区二区在线观看| 91小视频在线| 91污片在线观看| 91欧美一区二区| 91色婷婷久久久久合中文| 99久久夜色精品国产网站| 成人午夜大片免费观看| 国产成人综合亚洲网站| 国产电影一区二区三区| 国产精品夜夜嗨| 国产精品一区专区| 狠狠色2019综合网| 国产精品香蕉一区二区三区| 国产乱人伦精品一区二区在线观看| 中文字幕在线观看不卡视频| 欧美极品xxx| 国产日韩欧美一区二区三区乱码| 91视频.com| 欧洲亚洲国产日韩| 制服丝袜亚洲色图| 欧美人与z0zoxxxx视频| 精品福利二区三区| 国产三级精品在线| 亚洲色欲色欲www| 亚洲国产综合91精品麻豆| 麻豆精品新av中文字幕| 国产乱码精品1区2区3区| 成人av在线网站| 欧美亚洲高清一区| 欧美一区二区三区在线视频| 久久亚洲精品小早川怜子| 国产精品久久久久久久久晋中| 91精品免费观看| 精品乱人伦一区二区三区| 亚洲精品在线观看网站| 亚洲人成伊人成综合网小说| 亚洲自拍偷拍网站| 久久99日本精品| www.av精品| 日韩免费福利电影在线观看| 国产欧美日韩久久| 五月婷婷欧美视频| 国产成人aaaa| 欧美精品自拍偷拍| 1区2区3区国产精品| 日日夜夜精品免费视频| 大尺度一区二区| 91麻豆精品国产91久久久久久| 欧美午夜精品一区二区蜜桃| 欧美成人高清电影在线| 亚洲色图欧洲色图婷婷| 久久精品国产第一区二区三区| 亚洲色图.com| 国产一区不卡视频| 欧美一区二区视频在线观看| 国产精品二三区| 青青草97国产精品免费观看无弹窗版 |