Ignore:
Timestamp:
Aug 11, 2017, 10:33:37 AM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
54cd58b0
Parents:
3d4b23fa (diff), 59a75cb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Initializer.h

    r3d4b23fa r0720e049  
    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 : Thu Mar 23 16:12:42 2017
    13 // Update Count     : 20
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Aug  9 10:19:00 2017
     13// Update Count     : 22
    1414//
    1515
    16 #ifndef INITIALIZER_H
    17 #define INITIALIZER_H
     16#pragma once
    1817
    1918#include <cassert>
     
    2827class Designation : public BaseSyntaxNode {
    2928public:
     29        std::list< Expression * > designators;
     30
    3031        Designation( const std::list< Expression * > & designators );
    3132        Designation( const Designation & other );
     
    3839        virtual Designation * acceptMutator( Mutator &m ) { return m.mutate( this ); }
    3940        virtual void print( std::ostream &os, int indent = 0 ) const;
    40 private:
    41         std::list< Expression * > designators;
    4241};
    4342
     
    6463class SingleInit : public Initializer {
    6564  public:
     65        //Constant *value;
     66        Expression *value;      // has to be a compile-time constant
     67
    6668        SingleInit( Expression *value, bool maybeConstructed = false );
    6769        SingleInit( const SingleInit &other );
     
    7577        virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    7678        virtual void print( std::ostream &os, int indent = 0 ) const;
    77   private:
    78         //Constant *value;
    79         Expression *value;      // has to be a compile-time constant
    8079};
    8180
     
    8483class ListInit : public Initializer {
    8584  public:
     85        std::list<Initializer *> initializers;  // order *is* important
     86        std::list<Designation *> designations;  // order/length is consistent with initializers
     87
    8688        ListInit( const std::list<Initializer*> &initializers,
    8789                          const std::list<Designation *> &designators = {}, bool maybeConstructed = false );
     
    103105        virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    104106        virtual void print( std::ostream &os, int indent = 0 ) const;
    105   private:
    106         std::list<Initializer *> initializers;  // order *is* important
    107         std::list<Designation *> designations;  // order/length is consistent with initializers
    108107};
    109108
     
    114113class ConstructorInit : public Initializer {
    115114  public:
     115        Statement * ctor;
     116        Statement * dtor;
     117
    116118        ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init );
    117119        ConstructorInit( const ConstructorInit &other );
     
    131133
    132134  private:
    133         Statement * ctor;
    134         Statement * dtor;
    135135        // C-style initializer made up of SingleInit and ListInit nodes to use as a fallback
    136136        // if an appropriate constructor definition is not found by the resolver
     
    141141std::ostream & operator<<( std::ostream & out, const Designation * des );
    142142
    143 #endif // INITIALIZER_H
    144 
    145143// Local Variables: //
    146144// tab-width: 4 //
Note: See TracChangeset for help on using the changeset viewer.