Changes in src/SynTree/Declaration.h [312029a:e67991f]
- File:
-
- 1 edited
-
src/SynTree/Declaration.h (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
r312029a re67991f 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Dec 11 16:48:20 201913 // Update Count : 1 4911 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr May 2 10:47:00 2019 13 // Update Count : 135 14 14 // 15 15 … … 25 25 #include "Mutator.h" // for Mutator 26 26 #include "Parser/LinkageSpec.h" // for Spec, Cforall 27 #include "Parser/ParseNode.h" // for DeclarationNode, DeclarationNode::Ag... 27 28 #include "SynTree.h" // for UniqueId 28 29 #include "SynTree/Type.h" // for Type, Type::StorageClasses, Type::Fu... … … 193 194 std::list< DeclarationWithType* >& get_assertions() { return assertions; } 194 195 195 virtual const char *typeString() const = 0;196 virtual std::string typeString() const = 0; 196 197 197 198 virtual NamedTypeDecl *clone() const override = 0; … … 236 237 TypeDecl * set_sized( bool newValue ) { sized = newValue; return this; } 237 238 238 virtual const char *typeString() const override;239 virtual const char *genTypeString() const;239 virtual std::string typeString() const override; 240 virtual std::string genTypeString() const; 240 241 241 242 virtual TypeDecl *clone() const override { return new TypeDecl( *this ); } … … 256 257 TypedefDecl( const TypedefDecl &other ) : Parent( other ) {} 257 258 258 virtual const char *typeString() const override;259 virtual std::string typeString() const override; 259 260 260 261 virtual TypedefDecl *clone() const override { return new TypedefDecl( *this ); } … … 268 269 typedef Declaration Parent; 269 270 public: 270 enum Aggregate { Struct, Union, Enum, Exception, Trait, Generator, Coroutine, Monitor, Thread, NoAggregate };271 static const char * aggrString( Aggregate aggr );272 273 271 std::list<Declaration*> members; 274 272 std::list<TypeDecl*> parameters; … … 293 291 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override; 294 292 protected: 295 virtual const char *typeString() const = 0;293 virtual std::string typeString() const = 0; 296 294 }; 297 295 … … 299 297 typedef AggregateDecl Parent; 300 298 public: 301 StructDecl( const std::string &name, Aggregate kind =Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {}299 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {} 302 300 StructDecl( const StructDecl &other ) : Parent( other ), kind( other.kind ) {} 303 301 304 bool is_coroutine() { return kind == Coroutine; }305 bool is_monitor() { return kind == Monitor; }306 bool is_thread() { return kind == Thread; }302 bool is_coroutine() { return kind == DeclarationNode::Coroutine; } 303 bool is_monitor() { return kind == DeclarationNode::Monitor; } 304 bool is_thread() { return kind == DeclarationNode::Thread; } 307 305 308 306 virtual StructDecl *clone() const override { return new StructDecl( *this ); } … … 310 308 virtual void accept( Visitor & v ) const override { v.visit( this ); } 311 309 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 312 Aggregate kind;313 private: 314 virtual const char *typeString() const override;310 DeclarationNode::Aggregate kind; 311 private: 312 virtual std::string typeString() const override; 315 313 }; 316 314 … … 326 324 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 327 325 private: 328 virtual const char *typeString() const override;326 virtual std::string typeString() const override; 329 327 }; 330 328 … … 343 341 private: 344 342 std::unordered_map< std::string, long long int > enumValues; 345 virtual const char *typeString() const override;343 virtual std::string typeString() const override; 346 344 }; 347 345 … … 359 357 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 360 358 private: 361 virtual const char *typeString() const override;359 virtual std::string typeString() const override; 362 360 }; 363 361
Note:
See TracChangeset
for help on using the changeset viewer.