source: src/ControlStruct/LabelGenerator.h @ b617e4b

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 b617e4b 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
RevLine 
[51587aa]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//
[a08ba92]7// LabelGenerator.h --
[51587aa]8//
[843054c2]9// Author           : Rodolfo G. Esteves
[51587aa]10// Created On       : Mon May 18 07:44:20 2015
[27de955]11// Last Modified By : Rob Schluntz
12// Last Modified On : Wed Jun 03 14:16:26 2015
13// Update Count     : 5
[51587aa]14//
[a08ba92]15
[51b7345]16#ifndef LABEL_GENERATOR_H
17#define LABEL_GENERATOR_H
18
19#include "SynTree/SynTree.h"
[27de955]20#include <string>
[51b7345]21
22namespace ControlStruct {
[a08ba92]23        class LabelGenerator {
24          public:
25                static LabelGenerator *getGenerator();
[27de955]26                Label newLabel(std::string suffix = "");
[a08ba92]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        };
[51b7345]35} // namespace ControlStruct
36
[d9a0e76]37#endif // LABEL_GENERATOR_H
[51b7345]38
[51587aa]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.