verilog: also set location for simple_behavioral_stmt

This commit is contained in:
Eddie Hung 2020-03-10 10:29:24 -07:00
parent da8270aa01
commit 2d63bf5877
1 changed files with 4 additions and 0 deletions

View File

@ -2113,18 +2113,22 @@ simple_behavioral_stmt:
lvalue '=' delay expr { lvalue '=' delay expr {
AstNode *node = new AstNode(AST_ASSIGN_EQ, $1, $4); AstNode *node = new AstNode(AST_ASSIGN_EQ, $1, $4);
ast_stack.back()->children.push_back(node); ast_stack.back()->children.push_back(node);
SET_AST_NODE_LOC(node, @1, @4);
} | } |
lvalue TOK_INCREMENT { lvalue TOK_INCREMENT {
AstNode *node = new AstNode(AST_ASSIGN_EQ, $1, new AstNode(AST_ADD, $1->clone(), AstNode::mkconst_int(1, true))); AstNode *node = new AstNode(AST_ASSIGN_EQ, $1, new AstNode(AST_ADD, $1->clone(), AstNode::mkconst_int(1, true)));
ast_stack.back()->children.push_back(node); ast_stack.back()->children.push_back(node);
SET_AST_NODE_LOC(node, @1, @2);
} | } |
lvalue TOK_DECREMENT { lvalue TOK_DECREMENT {
AstNode *node = new AstNode(AST_ASSIGN_EQ, $1, new AstNode(AST_SUB, $1->clone(), AstNode::mkconst_int(1, true))); AstNode *node = new AstNode(AST_ASSIGN_EQ, $1, new AstNode(AST_SUB, $1->clone(), AstNode::mkconst_int(1, true)));
ast_stack.back()->children.push_back(node); ast_stack.back()->children.push_back(node);
SET_AST_NODE_LOC(node, @1, @2);
} | } |
lvalue OP_LE delay expr { lvalue OP_LE delay expr {
AstNode *node = new AstNode(AST_ASSIGN_LE, $1, $4); AstNode *node = new AstNode(AST_ASSIGN_LE, $1, $4);
ast_stack.back()->children.push_back(node); ast_stack.back()->children.push_back(node);
SET_AST_NODE_LOC(node, @1, @4);
}; };
// this production creates the obligatory if-else shift/reduce conflict // this production creates the obligatory if-else shift/reduce conflict