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 b87a5ed 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
|
Line | |
---|
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 { |
---|
12 | class IdTable { |
---|
13 | public: |
---|
14 | IdTable(); |
---|
15 | |
---|
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; |
---|
21 | |
---|
22 | void dump( std::ostream &os ) const; // debugging |
---|
23 | |
---|
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; |
---|
28 | |
---|
29 | OuterTableType table; |
---|
30 | int scopeLevel; |
---|
31 | }; |
---|
32 | } // namespace SymTab |
---|
33 | |
---|
34 | #endif // SYMTAB_IDTABLE_H |
---|
Note: See
TracBrowser
for help on using the repository browser.