source: src/SymTab/StackTable.h @ 6244dfb

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 6244dfb was 843054c2, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

licencing: seventh groups of files

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[0dd3a2f]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
[a08ba92]12// Last Modified On : Tue May 19 16:50:36 2015
13// Update Count     : 4
[0dd3a2f]14//
15
16#ifndef STACKTABLE_H
17#define STACKTABLE_H
[51b7345]18
19#include <map>
20#include <stack>
21#include <string>
22#include <functional>
23
24namespace SymTab {
[a08ba92]25        template< typename Element, typename ConflictFunction >
[ea3eb06]26        class StackTable {
[a08ba92]27          public:
[0dd3a2f]28                StackTable();
[ea3eb06]29
[0dd3a2f]30                void enterScope();
31                void leaveScope();
32                void add( Element *type );
33                void add( std::string fwdDeclName );
34                Element *lookup( std::string id ) const;
[ea3eb06]35
[0dd3a2f]36                void dump( std::ostream &os ) const;                    // debugging
[a08ba92]37          private:
[0dd3a2f]38                typedef std::pair< Element*, int > Entry;
39                typedef std::map< std::string, std::stack< Entry > > TableType;
[51b7345]40 
[0dd3a2f]41                ConflictFunction conflictFunction;
42                TableType table;
43                int scopeLevel;
[a08ba92]44        };
[ea3eb06]45} // SymTab
[51b7345]46
47#include "StackTable.cc"
48
[0dd3a2f]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.