Ignore:
Timestamp:
Mar 17, 2017, 5:34:05 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
89d129c
Parents:
615a096
Message:

support coroutine, monitor, thread as kind of structure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r615a096 r409433da  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 08:34:11 2017
    13 // Update Count     : 118
     12// Last Modified On : Fri Mar 17 16:05:08 2017
     13// Update Count     : 121
    1414//
    1515
     
    255255        typedef AggregateDecl Parent;
    256256  public:
    257         StructDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes ) {}
     257        StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes ), kind( kind ) {}
    258258        StructDecl( const StructDecl &other ) : Parent( other ) {}
    259259
     260        bool is_coroutine() { return kind == DeclarationNode::Coroutine; }
     261        bool is_monitor() { return kind == DeclarationNode::Monitor; }
     262        bool is_thread() { return kind == DeclarationNode::Thread; }
     263
    260264        virtual StructDecl *clone() const { return new StructDecl( *this ); }
    261265        virtual void accept( Visitor &v ) { v.visit( this ); }
    262266        virtual Declaration *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    263267  private:
     268        DeclarationNode::Aggregate kind;
    264269        virtual std::string typeString() const;
    265270};
Note: See TracChangeset for help on using the changeset viewer.