Changeset 2e9b59b for src/SynTree/Declaration.h
- Timestamp:
- Apr 19, 2022, 3:00:04 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 5b84a321
- Parents:
- ba897d21 (diff), bb7c77d (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/SynTree/Declaration.h
rba897d21 r2e9b59b 144 144 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 145 145 virtual void printShort( std::ostream & os, Indenter indent = {} ) const override; 146 147 // TODO: Move to the right place 148 void checkAssignedValue() const; 146 149 }; 147 150 … … 287 290 AggregateDecl * set_body( bool body ) { AggregateDecl::body = body; return this; } 288 291 289 virtual void print( std::ostream & os, Indenter indent = {} ) const override final;292 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 290 293 virtual void printShort( std::ostream & os, Indenter indent = {} ) const override; 291 294 protected: … … 335 338 typedef AggregateDecl Parent; 336 339 public: 337 EnumDecl( const std::string & name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {} 338 EnumDecl( const EnumDecl & other ) : Parent( other ) {} 340 EnumDecl( const std::string & name, 341 const std::list< Attribute * > & attributes = std::list< class Attribute * >(), 342 LinkageSpec::Spec linkage = LinkageSpec::Cforall, 343 Type * baseType = nullptr ) : Parent( name, attributes, linkage ) , base( baseType ){} 344 EnumDecl( const EnumDecl & other ) : Parent( other ), base( other.base ) {} 339 345 340 346 bool valueOf( Declaration * enumerator, long long int & value ); … … 344 350 virtual void accept( Visitor & v ) const override { v.visit( this ); } 345 351 virtual Declaration * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 346 private: 352 Type * base; 347 353 std::unordered_map< std::string, long long int > enumValues; 354 virtual void print( std::ostream & os, Indenter indent = {} ) const override final; 355 private: 356 // std::unordered_map< std::string, long long int > enumValues; 348 357 virtual const char * typeString() const override; 349 358 };
Note:
See TracChangeset
for help on using the changeset viewer.