Skip to content

Commit 9e467b2

Browse files
committed
SystemVerilog: create identifier expressions in scanner
1 parent 2da61f0 commit 9e467b2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/hw_cbmc_irep_ids.h

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ IREP_ID_ONE(verilog_array_range)
8080
IREP_ID_ONE(verilog_assignment_pattern)
8181
IREP_ID_ONE(verilog_associative_array)
8282
IREP_ID_ONE(verilog_declarations)
83+
IREP_ID_ONE(verilog_identifier)
8384
IREP_ID_ONE(verilog_lifetime)
8485
IREP_ID_ONE(verilog_logical_equality)
8586
IREP_ID_ONE(verilog_logical_inequality)

src/verilog/scanner.l

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ static void preprocessor()
6464
#define IDENTIFIER(text) \
6565
{ newstack(yyveriloglval); \
6666
irep_idt irep_id = text; \
67-
stack_expr(yyveriloglval).id(irep_id); \
67+
stack_expr(yyveriloglval).id(ID_verilog_identifier); \
68+
stack_expr(yyveriloglval).set(ID_base_name, irep_id); \
69+
PARSER.set_source_location(stack_expr(yyveriloglval)); \
6870
auto name = PARSER.scopes.lookup(irep_id); \
6971
return name == nullptr ? TOK_NON_TYPE_IDENTIFIER : \
7072
name->is_type ? TOK_TYPE_IDENTIFIER : \

0 commit comments

Comments
 (0)