source: translator/ControlStruct/LabelGenerator.h@ 91b216b4

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors ctor deferred_resn demangler enum forall-pointer-decay gc_noraii jacob/cs343-translation jenkins-sandbox memory new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new string with_gc
Last change on this file since 91b216b4 was 51b73452, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago

initial commit

  • Property mode set to 100644
File size: 518 bytes
Line 
1#ifndef LABEL_GENERATOR_H
2#define LABEL_GENERATOR_H
3
4#include "SynTree/SynTree.h"
5
6namespace ControlStruct {
7
8 class LabelGenerator
9 {
10 public:
11 static LabelGenerator *getGenerator();
12 Label newLabel();
13 void reset() { current = 0; }
14 void rewind() { current--; }
15
16 protected:
17 LabelGenerator(): current(0) {}
18
19 private:
20 int current;
21 static LabelGenerator *labelGenerator;
22 };
23
24} // namespace ControlStruct
25
26#endif // #ifndef LABEL_GENERATOR_H
27
28/*
29 Local Variables:
30 mode: c++
31 End:
32*/
Note: See TracBrowser for help on using the repository browser.