Ignore:
Timestamp:
Jul 14, 2017, 5:25:25 PM (7 years ago)
Author:
Andrew Beach <ajbeach@…>
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:
bac5158
Parents:
4b234f0
Message:

That should be all the base code for 'tree structures' to work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r4b234f0 r6ea87486  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tus Jun 27 15:31:00 2017
    13 // Update Count     : 122
     12// Last Modified On : Fri Jul 14 16:59:00 2017
     13// Update Count     : 123
    1414//
    1515
     
    266266        typedef AggregateDecl Parent;
    267267  public:
    268         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 ) {}
     268        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 ), tagged( false ), parent_name( "" ) {}
     269        StructDecl( const std::string &name, const std::string *parent, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( DeclarationNode::Struct ), tagged( true ), parent_name( parent ? *parent : "" ) {}
    269270        StructDecl( const StructDecl &other ) : Parent( other ) {}
    270271
     
    273274        bool is_thread() { return kind == DeclarationNode::Thread; }
    274275
     276        // Tagged/Tree Structure Excetion
     277        bool get_tagged() { return tagged; }
     278        void set_tagged( bool newValue ) { tagged = newValue; }
     279        bool has_parent() { return parent_name != ""; }
     280        std::string get_parentName() { return parent_name; }
     281
    275282        virtual StructDecl *clone() const { return new StructDecl( *this ); }
    276283        virtual void accept( Visitor &v ) { v.visit( this ); }
     
    279286        DeclarationNode::Aggregate kind;
    280287        virtual std::string typeString() const;
     288
     289        bool tagged;
     290        std::string parent_name;
    281291};
    282292
Note: See TracChangeset for help on using the changeset viewer.