Changeset a08ba92 for translator/SymTab/Indexer.h
- Timestamp:
- May 19, 2015, 4:58:14 PM (11 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, stuck-waitfor-destruct, with_gc
- Children:
- 843054c2
- Parents:
- 01aeade
- File:
-
- 1 edited
-
translator/SymTab/Indexer.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
translator/SymTab/Indexer.h
r01aeade ra08ba92 10 10 // Created On : Sun May 17 21:38:55 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun May 17 21:40:17201513 // Update Count : 212 // Last Modified On : Tue May 19 16:51:21 2015 13 // Update Count : 3 14 14 // 15 15 … … 27 27 28 28 namespace SymTab { 29 class Indexer : public Visitor {30 public:31 Indexer( bool useDebug = false );32 virtual ~Indexer();29 class Indexer : public Visitor { 30 public: 31 Indexer( bool useDebug = false ); 32 virtual ~Indexer(); 33 33 34 //using Visitor::visit;35 virtual void visit( ObjectDecl *objectDecl );36 virtual void visit( FunctionDecl *functionDecl );37 virtual void visit( TypeDecl *typeDecl );38 virtual void visit( TypedefDecl *typeDecl );39 virtual void visit( StructDecl *aggregateDecl );40 virtual void visit( UnionDecl *aggregateDecl );41 virtual void visit( EnumDecl *aggregateDecl );42 virtual void visit( ContextDecl *aggregateDecl );34 //using Visitor::visit; 35 virtual void visit( ObjectDecl *objectDecl ); 36 virtual void visit( FunctionDecl *functionDecl ); 37 virtual void visit( TypeDecl *typeDecl ); 38 virtual void visit( TypedefDecl *typeDecl ); 39 virtual void visit( StructDecl *aggregateDecl ); 40 virtual void visit( UnionDecl *aggregateDecl ); 41 virtual void visit( EnumDecl *aggregateDecl ); 42 virtual void visit( ContextDecl *aggregateDecl ); 43 43 44 virtual void visit( CompoundStmt *compoundStmt );44 virtual void visit( CompoundStmt *compoundStmt ); 45 45 46 virtual void visit( ContextInstType *contextInst );47 virtual void visit( StructInstType *contextInst );48 virtual void visit( UnionInstType *contextInst );46 virtual void visit( ContextInstType *contextInst ); 47 virtual void visit( StructInstType *contextInst ); 48 virtual void visit( UnionInstType *contextInst ); 49 49 50 virtual void visit( ForStmt *forStmt );50 virtual void visit( ForStmt *forStmt ); 51 51 52 // when using an indexer manually (e.g., within a mutator traversal), it is necessary to tell the indexer53 // explicitly when scopes begin and end54 void enterScope();55 void leaveScope();52 // when using an indexer manually (e.g., within a mutator traversal), it is necessary to tell the indexer 53 // explicitly when scopes begin and end 54 void enterScope(); 55 void leaveScope(); 56 56 57 void lookupId( const std::string &id, std::list< DeclarationWithType* >& ) const;58 DeclarationWithType* lookupId( const std::string &id) const;59 NamedTypeDecl *lookupType( const std::string &id ) const;60 StructDecl *lookupStruct( const std::string &id ) const;61 EnumDecl *lookupEnum( const std::string &id ) const;62 UnionDecl *lookupUnion( const std::string &id ) const;63 ContextDecl *lookupContext( const std::string &id ) const;57 void lookupId( const std::string &id, std::list< DeclarationWithType* >& ) const; 58 DeclarationWithType* lookupId( const std::string &id) const; 59 NamedTypeDecl *lookupType( const std::string &id ) const; 60 StructDecl *lookupStruct( const std::string &id ) const; 61 EnumDecl *lookupEnum( const std::string &id ) const; 62 UnionDecl *lookupUnion( const std::string &id ) const; 63 ContextDecl *lookupContext( const std::string &id ) const; 64 64 65 void print( std::ostream &os, int indent = 0 ) const;66 private:67 IdTable idTable;68 TypeTable typeTable;69 StructTable structTable;70 EnumTable enumTable;71 UnionTable unionTable;72 ContextTable contextTable;65 void print( std::ostream &os, int indent = 0 ) const; 66 private: 67 IdTable idTable; 68 TypeTable typeTable; 69 StructTable structTable; 70 EnumTable enumTable; 71 UnionTable unionTable; 72 ContextTable contextTable; 73 73 74 bool doDebug; // display debugging trace75 };74 bool doDebug; // display debugging trace 75 }; 76 76 } // namespace SymTab 77 77
Note:
See TracChangeset
for help on using the changeset viewer.