@@ -28,7 +28,7 @@ Author: Daniel Kroening, kroening@cs.cmu.edu
2828#define mts (x, y ) stack_expr(x).move_to_sub((irept &)stack_expr(y))
2929#define swapop (x, y ) stack_expr(x).operands().swap(stack_expr(y).operands())
3030#define addswap (x, y, z ) stack_expr(x).add(y).swap(stack_expr(z))
31- #define push_scope (x, y ) PARSER.scopes.push_scope(x, y )
31+ #define push_scope (name, separator, kind ) PARSER.scopes.push_scope(name, separator, kind )
3232#define pop_scope () PARSER.scopes.pop_scope();
3333
3434int yyveriloglex ();
@@ -644,7 +644,7 @@ module_identifier_with_scope:
644644 module_identifier
645645 {
646646 $$ = $1 ;
647- push_scope (stack_expr($1 ).id(), ".");
647+ push_scope (stack_expr($1 ).id(), ".", verilog_scopet::MODULE );
648648 }
649649 ;
650650
@@ -823,7 +823,7 @@ class_declaration:
823823 {
824824 init ($$, ID_verilog_class);
825825 stack_expr ($$).set (ID_base_name, stack_expr ($2 ).id ());
826- push_scope (stack_expr ($2 ).id (), " ::" );
826+ push_scope (stack_expr ($2 ).id (), " ::" , verilog_scopet::CLASS );
827827 }
828828 class_item_brace
829829 TOK_ENDCLASS
@@ -839,7 +839,7 @@ package_declaration:
839839 lifetime_opt
840840 package_identifier ' ;'
841841 {
842- push_scope (stack_expr ($5 ).id (), " ::" );
842+ push_scope (stack_expr ($5 ).id (), " ::" , verilog_scopet::PACKAGE );
843843 }
844844 timeunits_declaration_opt
845845 package_item_brace
@@ -1447,7 +1447,7 @@ type_declaration:
14471447 data_type any_identifier ' ;'
14481448 { $$ = $2 ;
14491449 // add to the scope as a type name
1450- auto &name = PARSER.scopes .add_name (stack_expr ($4 ).get (ID_identifier), " " );
1450+ auto &name = PARSER.scopes .add_name (stack_expr ($4 ).get (ID_identifier), " " , verilog_scopet::TYPEDEF );
14511451 name.is_type = true ;
14521452 addswap ($$, ID_type, $3 );
14531453 stack_expr ($4 ).id (ID_declarator);
@@ -1571,7 +1571,7 @@ enum_name_declaration:
15711571 TOK_NON_TYPE_IDENTIFIER enum_name_value_opt
15721572 {
15731573 init ($$);
1574- auto &scope = PARSER.scopes .add_name (stack_expr ($1 ).id (), " " );
1574+ auto &scope = PARSER.scopes .add_name (stack_expr ($1 ).id (), " " , verilog_scopet::ENUM_NAME );
15751575 stack_expr ($$).set (ID_base_name, scope.base_name ());
15761576 stack_expr ($$).set (ID_identifier, scope.identifier ());
15771577 stack_expr ($$).add (ID_value).swap (stack_expr ($2 ));
@@ -2139,7 +2139,7 @@ function_declaration: TOK_FUNCTION lifetime_opt function_body_declaration
21392139function_body_declaration:
21402140 function_data_type_or_implicit
21412141 function_identifier
2142- { push_scope (stack_expr ($2 ).get (ID_identifier), " ." ); }
2142+ { push_scope (stack_expr ($2 ).get (ID_identifier), " ." , verilog_scopet::FUNCTION ); }
21432143 ' ;'
21442144 tf_item_declaration_brace statement
21452145 TOK_ENDFUNCTION
@@ -2154,7 +2154,7 @@ function_body_declaration:
21542154 }
21552155 | function_data_type_or_implicit
21562156 function_identifier
2157- { push_scope (stack_expr ($2 ).get (ID_identifier), " ." ); }
2157+ { push_scope (stack_expr ($2 ).get (ID_identifier), " ." , verilog_scopet::FUNCTION ); }
21582158 ' (' tf_port_list_opt ' )' ' ;'
21592159 tf_item_declaration_brace statement
21602160 TOK_ENDFUNCTION
@@ -2195,7 +2195,7 @@ function_prototype: TOK_FUNCTION data_type_or_void function_identifier
21952195
21962196task_declaration:
21972197 TOK_TASK task_identifier
2198- { push_scope (stack_expr ($2 ).get (ID_identifier), " ." ); }
2198+ { push_scope (stack_expr ($2 ).get (ID_identifier), " ." , verilog_scopet::TASK ); }
21992199 ' ;'
22002200 tf_item_declaration_brace
22012201 statement_or_null TOK_ENDTASK
@@ -2207,7 +2207,7 @@ task_declaration:
22072207 pop_scope ();
22082208 }
22092209 | TOK_TASK task_identifier
2210- { push_scope (stack_expr ($2 ).get (ID_identifier), " ." ); }
2210+ { push_scope (stack_expr ($2 ).get (ID_identifier), " ." , verilog_scopet::TASK ); }
22112211 ' (' tf_port_list_opt ' )' ' ;'
22122212 tf_item_declaration_brace
22132213 statement_or_null TOK_ENDTASK
@@ -3387,7 +3387,7 @@ seq_block:
33873387 TOK_END
33883388 { init ($$, ID_block); swapop ($$, $2 ); }
33893389 | TOK_BEGIN TOK_COLON block_identifier
3390- { push_scope (stack_expr ($3 ).id (), " ." ); }
3390+ { push_scope (stack_expr ($3 ).id (), " ." , verilog_scopet::BLOCK ); }
33913391 block_item_declaration_or_statement_or_null_brace
33923392 TOK_END
33933393 { init ($$, ID_block);
0 commit comments