Changeset 984dce6 for src/Parser/TypedefTable.cc
- Timestamp:
- Mar 22, 2016, 9:57:47 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:
- 94980502
- Parents:
- a752883
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/TypedefTable.cc
ra752883 r984dce6 10 10 // Created On : Sat May 16 15:20:13 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 17:25:55201613 // Update Count : 2 012 // Last Modified On : Mon Mar 21 18:18:58 2016 13 // Update Count : 23 14 14 // 15 15 16 16 #include <map> 17 17 #include <list> 18 #include <cassert> 18 19 #include "TypedefTable.h" 19 #include <cassert>20 20 using namespace std; 21 21 … … 29 29 TypedefTable::TypedefTable() : currentScope( 0 ) {} 30 30 31 bool TypedefTable::exists( const string &identifier ) { 32 return table.count( identifier ) > 0; 33 } 34 31 35 void TypedefTable::changeKind( const string &identifier, kind_t kind ) { 32 36 tableType::iterator id_pos = table.find( identifier ); 33 if ( id_pos == table.end() ) { 34 return; 35 } else { 36 (*((*id_pos ).second.begin())).kind = kind; 37 return; 38 } // if 37 if ( id_pos == table.end() ) return; 38 id_pos->second.begin()->kind = kind; 39 39 } 40 40 41 bool TypedefTable::isKind( const string &identifier, kind_t kind) const {41 int TypedefTable::isKind( const string &identifier ) const { 42 42 tableType::const_iterator id_pos = table.find( identifier ); 43 if ( id_pos == table.end() ) { 44 return true; 45 } else { 46 return (*((*id_pos ).second.begin())).kind == kind; 47 } // if 48 } 49 50 bool TypedefTable::isIdentifier( const string &identifier ) const { 51 return isKind( identifier, ID ); 52 } 53 54 bool TypedefTable::isTypedef( const string &identifier ) const { 55 return isKind( identifier, TD ); 56 } 57 58 bool TypedefTable::isTypegen( const string &identifier ) const { 59 return isKind( identifier, TG ); 43 // Name lookup defaults to identifier, and then the identifier's kind is set by the parser. 44 if ( id_pos == table.end() ) return IDENTIFIER; 45 return id_pos->second.begin()->kind; 60 46 } 61 47
Note: See TracChangeset
for help on using the changeset viewer.