Ignore:
Timestamp:
Aug 9, 2017, 3:21:58 PM (4 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
0ec9229
Parents:
cbce272
Message:

Syntax Nodes give public access to the fields with effective public access.X

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Initializer.h

    rcbce272 r65cdc1e  
    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 : Sat Jul 22 09:52:02 2017
    13 // Update Count     : 21
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Aug  9 10:19:00 2017
     13// Update Count     : 22
    1414//
    1515
     
    2727class Designation : public BaseSyntaxNode {
    2828public:
     29        std::list< Expression * > designators;
     30
    2931        Designation( const std::list< Expression * > & designators );
    3032        Designation( const Designation & other );
     
    3739        virtual Designation * acceptMutator( Mutator &m ) { return m.mutate( this ); }
    3840        virtual void print( std::ostream &os, int indent = 0 ) const;
    39 private:
    40         std::list< Expression * > designators;
    4141};
    4242
     
    6363class SingleInit : public Initializer {
    6464  public:
     65        //Constant *value;
     66        Expression *value;      // has to be a compile-time constant
     67
    6568        SingleInit( Expression *value, bool maybeConstructed = false );
    6669        SingleInit( const SingleInit &other );
     
    7477        virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    7578        virtual void print( std::ostream &os, int indent = 0 ) const;
    76   private:
    77         //Constant *value;
    78         Expression *value;      // has to be a compile-time constant
    7979};
    8080
     
    8383class ListInit : public Initializer {
    8484  public:
     85        std::list<Initializer *> initializers;  // order *is* important
     86        std::list<Designation *> designations;  // order/length is consistent with initializers
     87
    8588        ListInit( const std::list<Initializer*> &initializers,
    8689                          const std::list<Designation *> &designators = {}, bool maybeConstructed = false );
     
    102105        virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    103106        virtual void print( std::ostream &os, int indent = 0 ) const;
    104   private:
    105         std::list<Initializer *> initializers;  // order *is* important
    106         std::list<Designation *> designations;  // order/length is consistent with initializers
    107107};
    108108
     
    113113class ConstructorInit : public Initializer {
    114114  public:
     115        Statement * ctor;
     116        Statement * dtor;
     117
    115118        ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init );
    116119        ConstructorInit( const ConstructorInit &other );
     
    130133
    131134  private:
    132         Statement * ctor;
    133         Statement * dtor;
    134135        // C-style initializer made up of SingleInit and ListInit nodes to use as a fallback
    135136        // if an appropriate constructor definition is not found by the resolver
Note: See TracChangeset for help on using the changeset viewer.