source: translator/SymTab/StackTable.h@ d0e8cfe4

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 d0e8cfe4 was 51b73452, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago

initial commit

  • Property mode set to 100644
File size: 869 bytes
Line 
1/*
2 * This file is part of the Cforall project
3 *
4 * $Id: StackTable.h,v 1.2 2002/09/19 21:02:44 rcbilson Exp $
5 *
6 */
7
8#ifndef SYMTAB_STACKTABLE_H
9#define SYMTAB_STACKTABLE_H
10
11#include <map>
12#include <stack>
13#include <string>
14#include <functional>
15
16namespace SymTab {
17
18template< typename Element, typename ConflictFunction >
19class StackTable
20{
21public:
22 StackTable();
23
24 void enterScope();
25 void leaveScope();
26 void add( Element *type );
27 void add( std::string fwdDeclName );
28 Element *lookup( std::string id ) const;
29
30 void dump( std::ostream &os ) const; // debugging
31
32private:
33 typedef std::pair< Element*, int > Entry;
34 typedef std::map< std::string, std::stack< Entry > > TableType;
35
36 ConflictFunction conflictFunction;
37 TableType table;
38 int scopeLevel;
39};
40
41} // namespace SymTab
42
43#include "StackTable.cc"
44
45#endif /* #ifndef SYMTAB_STACKTABLE_H */
Note: See TracBrowser for help on using the repository browser.