source: translator/SymTab/IdTable.h @ 42dcae7

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 42dcae7 was 51b7345, checked in by Peter A. Buhr <pabuhr@…>, 10 years ago

initial commit

  • Property mode set to 100644
File size: 881 bytes
Line 
1/*
2 * This file is part of the Cforall project
3 *
4 * $Id: IdTable.h,v 1.4 2005/08/29 20:14:17 rcbilson Exp $
5 *
6 */
7
8#ifndef SYMTAB_IDTABLE_H
9#define SYMTAB_IDTABLE_H
10
11#include <iostream>
12#include <map>
13#include <string>
14#include <stack>
15
16#include "SynTree/SynTree.h"
17
18namespace SymTab {
19
20class IdTable
21{
22public:
23  IdTable();
24 
25  void enterScope();
26  void leaveScope();
27  void addDecl( DeclarationWithType *decl );
28  void lookupId( const std::string &id, std::list< DeclarationWithType* >& decls ) const;
29 
30  void dump( std::ostream &os ) const; // debugging
31
32 private:
33  typedef std::pair< DeclarationWithType*, int > DeclEntry;
34  typedef std::map< std::string, std::stack< DeclEntry > > InnerTableType;
35  typedef std::map< std::string, InnerTableType > OuterTableType;
36
37  OuterTableType table;
38  int scopeLevel;
39};
40
41} // namespace SymTab
42
43#endif /* #ifndef SYMTAB_IDTABLE_H */
Note: See TracBrowser for help on using the repository browser.