@@ -412,55 +412,59 @@ inline verilog_set_genvarst &to_verilog_set_genvars(exprt &expr)
412412  return  static_cast <verilog_set_genvarst &>(expr);
413413}
414414
415- class  verilog_parameter_declt  : public  verilog_module_itemt 
415+ //  This class is used for all declarators in the parse tree
416+ class  verilog_declaratort  : public  exprt 
416417{
417418public: 
418-   inline   verilog_parameter_declt () : verilog_module_itemt(ID_parameter_decl) 
419+   const  irep_idt & identifier ()  const 
419420  {
421+     return  get (ID_identifier);
420422  }
421423
422-   class   declaratort  :  public   exprt 
424+   void   identifier (irep_idt _identifier) 
423425  {
424-   public: 
425-     const  irep_idt &identifier () const 
426-     {
427-       return  get (ID_identifier);
428-     }
426+     set (ID_identifier, _identifier);
427+   }
429428
430-      void   identifier ( irep_idt _identifier) 
431-      {
432-        set (ID_identifier, _identifier );
433-      }
429+   const   irep_idt & base_name ()  const 
430+   {
431+     return   get (ID_base_name );
432+   }
434433
435-      const  irep_idt & base_name () const 
436-      {
437-        return   get (ID_base_name );
438-      }
434+   const  exprt & value () const 
435+   {
436+     return   static_cast < const  exprt &>( find (ID_value) );
437+   }
439438
440-      const   exprt &value ()  const 
441-      {
442-        return  static_cast <const   exprt &>(find (ID_value));
443-      }
439+   exprt &value ()
440+   {
441+     return  static_cast <exprt &>(add (ID_value));
442+   }
444443
445-     exprt & value () 
446-      {
447-        return  static_cast <exprt &>( add ( ID_value));
448-      }
444+   bool   has_value ()  const 
445+   {
446+     return  find ( ID_value). is_not_nil ( );
447+   }
449448
450-     bool  has_value () const 
451-     {
452-       return  find (ID_value).is_not_nil ();
453-     }
449+   //  helper to generate a symbol expression
450+   symbol_exprt symbol_expr () const 
451+   {
452+     return  symbol_exprt (identifier (), type ())
453+       .with_source_location <symbol_exprt>(*this );
454+   }
455+ };
454456
455-     //  helper to generate a symbol expression
456-     symbol_exprt symbol_expr () const 
457-     {
458-       return  symbol_exprt (identifier (), type ())
459-         .with_source_location <symbol_exprt>(*this );
460-     }
461-   };
457+ using  verilog_declaratorst = std::vector<verilog_declaratort>;
458+ 
459+ class  verilog_parameter_declt  : public  verilog_module_itemt 
460+ {
461+ public: 
462+   inline  verilog_parameter_declt () : verilog_module_itemt(ID_parameter_decl)
463+   {
464+   }
462465
463-   using  declaratorst = std::vector<declaratort>;
466+   using  declaratort = verilog_declaratort;
467+   using  declaratorst = verilog_declaratorst;
464468
465469  const  declaratorst &declarations () const 
466470  {
@@ -494,8 +498,8 @@ class verilog_local_parameter_declt : public verilog_module_itemt
494498  {
495499  }
496500
497-   using  declaratort = verilog_parameter_declt::declaratort ;
498-   using  declaratorst = std::vector<declaratort> ;
501+   using  declaratort = verilog_declaratort ;
502+   using  declaratorst = verilog_declaratorst ;
499503
500504  const  declaratorst &declarations () const 
501505  {
@@ -526,7 +530,7 @@ class verilog_lett : public verilog_module_itemt
526530{
527531public: 
528532  //  These have a single declarator.
529-   using  declaratort = verilog_parameter_declt::declaratort ;
533+   using  declaratort = verilog_declaratort ;
530534
531535  const  declaratort &declarator () const 
532536  {
@@ -715,8 +719,8 @@ class verilog_declt:public verilog_statementt
715719  }
716720
717721  //  When it's not a function or task, there are declarators.
718-   using  declaratort = verilog_parameter_declt::declaratort ;
719-   using  declaratorst = verilog_parameter_declt::declaratorst ;
722+   using  declaratort = verilog_declaratort ;
723+   using  declaratorst = verilog_declaratorst ;
720724
721725  declaratorst &declarators ()
722726  {
0 commit comments