From: Clifford Wolf Date: Fri, 6 Jun 2014 21:05:01 +0000 (+0200) Subject: made the generate..endgenrate keywords optional X-Git-Tag: yosys-0.3.0~7 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5281562d0e9468c584e6db6f30908e3155a76ad2;p=yosys.git made the generate..endgenrate keywords optional --- diff --git a/frontends/verilog/parser.y b/frontends/verilog/parser.y index a12dcf142..42a8f91c5 100644 --- a/frontends/verilog/parser.y +++ b/frontends/verilog/parser.y @@ -373,6 +373,8 @@ range_or_integer: module_body: module_body module_body_stmt | + /* the following line makes the generate..endgenrate keywords optional */ + module_body gen_stmt | /* empty */; module_body_stmt: @@ -1013,9 +1015,12 @@ single_arg: }; module_gen_body: - module_gen_body gen_stmt | + module_gen_body gen_stmt_or_module_body_stmt | /* empty */; +gen_stmt_or_module_body_stmt: + gen_stmt | module_body_stmt; + // this production creates the obligatory if-else shift/reduce conflict gen_stmt: TOK_FOR '(' { @@ -1054,15 +1059,14 @@ gen_stmt: if ($6 != NULL) delete $6; ast_stack.pop_back(); - } | - module_body_stmt; + }; gen_stmt_block: { AstNode *node = new AstNode(AST_GENBLOCK); ast_stack.back()->children.push_back(node); ast_stack.push_back(node); - } gen_stmt { + } gen_stmt_or_module_body_stmt { ast_stack.pop_back(); };