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

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

?? pas.y

?? YACC和LEX的資料書籍 以及一些源碼 很有幫助
?? Y
字號:

/* PAS.Y: ISO Level 0 Pascal grammar, adapted to TP Yacc 2-28-89 AG
   To compile: yacc pas
               lex paslex
               tpc pas */

%{
(*
 *
 * Pascal grammar in Yacc format, based originally on BNF given
 * in "Standard Pascal -- User Reference Manual", by Doug Cooper.
 * This in turn is the BNF given by the ANSI and ISO Pascal standards,
 * and so, is PUBLIC DOMAIN. The grammar is for ISO Level 0 Pascal.
 * The grammar has been massaged somewhat to make it LALR, and added
 * the following extensions.
 *
 * constant expressions
 * otherwise statement in a case
 * productions to correctly match else's with if's
 * beginnings of a separate compilation facility
 *
 *)

uses LexLib, YaccLib;

var filename : String;

procedure yyerror(msg : string);
  begin
    writeln(filename, ': ', yylineno, ': ',
            msg, ' at or before `', yytext, '''.')
  end(*yyerror*);

%}

/* Note the Pascal keyword tokens are stropped with leading underscore
   (e.g. _AND) in the Turbo Pascal Yacc version, because these identifiers
   will be declared as token numbers in the output file generated by Yacc,
   and hence must not collide with Turbo Pascal keywords. */

%token _AND _ARRAY ASSIGNMENT _BEGIN _CASE CHARACTER_STRING COLON COMMA _CONST DIGSEQ
%token _DIV _DO DOT DOTDOT _DOWNTO _ELSE _END EQUAL _EXTERNAL _FILE _FOR _FORWARD _FUNCTION
%token GE _GOTO GT IDENTIFIER _IF _IN _LABEL LBRAC LE LPAREN LT MINUS _MOD _NIL _NOT
%token NOTEQUAL _OF _OR _OTHERWISE _PACKED PLUS _PROCEDURE _PROGRAM RBRAC
%token REALNUMBER _RECORD _REPEAT RPAREN SEMICOLON _SET SLASH STAR STARSTAR _THEN
%token _TO _TYPE _UNTIL UPARROW _VAR _WHILE _WITH

%token ILLEGAL

%%

file : program
    | program error
	{ writeln(yylineno, ':Text follows logical end of program.'); }
    | module
    ;

program : program_heading semicolon block DOT
    ;

program_heading : _PROGRAM identifier
    | _PROGRAM identifier LPAREN identifier_list RPAREN
    ;

identifier_list : identifier_list comma identifier
    | identifier
    ;

block : label_declaration_part
    constant_definition_part
    type_definition_part
    variable_declaration_part
    procedure_and_function_declaration_part
    statement_part
    ;

module : constant_definition_part
    type_definition_part
    variable_declaration_part
    procedure_and_function_declaration_part
    ;

label_declaration_part : _LABEL label_list semicolon
    |
    ;

label_list : label_list comma label
    | label
    ;

label : DIGSEQ
    ;

constant_definition_part : _CONST constant_list
    |
    ;

constant_list : constant_list constant_definition
    | constant_definition
    ;

constant_definition : identifier EQUAL cexpression semicolon
    ;

/*constant : cexpression ;        /* good stuff! */

cexpression : csimple_expression
    | csimple_expression relop csimple_expression
    ;

csimple_expression : cterm
    | csimple_expression addop cterm
    ;

cterm : cfactor
    | cterm mulop cfactor
    ;

cfactor : sign cfactor
    | cexponentiation
    ;

cexponentiation : cprimary
    | cprimary STARSTAR cexponentiation
    ;

cprimary : identifier
    | LPAREN cexpression RPAREN
    | unsigned_constant
    | _NOT cprimary
    ;

constant : non_string
    | sign non_string
    | CHARACTER_STRING
    ;

sign : PLUS
    | MINUS
    ;

non_string : DIGSEQ
    | identifier
    | REALNUMBER
    ;

type_definition_part : _TYPE type_definition_list
    |
    ;

type_definition_list : type_definition_list type_definition
    | type_definition
    ;

type_definition : identifier EQUAL type_denoter semicolon
    ;

type_denoter : identifier
    | new_type
    ;

new_type : new_ordinal_type
    | new_structured_type
    | new_pointer_type
    ;

new_ordinal_type : enumerated_type
    | subrange_type
    ;

enumerated_type : LPAREN identifier_list RPAREN
    ;

subrange_type : constant DOTDOT constant
    ;

new_structured_type : structured_type
    | _PACKED structured_type
    ;

structured_type : array_type
    | record_type
    | set_type
    | file_type
    ;

array_type : _ARRAY LBRAC index_list RBRAC _OF component_type
    ;

index_list : index_list comma index_type
    | index_type
    ;

index_type : ordinal_type ;

ordinal_type : new_ordinal_type
    | identifier
    ;

component_type : type_denoter ;

record_type : _RECORD record_section_list _END
    | _RECORD record_section_list semicolon variant_part _END
    | _RECORD variant_part _END
    ;

record_section_list : record_section_list semicolon record_section
    | record_section
    ;

record_section : identifier_list COLON type_denoter
    ;

variant_part : _CASE variant_selector _OF variant_list semicolon
    | _CASE variant_selector _OF variant_list
    |
    ;

variant_selector : tag_field COLON tag_type
    | tag_type
    ;

variant_list : variant_list semicolon variant
    | variant
    ;

variant : case_constant_list COLON LPAREN record_section_list RPAREN
    | case_constant_list COLON LPAREN record_section_list semicolon
        variant_part RPAREN
    | case_constant_list COLON LPAREN variant_part RPAREN
    ;

case_constant_list : case_constant_list comma case_constant
    | case_constant
    ;

case_constant : constant
    | constant DOTDOT constant
    ;

tag_field : identifier ;

tag_type : identifier ;

set_type : _SET _OF base_type
    ;

base_type : ordinal_type ;

file_type : _FILE _OF component_type
    ;

new_pointer_type : UPARROW domain_type
    ;

domain_type : identifier ;

variable_declaration_part : _VAR variable_declaration_list semicolon
    |
    ;

variable_declaration_list :
      variable_declaration_list semicolon variable_declaration
    | variable_declaration
    ;

variable_declaration : identifier_list COLON type_denoter
    ;

procedure_and_function_declaration_part :
        proc_or_func_declaration_list semicolon
    |
    ;

proc_or_func_declaration_list :
      proc_or_func_declaration_list semicolon proc_or_func_declaration
    | proc_or_func_declaration
    ;

proc_or_func_declaration : procedure_declaration
    | function_declaration
    ;

procedure_declaration : procedure_heading semicolon directive
    | procedure_heading semicolon procedure_block
    ;

procedure_heading : procedure_identification
    | procedure_identification formal_parameter_list
    ;

directive : _FORWARD
    | _EXTERNAL
    ;

formal_parameter_list : LPAREN formal_parameter_section_list RPAREN ;

formal_parameter_section_list : formal_parameter_section_list semicolon
 formal_parameter_section
    | formal_parameter_section
    ;

formal_parameter_section : value_parameter_specification
    | variable_parameter_specification
    | procedural_parameter_specification
    | functional_parameter_specification
    ;

value_parameter_specification : identifier_list COLON identifier
    ;

variable_parameter_specification : _VAR identifier_list COLON identifier
    ;

procedural_parameter_specification : procedure_heading ;

functional_parameter_specification : function_heading ;

procedure_identification : _PROCEDURE identifier ;

procedure_block : block ;

function_declaration : function_heading semicolon directive
    | function_identification semicolon function_block
    | function_heading semicolon function_block
    ;

function_heading : _FUNCTION identifier COLON result_type
    | _FUNCTION identifier formal_parameter_list COLON result_type
    ;

result_type : identifier ;

function_identification : _FUNCTION identifier ;

function_block : block ;

statement_part : compound_statement ;

compound_statement : _BEGIN statement_sequence _END ;

statement_sequence : statement_sequence semicolon statement
    | statement
    | error
 { writeln('statement ignored'); yyclearin }
    ;

statement : open_statement
    | closed_statement
    ;

open_statement : label COLON non_labeled_open_statement
    | non_labeled_open_statement
    ;

closed_statement : label COLON non_labeled_closed_statement
    | non_labeled_closed_statement
    ;

non_labeled_closed_statement : assignment_statement
    | procedure_statement
    | goto_statement
    | compound_statement
    | case_statement
    | repeat_statement
    | closed_with_statement
    | closed_if_statement
    | closed_while_statement
    | closed_for_statement
    |
    ;

non_labeled_open_statement : open_with_statement
    | open_if_statement
    | open_while_statement
    | open_for_statement
    ;

repeat_statement : _REPEAT statement_sequence _UNTIL boolean_expression
    ;

open_while_statement : _WHILE boolean_expression _DO open_statement
    ;

closed_while_statement : _WHILE boolean_expression _DO closed_statement
    ;

open_for_statement : _FOR control_variable ASSIGNMENT initial_value direction
            final_value _DO open_statement
    ;

closed_for_statement : _FOR control_variable ASSIGNMENT initial_value direction
            final_value _DO closed_statement
    ;

open_with_statement : _WITH record_variable_list _DO open_statement
    ;

closed_with_statement : _WITH record_variable_list _DO closed_statement
    ;

open_if_statement : _IF boolean_expression _THEN statement
    | _IF boolean_expression _THEN closed_statement _ELSE open_statement
    ;

closed_if_statement : _IF boolean_expression _THEN closed_statement
            _ELSE closed_statement
    ;

assignment_statement : variable_access ASSIGNMENT expression
    ;

variable_access : identifier
    | indexed_variable
    | field_designator
    | variable_access UPARROW
    ;

indexed_variable : variable_access LBRAC index_expression_list RBRAC
    ;

index_expression_list : index_expression_list comma index_expression
    | index_expression
    ;

index_expression : expression ;

field_designator : variable_access DOT identifier
    ;

procedure_statement : identifier params
    | identifier
    ;

params : LPAREN actual_parameter_list RPAREN ;

actual_parameter_list : actual_parameter_list comma actual_parameter
    | actual_parameter
    ;

/*
 * this forces you to check all this to be sure that only write and
 * writeln use the 2nd and 3rd forms, you really can't do it easily in
 * the grammar, especially since write and writeln aren't reserved
 */
actual_parameter : expression
    | expression COLON expression
    | expression COLON expression COLON expression
    ;

goto_statement : _GOTO label
    ;

case_statement : _CASE case_index _OF case_list_element_list _END
    | _CASE case_index _OF case_list_element_list SEMICOLON _END
    | _CASE case_index _OF case_list_element_list semicolon
            otherwisepart statement _END
    | _CASE case_index _OF case_list_element_list semicolon
            otherwisepart statement SEMICOLON _END
    ;

case_index : expression ;

case_list_element_list : case_list_element_list semicolon case_list_element
    | case_list_element
    ;

case_list_element : case_constant_list COLON statement
    ;

otherwisepart :    _OTHERWISE
    | _OTHERWISE COLON
    ;

control_variable : identifier ;

initial_value : expression ;

direction : _TO
    | _DOWNTO
    ;

final_value : expression ;

record_variable_list : record_variable_list comma variable_access
    | variable_access
    ;

boolean_expression : expression ;

expression : simple_expression
    | simple_expression relop simple_expression
    | error
    ;

simple_expression : term
    | simple_expression addop term
    ;

term : factor
    | term mulop factor
    ;

factor : sign factor
    | exponentiation
    ;

exponentiation : primary
    | primary STARSTAR exponentiation
    ;

primary : variable_access
    | unsigned_constant
    | function_designator
    | set_constructor
    | LPAREN expression RPAREN
    | _NOT primary
    ;

unsigned_constant : unsigned_number
    | CHARACTER_STRING
    | _NIL
    ;

unsigned_number : unsigned_integer | unsigned_real ;

unsigned_integer : DIGSEQ
    ;

unsigned_real : REALNUMBER
    ;

/* functions with no params will be handled by plain identifier */
function_designator : identifier params
    ;

set_constructor : LBRAC member_designator_list RBRAC
    | LBRAC RBRAC
    ;

member_designator_list : member_designator_list comma member_designator
    | member_designator
    ;

member_designator : member_designator DOTDOT expression
    | expression
    ;

addop: PLUS
    | MINUS
    | _OR
    ;

mulop : STAR
    | SLASH
    | _DIV
    | _MOD
    | _AND
    ;

relop : EQUAL
    | NOTEQUAL
    | LT
    | GT
    | LE
    | GE
    | _IN
    ;

identifier : IDENTIFIER
    ;

semicolon : SEMICOLON
    ;

comma : COMMA
    ;

%%

{$I PASLEX}

begin
  filename := paramStr(1);
  if filename='' then
    begin
      write('input file: ');
      readln(filename);
    end;
  assign(yyinput, filename);
  reset(yyinput);
  if yyparse=0 then writeln('successful parse!');
end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲三级在线免费观看| 欧美在线观看一区| 亚洲精品一区二区三区香蕉| 琪琪久久久久日韩精品| 日韩免费电影网站| 国产一区二区三区黄视频 | 亚洲欧洲www| 成人在线视频一区| 一区二区三区鲁丝不卡| 欧美影视一区二区三区| 免费人成黄页网站在线一区二区 | 青青草国产精品97视觉盛宴| 日韩三级电影网址| 国产高清久久久| 亚洲欧美日韩中文字幕一区二区三区 | 日产国产欧美视频一区精品| 日韩欧美国产三级| 成人av资源网站| 亚洲成a人片综合在线| 日韩欧美一区二区不卡| 高清av一区二区| 依依成人综合视频| 欧美成人一区二区三区片免费| 国产精品一区二区91| 夜夜亚洲天天久久| 精品国产百合女同互慰| 91色乱码一区二区三区| 日韩国产欧美在线视频| 中文字幕免费在线观看视频一区| 色婷婷精品久久二区二区蜜臀av| 全国精品久久少妇| 亚洲色图在线视频| 日韩精品一区二| 色综合一个色综合亚洲| 久久爱www久久做| 亚洲影视资源网| 欧美国产一区视频在线观看| 制服丝袜亚洲色图| 天天影视涩香欲综合网| 国产精品免费视频网站| 日韩欧美在线123| 91久久精品一区二区三区| 国内精品伊人久久久久av影院| 自拍偷拍亚洲激情| 精品国产乱码久久久久久闺蜜| 欧美又粗又大又爽| 国产福利一区在线观看| 奇米精品一区二区三区四区| 亚洲精品老司机| 欧美激情艳妇裸体舞| 日韩欧美一二三区| 欧美肥妇bbw| 色婷婷激情综合| 国产精品一区免费视频| 日韩精品亚洲一区| 亚洲国产日韩a在线播放性色| 国产欧美视频在线观看| 欧美成人a视频| 欧美日韩和欧美的一区二区| 91美女在线观看| 成人精品在线视频观看| 国产美女一区二区三区| 久久超碰97中文字幕| 三级精品在线观看| 五月婷婷欧美视频| 夜夜揉揉日日人人青青一国产精品| 国产女同性恋一区二区| 久久久久久一级片| 亚洲精品在线三区| 精品噜噜噜噜久久久久久久久试看| 欧美精品v国产精品v日韩精品| 欧美性生活久久| 色婷婷久久久综合中文字幕| 色综合视频在线观看| 91丨九色porny丨蝌蚪| 91小视频在线| 在线观看精品一区| 欧美怡红院视频| 欧美日韩高清一区| 欧美一区二区在线免费播放| 欧美精品在线视频| 日韩视频一区二区在线观看| 日韩三级精品电影久久久| 欧美电影免费观看高清完整版在| 欧美电影免费观看完整版| 精品国产乱码久久久久久夜甘婷婷| 26uuu色噜噜精品一区| 久久夜色精品国产噜噜av| 久久欧美一区二区| 国产精品久久久久影院老司| 亚洲欧美日韩在线| 亚洲午夜在线电影| 日韩经典一区二区| 国产一区二区三区免费观看| 国产成人精品免费在线| 99久久国产综合精品女不卡| 色呦呦一区二区三区| 在线播放91灌醉迷j高跟美女| 6080yy午夜一二三区久久| 欧美sm美女调教| 欧美激情一区二区三区全黄| 综合久久久久久| 性做久久久久久免费观看欧美| 麻豆成人av在线| 成人影视亚洲图片在线| 在线日韩一区二区| 日韩欧美不卡在线观看视频| 中日韩免费视频中文字幕| 亚洲精品美腿丝袜| 免费成人在线视频观看| 成人一区二区三区在线观看| 欧美视频一区二区三区在线观看| 91精品免费在线观看| 中文字幕国产一区二区| 亚洲大片在线观看| 国产毛片精品国产一区二区三区| 91在线porny国产在线看| 欧美蜜桃一区二区三区| 久久综合资源网| 亚洲乱码国产乱码精品精的特点 | 国产在线精品一区二区夜色| 99久久综合99久久综合网站| 欧美丰满一区二区免费视频| 日本一区二区三区在线观看| 亚洲一区二区成人在线观看| 国产一本一道久久香蕉| 欧美日韩中文字幕一区| 中文字幕高清一区| 免费的成人av| 欧美亚洲综合另类| 日本一区二区电影| 欧美bbbbb| 欧美午夜电影一区| 欧美国产精品久久| 久久99精品久久只有精品| 91久久精品国产91性色tv | 日韩视频不卡中文| 亚洲黄色免费网站| 国产宾馆实践打屁股91| 日韩一区二区三区精品视频 | 欧美一区三区二区| 樱桃视频在线观看一区| 成人黄色在线看| 2017欧美狠狠色| 奇米在线7777在线精品| 欧美系列一区二区| 国产精品青草综合久久久久99| 蜜桃精品在线观看| 欧美久久高跟鞋激| 亚洲大型综合色站| 欧美丝袜丝交足nylons图片| 中文字幕一区二区三区不卡在线| 国产美女在线观看一区| 欧美成人午夜电影| 日本特黄久久久高潮| 欧美三级日韩三级国产三级| 亚洲黄色录像片| 日本精品视频一区二区三区| 亚洲婷婷在线视频| 99久久99久久精品免费观看| 国产精品午夜免费| 波多野结衣的一区二区三区| 欧美经典三级视频一区二区三区| 久草中文综合在线| 欧美xxxxx牲另类人与| 久久精品国产色蜜蜜麻豆| 日韩一区二区高清| 麻豆传媒一区二区三区| 欧美变态口味重另类| 精品一区二区免费| 精品av久久707| 国产精品亚洲成人| 日本一区二区三区四区| 成人激情开心网| 亚洲天堂av一区| 欧美视频日韩视频| 视频在线观看91| 欧美一级国产精品| 久久97超碰色| 久久精品在线免费观看| 高清久久久久久| 亚洲人成影院在线观看| 91黄色小视频| 三级不卡在线观看| 精品国产123| 成人app软件下载大全免费| 亚洲欧美色一区| 欧美二区乱c少妇| 九一九一国产精品| 中文字幕乱码亚洲精品一区| 91免费国产在线| 亚洲va韩国va欧美va精品| 欧美一二三区在线观看| 国产精品一区在线观看你懂的| 中文字幕一区不卡| 欧美日韩国产片| 国产九色sp调教91| 一区二区三区欧美日| 日韩一级二级三级| gogo大胆日本视频一区|