Changeset ea3eb06 for translator/SymTab/StackTable.h
- Timestamp:
- Nov 22, 2014, 4:51:46 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- d11f789
- Parents:
- 3c70d38
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/SymTab/StackTable.h
r3c70d38 rea3eb06 1 /*2 * This file is part of the Cforall project3 *4 * $Id: StackTable.h,v 1.2 2002/09/19 21:02:44 rcbilson Exp $5 *6 */7 8 1 #ifndef SYMTAB_STACKTABLE_H 9 2 #define SYMTAB_STACKTABLE_H … … 15 8 16 9 namespace SymTab { 10 template< typename Element, typename ConflictFunction > 11 class StackTable { 12 public: 13 StackTable(); 17 14 18 template< typename Element, typename ConflictFunction > 19 class StackTable 20 { 21 public: 22 StackTable();15 void enterScope(); 16 void leaveScope(); 17 void add( Element *type ); 18 void add( std::string fwdDeclName ); 19 Element *lookup( std::string id ) const; 23 20 24 void enterScope(); 25 void leaveScope(); 26 void add( Element *type ); 27 void add( std::string fwdDeclName ); 28 Element *lookup( std::string id ) const; 29 30 void dump( std::ostream &os ) const; // debugging 21 void dump( std::ostream &os ) const; // debugging 22 private: 23 typedef std::pair< Element*, int > Entry; 24 typedef std::map< std::string, std::stack< Entry > > TableType; 31 25 32 private: 33 typedef std::pair< Element*, int > Entry; 34 typedef std::map< std::string, std::stack< Entry > > TableType; 35 36 ConflictFunction conflictFunction; 37 TableType table; 38 int scopeLevel; 39 }; 40 41 } // namespace SymTab 26 ConflictFunction conflictFunction; 27 TableType table; 28 int scopeLevel; 29 }; 30 } // SymTab 42 31 43 32 #include "StackTable.cc" 44 33 45 #endif / * #ifndef SYMTAB_STACKTABLE_H */34 #endif // SYMTAB_STACKTABLE_H
Note: See TracChangeset
for help on using the changeset viewer.