source: translator/SymTab/StackTable.h @ 51587aa

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since 51587aa was 0dd3a2f, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

licencing: third groups of files

  • Property mode set to 100644
File size: 1.2 KB
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// StackTable.h --
8//
9// Author           : Richard C. Bilson
10// Created On       : Sun May 17 21:47:10 2015
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Sun May 17 21:48:15 2015
13// Update Count     : 3
14//
15
16#ifndef STACKTABLE_H
17#define STACKTABLE_H
18
19#include <map>
20#include <stack>
21#include <string>
22#include <functional>
23
24namespace SymTab {
25    template< typename Element, typename ConflictFunction >
26        class StackTable {
27      public:
28                StackTable();
29
30                void enterScope();
31                void leaveScope();
32                void add( Element *type );
33                void add( std::string fwdDeclName );
34                Element *lookup( std::string id ) const;
35
36                void dump( std::ostream &os ) const;                    // debugging
37      private:
38                typedef std::pair< Element*, int > Entry;
39                typedef std::map< std::string, std::stack< Entry > > TableType;
40 
41                ConflictFunction conflictFunction;
42                TableType table;
43                int scopeLevel;
44    };
45} // SymTab
46
47#include "StackTable.cc"
48
49#endif // STACKTABLE_H
50
51// Local Variables: //
52// tab-width: 4 //
53// mode: c++ //
54// compile-command: "make install" //
55// End: //
Note: See TracBrowser for help on using the repository browser.