aboutsummaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2016-03-15 12:22:31 +0100
committerClifford Wolf <clifford@clifford.at>2016-03-15 12:22:31 +0100
commit33c10350b22a8cc943cf3c294ee86969c5ce97f4 (patch)
treec220eae5a94d444fc5d7fd74d190fd1ab47f8b51 /frontends
parent81d4e9e7c1c311f837dadb1634c83b4e70929669 (diff)
downloadyosys-33c10350b22a8cc943cf3c294ee86969c5ce97f4.tar.gz
yosys-33c10350b22a8cc943cf3c294ee86969c5ce97f4.tar.bz2
yosys-33c10350b22a8cc943cf3c294ee86969c5ce97f4.zip
Fixed Verilog parser fix and more similar improvements
Diffstat (limited to 'frontends')
-rw-r--r--frontends/verilog/verilog_parser.y27
1 files changed, 9 insertions, 18 deletions
diff --git a/frontends/verilog/verilog_parser.y b/frontends/verilog/verilog_parser.y
index 7849757ec..568cadd94 100644
--- a/frontends/verilog/verilog_parser.y
+++ b/frontends/verilog/verilog_parser.y
@@ -246,11 +246,10 @@ module_para_opt:
'#' '(' { astbuf1 = nullptr; } module_para_list { if (astbuf1) delete astbuf1; } ')' | /* empty */;
module_para_list:
- single_module_para |
- single_module_para ',' module_para_list |
- /* empty */;
+ single_module_para | module_para_list ',' single_module_para;
single_module_para:
+ /* empty */ |
TOK_PARAMETER {
if (astbuf1) delete astbuf1;
astbuf1 = new AstNode(AST_PARAMETER);
@@ -801,14 +800,14 @@ single_cell:
astbuf2->str = *$1;
delete $1;
ast_stack.back()->children.push_back(astbuf2);
- } '(' cell_port_list_opt ')' |
+ } '(' cell_port_list ')' |
TOK_ID non_opt_range {
astbuf2 = astbuf1->clone();
if (astbuf2->type != AST_PRIMITIVE)
astbuf2->str = *$1;
delete $1;
ast_stack.back()->children.push_back(new AstNode(AST_CELLARRAY, $2, astbuf2));
- } '(' cell_port_list_opt ')';
+ } '(' cell_port_list ')';
prim_list:
single_prim |
@@ -819,16 +818,16 @@ single_prim:
/* no name */ {
astbuf2 = astbuf1->clone();
ast_stack.back()->children.push_back(astbuf2);
- } '(' cell_port_list_opt ')';
+ } '(' cell_port_list ')';
cell_parameter_list_opt:
'#' '(' cell_parameter_list ')' | /* empty */;
cell_parameter_list:
- /* empty */ | cell_parameter |
- cell_parameter ',' cell_parameter_list;
+ cell_parameter | cell_parameter_list ',' cell_parameter;
cell_parameter:
+ /* empty */ |
expr {
AstNode *node = new AstNode(AST_PARASET);
astbuf1->children.push_back(node);
@@ -842,19 +841,11 @@ cell_parameter:
delete $2;
};
-cell_port_list_opt:
- /* empty */ |
- cell_port_list |
- /* empty */ ',' {
- AstNode *node = new AstNode(AST_ARGUMENT);
- astbuf2->children.push_back(node);
- } cell_port_list;
-
cell_port_list:
- cell_port |
- cell_port_list ',' cell_port;
+ cell_port | cell_port_list ',' cell_port;
cell_port:
+ /* empty */ |
expr {
AstNode *node = new AstNode(AST_ARGUMENT);
astbuf2->children.push_back(node);