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.3 KB
|
Rev | Line | |
---|
[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 | // 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 : Sun May 17 21:31:45 2015 |
---|
| 13 | // Update Count : 3 |
---|
| 14 | // |
---|
| 15 | |
---|
| 16 | #ifndef IDTABLE_H |
---|
| 17 | #define IDTABLE_H |
---|
[51b7345] | 18 | |
---|
| 19 | #include <iostream> |
---|
| 20 | #include <map> |
---|
| 21 | #include <string> |
---|
| 22 | #include <stack> |
---|
| 23 | |
---|
| 24 | #include "SynTree/SynTree.h" |
---|
| 25 | |
---|
| 26 | namespace SymTab { |
---|
[bdd516a] | 27 | class IdTable { |
---|
| 28 | public: |
---|
[0dd3a2f] | 29 | IdTable(); |
---|
[51b7345] | 30 | |
---|
[0dd3a2f] | 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; |
---|
[51b7345] | 36 | |
---|
[0dd3a2f] | 37 | void dump( std::ostream &os ) const; // debugging |
---|
[bdd516a] | 38 | private: |
---|
[0dd3a2f] | 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; |
---|
[51b7345] | 42 | |
---|
[0dd3a2f] | 43 | OuterTableType table; |
---|
| 44 | int scopeLevel; |
---|
[bdd516a] | 45 | }; |
---|
[51b7345] | 46 | } // namespace SymTab |
---|
| 47 | |
---|
[0dd3a2f] | 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.