summaryrefslogtreecommitdiff
path: root/frontends/verilog/parser.y
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-06-13 11:18:45 +0200
committerClifford Wolf <clifford@clifford.at>2013-06-13 11:18:45 +0200
commit0c6ffc4c656de69c92727580cd4c192211d10e6d (patch)
tree9ad133c4d71f687f1046692e1a80481d3d114a89 /frontends/verilog/parser.y
parentb1d39aa8656f8440eb748fbc7b5673d2129a2308 (diff)
More fixes for bugs found using xsthammer
Diffstat (limited to 'frontends/verilog/parser.y')
-rw-r--r--frontends/verilog/parser.y14
1 files changed, 12 insertions, 2 deletions
diff --git a/frontends/verilog/parser.y b/frontends/verilog/parser.y
index ea39e83d..68ac26bf 100644
--- a/frontends/verilog/parser.y
+++ b/frontends/verilog/parser.y
@@ -113,9 +113,9 @@ static void free_attr(std::map<std::string, AstNode*> *al)
// operator precedence from low to high
%left OP_LOR
%left OP_LAND
-%left '|'
+%left '|' OP_NOR
%left '^' OP_XNOR
-%left '&'
+%left '&' OP_NAND
%left OP_EQ OP_NE
%left '<' OP_LE OP_GE '>'
%left OP_SHL OP_SHR OP_SSHL OP_SSHR
@@ -982,10 +982,20 @@ basic_expr:
$$ = new AstNode(AST_REDUCE_AND, $3);
append_attr($$, $2);
} |
+ OP_NAND attr basic_expr %prec UNARY_OPS {
+ $$ = new AstNode(AST_REDUCE_AND, $3);
+ append_attr($$, $2);
+ $$ = new AstNode(AST_LOGIC_NOT, $$);
+ } |
'|' attr basic_expr %prec UNARY_OPS {
$$ = new AstNode(AST_REDUCE_OR, $3);
append_attr($$, $2);
} |
+ OP_NOR attr basic_expr %prec UNARY_OPS {
+ $$ = new AstNode(AST_REDUCE_OR, $3);
+ append_attr($$, $2);
+ $$ = new AstNode(AST_LOGIC_NOT, $$);
+ } |
'^' attr basic_expr %prec UNARY_OPS {
$$ = new AstNode(AST_REDUCE_XOR, $3);
append_attr($$, $2);