Changeset 0f9e4403 for src/Parser/TypedefTable.h
- Timestamp:
- Apr 15, 2016, 12:03:11 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, with_gc
- Children:
- 29ad0ac
- Parents:
- c5833e8 (diff), 37f0da8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/TypedefTable.h
rc5833e8 r0f9e4403 10 10 // Created On : Sat May 16 15:24:36 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 25 22:52:15 201513 // Update Count : 1112 // Last Modified On : Wed Apr 13 16:59:56 2016 13 // Update Count : 27 14 14 // 15 15 … … 22 22 #include <stack> 23 23 24 #include "lex.h" 25 #include "parser.h" 26 24 27 class TypedefTable { 25 28 public: 26 enum kind_t { ID , TD, TG};29 enum kind_t { ID = IDENTIFIER, TD = TYPEDEFname, TG = TYPEGENname }; 27 30 private: 28 31 struct Entry { … … 40 43 41 44 int currentScope; 42 std::string current Context;45 std::string currentTrait; 43 46 int contextScope; 44 47 … … 49 52 std::stack< std::string > nextIdentifiers; 50 53 51 bool isKind( const std::string &identifier, kind_t kind ) const;52 54 void addToScope( const std::string &identifier, kind_t kind, int scope ); 53 55 public: 54 56 TypedefTable(); 55 57 56 bool isIdentifier( const std::string &identifier ) const;57 bool isTypedef( const std::string &identifier ) const;58 bool isTypegen( const std::string &identifier ) const;58 bool exists( const std::string &identifier ); 59 int isKind( const std::string &identifier ) const; 60 void changeKind( const std::string &identifier, kind_t kind ); 59 61 60 void changeKind( const std::string &identifier, kind_t kind);61 62 void makeTypedef( const std::string &name ); 63 62 64 // "addToCurrentScope" adds the identifier/type pair to the current scope. This does less than you think it does, 63 65 // since each declaration is within its own scope. Mostly useful for type parameters. … … 79 81 80 82 // dump the definitions from a pre-defined context into the current scope 81 void open Context( const std::string &contextName );83 void openTrait( const std::string &contextName ); 82 84 83 85 void enterScope(); 84 86 void leaveScope(); 85 void enter Context( const std::string &contextName );86 void leave Context();87 void enterTrait( const std::string &contextName ); 88 void leaveTrait(); 87 89 88 90 void print() const;
Note:
See TracChangeset
for help on using the changeset viewer.