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 42e2ad7 was
bdd516a,
checked in by Peter A. Buhr <pabuhr@…>, 9 years ago
|
fixed sizeof type variable, find lowest cost alternative for sizeof expression, removed unused classes, added compiler flag, remove temporary file for -CFA, formatting
|
-
Property mode set to
100644
|
File size:
821 bytes
|
Rev | Line | |
---|
[51b7345] | 1 | #ifndef SYMTAB_IDTABLE_H |
---|
| 2 | #define SYMTAB_IDTABLE_H |
---|
| 3 | |
---|
| 4 | #include <iostream> |
---|
| 5 | #include <map> |
---|
| 6 | #include <string> |
---|
| 7 | #include <stack> |
---|
| 8 | |
---|
| 9 | #include "SynTree/SynTree.h" |
---|
| 10 | |
---|
| 11 | namespace SymTab { |
---|
[bdd516a] | 12 | class IdTable { |
---|
| 13 | public: |
---|
| 14 | IdTable(); |
---|
[51b7345] | 15 | |
---|
[bdd516a] | 16 | void enterScope(); |
---|
| 17 | void leaveScope(); |
---|
| 18 | void addDecl( DeclarationWithType *decl ); |
---|
| 19 | void lookupId( const std::string &id, std::list< DeclarationWithType* >& decls ) const; |
---|
| 20 | DeclarationWithType* lookupId( const std::string &id) const; |
---|
[51b7345] | 21 | |
---|
[bdd516a] | 22 | void dump( std::ostream &os ) const; // debugging |
---|
[51b7345] | 23 | |
---|
[bdd516a] | 24 | private: |
---|
| 25 | typedef std::pair< DeclarationWithType*, int > DeclEntry; |
---|
| 26 | typedef std::map< std::string, std::stack< DeclEntry > > InnerTableType; |
---|
| 27 | typedef std::map< std::string, InnerTableType > OuterTableType; |
---|
[51b7345] | 28 | |
---|
[bdd516a] | 29 | OuterTableType table; |
---|
| 30 | int scopeLevel; |
---|
| 31 | }; |
---|
[51b7345] | 32 | } // namespace SymTab |
---|
| 33 | |
---|
[bdd516a] | 34 | #endif // SYMTAB_IDTABLE_H |
---|
Note: See
TracBrowser
for help on using the repository browser.