source: src/SymTab/IdTable.h @ 76f2e97f

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 76f2e97f 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.3 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// IdTable.h --
8//
9// Author           : Richard C. Bilson
10// Created On       : Sun May 17 21:30:02 2015
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Tue May 19 16:49:33 2015
13// Update Count     : 4
14//
15
16#ifndef IDTABLE_H
17#define IDTABLE_H
18
19#include <iostream>
20#include <map>
21#include <string>
22#include <stack>
23
24#include "SynTree/SynTree.h"
25
26namespace SymTab {
27        class IdTable {
28          public:
29                IdTable();
30 
31                void enterScope();
32                void leaveScope();
33                void addDecl( DeclarationWithType *decl );
34                void lookupId( const std::string &id, std::list< DeclarationWithType* >& decls ) const;
35                DeclarationWithType* lookupId( const std::string &id) const;
36 
37                void dump( std::ostream &os ) const;                    // debugging
38          private:
39                typedef std::pair< DeclarationWithType*, int > DeclEntry;
40                typedef std::map< std::string, std::stack< DeclEntry > > InnerTableType;
41                typedef std::map< std::string, InnerTableType > OuterTableType;
42
43                OuterTableType table;
44                int scopeLevel;
45        };
46} // namespace SymTab
47
48#endif // IDTABLE_H
49
50// Local Variables: //
51// tab-width: 4 //
52// mode: c++ //
53// compile-command: "make install" //
54// End: //
Note: See TracBrowser for help on using the repository browser.