Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r312029a re67991f  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 11 16:48:20 2019
    13 // Update Count     : 149
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr May  2 10:47:00 2019
     13// Update Count     : 135
    1414//
    1515
     
    2525#include "Mutator.h"             // for Mutator
    2626#include "Parser/LinkageSpec.h"  // for Spec, Cforall
     27#include "Parser/ParseNode.h"    // for DeclarationNode, DeclarationNode::Ag...
    2728#include "SynTree.h"             // for UniqueId
    2829#include "SynTree/Type.h"        // for Type, Type::StorageClasses, Type::Fu...
     
    193194        std::list< DeclarationWithType* >& get_assertions() { return assertions; }
    194195
    195         virtual const char * typeString() const = 0;
     196        virtual std::string typeString() const = 0;
    196197
    197198        virtual NamedTypeDecl *clone() const override = 0;
     
    236237        TypeDecl * set_sized( bool newValue ) { sized = newValue; return this; }
    237238
    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;
    240241
    241242        virtual TypeDecl *clone() const override { return new TypeDecl( *this ); }
     
    256257        TypedefDecl( const TypedefDecl &other ) : Parent( other ) {}
    257258
    258         virtual const char * typeString() const override;
     259        virtual std::string typeString() const override;
    259260
    260261        virtual TypedefDecl *clone() const override { return new TypedefDecl( *this ); }
     
    268269        typedef Declaration Parent;
    269270  public:
    270         enum Aggregate { Struct, Union, Enum, Exception, Trait, Generator, Coroutine, Monitor, Thread, NoAggregate };
    271         static const char * aggrString( Aggregate aggr );
    272 
    273271        std::list<Declaration*> members;
    274272        std::list<TypeDecl*> parameters;
     
    293291        virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
    294292  protected:
    295         virtual const char * typeString() const = 0;
     293        virtual std::string typeString() const = 0;
    296294};
    297295
     
    299297        typedef AggregateDecl Parent;
    300298  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 ) {}
    302300        StructDecl( const StructDecl &other ) : Parent( other ), kind( other.kind ) {}
    303301
    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; }
    307305
    308306        virtual StructDecl *clone() const override { return new StructDecl( *this ); }
     
    310308        virtual void accept( Visitor & v ) const override { v.visit( this ); }
    311309        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;
    315313};
    316314
     
    326324        virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    327325  private:
    328         virtual const char * typeString() const override;
     326        virtual std::string typeString() const override;
    329327};
    330328
     
    343341  private:
    344342        std::unordered_map< std::string, long long int > enumValues;
    345         virtual const char * typeString() const override;
     343        virtual std::string typeString() const override;
    346344};
    347345
     
    359357        virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    360358  private:
    361         virtual const char * typeString() const override;
     359        virtual std::string typeString() const override;
    362360};
    363361
Note: See TracChangeset for help on using the changeset viewer.