source: src/ControlStruct/LabelGenerator.h @ dd51906

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since dd51906 was 27de955, checked in by Rob Schluntz <rschlunt@…>, 9 years ago

fix multi-level exit code (labeled break and continue)

  • Property mode set to 100644
File size: 1016 bytes
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// LabelGenerator.h --
8//
9// Author           : Rodolfo G. Esteves
10// Created On       : Mon May 18 07:44:20 2015
11// Last Modified By : Rob Schluntz
12// Last Modified On : Wed Jun 03 14:16:26 2015
13// Update Count     : 5
14//
15
16#ifndef LABEL_GENERATOR_H
17#define LABEL_GENERATOR_H
18
19#include "SynTree/SynTree.h"
20#include <string>
21
22namespace ControlStruct {
23        class LabelGenerator {
24          public:
25                static LabelGenerator *getGenerator();
26                Label newLabel(std::string suffix = "");
27                void reset() { current = 0; }
28                void rewind() { current--; }
29          protected:
30                LabelGenerator(): current(0) {}
31          private:
32                int current;
33                static LabelGenerator *labelGenerator;
34        };
35} // namespace ControlStruct
36
37#endif // LABEL_GENERATOR_H
38
39// Local Variables: //
40// tab-width: 4 //
41// mode: c++ //
42// compile-command: "make install" //
43// End: //
Note: See TracBrowser for help on using the repository browser.