Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/LabelGenerator.h

    rde31a1d rd180746  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Nov  8 10:16:00 2021
    13 // Update Count     : 8
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sat Jul 22 09:20:14 2017
     13// Update Count     : 6
    1414//
    1515
     
    2121
    2222class Statement;
    23 namespace ast {
    24         class Stmt;
    25         class Label;
    26 }
    2723
    2824namespace ControlStruct {
    29 
    30 class LabelGenerator {
    31         static int current;
    32         static LabelGenerator *labelGenerator;
    33 protected:
    34         LabelGenerator() {}
    35 public:
    36         static LabelGenerator *getGenerator();
    37         static Label newLabel(std::string suffix, Statement * stmt = nullptr);
    38         static ast::Label newLabel( const std::string&, const ast::Stmt * );
    39         static void reset() { current = 0; }
    40         static void rewind() { current--; }
    41 };
    42 
     25        class LabelGenerator {
     26          public:
     27                static LabelGenerator *getGenerator();
     28                Label newLabel(std::string suffix, Statement * stmt = nullptr);
     29                void reset() { current = 0; }
     30                void rewind() { current--; }
     31          protected:
     32                LabelGenerator(): current(0) {}
     33          private:
     34                int current;
     35                static LabelGenerator *labelGenerator;
     36        };
    4337} // namespace ControlStruct
    4438
Note: See TracChangeset for help on using the changeset viewer.