Changeset f135b50 for src/SynTree
- Timestamp:
- Feb 28, 2022, 3:41:44 AM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 786c438
- Parents:
- a8ef59e
- Location:
- src/SynTree
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
ra8ef59e rf135b50 119 119 public: 120 120 Type * type; 121 Initializer * init; 121 Initializer * init; // For Enum, the init is a pointer that contain the enum value; see Parser::TypeData::buildEnum 122 122 Expression * bitfieldWidth; 123 123 … … 335 335 typedef AggregateDecl Parent; 336 336 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 ) {} 337 EnumDecl( const std::string & name, 338 const std::list< Attribute * > & attributes = std::list< class Attribute * >(), 339 LinkageSpec::Spec linkage = LinkageSpec::Cforall, 340 Type * baseType = nullptr ) : Parent( name, attributes, linkage ) , base( baseType ){} 338 341 EnumDecl( const EnumDecl & other ) : Parent( other ) {} 339 342 … … 344 347 virtual void accept( Visitor & v ) const override { v.visit( this ); } 345 348 virtual Declaration * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 346 private: 349 Type * base; 347 350 std::unordered_map< std::string, long long int > enumValues; 351 private: 352 // std::unordered_map< std::string, long long int > enumValues; 348 353 virtual const char * typeString() const override; 349 354 }; -
src/SynTree/Visitor.h
ra8ef59e rf135b50 35 35 virtual void visit( UnionDecl * node ) { visit( const_cast<const UnionDecl *>(node) ); } 36 36 virtual void visit( const UnionDecl * aggregateDecl ) = 0; 37 virtual void visit( EnumDecl * node ) { visit( const_cast<const EnumDecl *>(node) ); } 37 virtual void visit( EnumDecl * node ) { visit( const_cast<const EnumDecl *>(node) ); } // Marker 1 38 38 virtual void visit( const EnumDecl * aggregateDecl ) = 0; 39 39 virtual void visit( TraitDecl * node ) { visit( const_cast<const TraitDecl *>(node) ); } … … 190 190 virtual void visit( UnionInstType * node ) { visit( const_cast<const UnionInstType *>(node) ); } 191 191 virtual void visit( const UnionInstType * aggregateUseType ) = 0; 192 virtual void visit( EnumInstType * node ) { visit( const_cast<const EnumInstType *>(node) ); } 192 virtual void visit( EnumInstType * node ) { visit( const_cast<const EnumInstType *>(node) ); } // Marker 2 193 193 virtual void visit( const EnumInstType * aggregateUseType ) = 0; 194 194 virtual void visit( TraitInstType * node ) { visit( const_cast<const TraitInstType *>(node) ); }
Note: See TracChangeset
for help on using the changeset viewer.