Changes in src/SynTree/Declaration.h [712348a:0e73845]
- File:
-
- 1 edited
-
src/SynTree/Declaration.h (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
r712348a r0e73845 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr May 2 10:47:00 201913 // Update Count : 13 511 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Sep 3 19:24:06 2017 13 // Update Count : 131 14 14 // 15 15 … … 19 19 #include <iosfwd> // for ostream 20 20 #include <list> // for list 21 #include <unordered_map> // for unordered_map22 21 #include <string> // for string, operator+, allocator, to_string 23 22 … … 71 70 static Declaration *declFromId( UniqueId id ); 72 71 72 private: 73 Type::StorageClasses storageClasses; 73 74 UniqueId uniqueId; 74 Type::StorageClasses storageClasses;75 private:76 75 }; 77 76 … … 167 166 CompoundStmt *get_statements() const { return statements; } 168 167 void set_statements( CompoundStmt *newValue ) { statements = newValue; } 169 bool has_body() const { return NULL != statements; }170 168 171 169 static FunctionDecl * newFunction( const std::string & name, FunctionType * type, CompoundStmt * statements ); … … 213 211 TypeDecl::Kind kind; 214 212 bool isComplete; 215 216 213 Data() : kind( (TypeDecl::Kind)-1 ), isComplete( false ) {} 217 214 Data( TypeDecl * typeDecl ) : Data( typeDecl->get_kind(), typeDecl->isComplete() ) {} 218 215 Data( Kind kind, bool isComplete ) : kind( kind ), isComplete( isComplete ) {} 219 Data( const Data& d1, const Data& d2 )220 : kind( d1.kind ), isComplete ( d1.isComplete || d2.isComplete ) {}221 222 216 bool operator==(const Data & other) const { return kind == other.kind && isComplete == other.isComplete; } 223 217 bool operator!=(const Data & other) const { return !(*this == other);} … … 245 239 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 246 240 241 private: 247 242 Kind kind; 248 243 }; … … 305 300 virtual void accept( Visitor &v ) override { v.visit( this ); } 306 301 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 302 private: 307 303 DeclarationNode::Aggregate kind; 308 private:309 304 virtual std::string typeString() const override; 310 305 }; … … 335 330 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 336 331 private: 337 std:: unordered_map< std::string, long long int > enumValues;332 std::map< std::string, long long int > enumValues; 338 333 virtual std::string typeString() const override; 339 334 };
Note:
See TracChangeset
for help on using the changeset viewer.