From 693574107b02340ef70b437fc2e22d5ca3b9c421 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Wed, 1 Aug 2012 22:44:33 +0100 Subject: [PATCH] V0.9: Add missing semi-colons in parser rules. Also add null actions to prevent older versions of bison failing due to type clashes, plus a few minor spelling/formatting fixes. --- parse.y | 9 ++++++--- vpi/sdf_parse.y | 10 +++++++++- vvp/parse.y | 2 ++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/parse.y b/parse.y index 7af5dde5b..fcbeccecd 100644 --- a/parse.y +++ b/parse.y @@ -839,8 +839,9 @@ config_rule_statement ; opt_config - : /* The use clause takse an optional :config. */ + : /* The use clause takes an optional :config. */ | ':' K_config + ; lib_cell_id : IDENTIFIER @@ -853,6 +854,7 @@ list_of_libraries : /* A NULL library means use the parents cell library. */ | list_of_libraries IDENTIFIER { delete[] $2; } + ; drive_strength : '(' dr_strength0 ',' dr_strength1 ')' @@ -2532,7 +2534,7 @@ automatic_opt | { $$ = false;} ; -generate_if : K_if '(' expression ')' { pform_start_generate_if(@1, $3); } +generate_if : K_if '(' expression ')' { pform_start_generate_if(@1, $3); } ; generate_case_items : generate_case_items generate_case_item @@ -3052,6 +3054,7 @@ range_opt dimensions_opt : { $$ = 0; } | dimensions { $$ = $1; } + ; dimensions : '[' expression ':' expression ']' @@ -3070,6 +3073,7 @@ dimensions tmp->push_back(index); $$ = tmp; } + ; /* This is used to express the return type of a function. */ function_range_or_type_opt @@ -4343,7 +4347,6 @@ task_port_decl_list yyerror(@2, "error: ';' is an invalid port declaration " "separator."); } - ; ; udp_body diff --git a/vpi/sdf_parse.y b/vpi/sdf_parse.y index 96514384a..630c2b74b 100644 --- a/vpi/sdf_parse.y +++ b/vpi/sdf_parse.y @@ -126,7 +126,7 @@ vendor sdf_parse_path, @2.first_line, $3); free($3); } -; + ; program_name : '(' K_PROGRAM QSTRING ')' @@ -291,11 +291,15 @@ tchk_def port_tchk : port_instance + { } /* This must only be an edge. For now we just accept everything. */ | cond_edge_start port_instance ')' + { } /* These must only be a cond. For now we just accept everything. */ | cond_edge_start timing_check_condition port_spec ')' + { } | cond_edge_start QSTRING timing_check_condition port_spec ')' + { } ; cond_edge_start @@ -316,9 +320,13 @@ cond_edge_identifier timing_check_condition : port_interconnect + { } | '~' port_interconnect + { } | '!' port_interconnect + { } | port_interconnect equality_operator scalar_constant + { } ; equality_operator diff --git a/vvp/parse.y b/vvp/parse.y index 83c263298..6b6afa152 100644 --- a/vvp/parse.y +++ b/vvp/parse.y @@ -136,6 +136,7 @@ header_line footer_lines : K_file_names T_NUMBER ';' { file_names.reserve($2); } name_strings + ; name_strings : T_STRING ';' @@ -883,6 +884,7 @@ symbol_access { $$ = vpip_make_PV($3, $5, $7); } | K_PV '<' T_SYMBOL ',' T_NUMBER T_NUMBER ',' T_NUMBER '>' { $$ = vpip_make_PV($3, $5, $6, $8); } + ; /* functor operands can only be a list of symbols. */ symbols