Changes in src/SynTree/Initializer.h [65cdc1e:e4d829b]
- File:
-
- 1 edited
-
src/SynTree/Initializer.h (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Initializer.h
r65cdc1e re4d829b 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Wed Aug 9 10:19:00201713 // Update Count : 2 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 23 16:12:42 2017 13 // Update Count : 20 14 14 // 15 15 16 #pragma once 16 #ifndef INITIALIZER_H 17 #define INITIALIZER_H 17 18 18 19 #include <cassert> … … 27 28 class Designation : public BaseSyntaxNode { 28 29 public: 29 std::list< Expression * > designators;30 31 30 Designation( const std::list< Expression * > & designators ); 32 31 Designation( const Designation & other ); … … 39 38 virtual Designation * acceptMutator( Mutator &m ) { return m.mutate( this ); } 40 39 virtual void print( std::ostream &os, int indent = 0 ) const; 40 private: 41 std::list< Expression * > designators; 41 42 }; 42 43 … … 63 64 class SingleInit : public Initializer { 64 65 public: 65 //Constant *value;66 Expression *value; // has to be a compile-time constant67 68 66 SingleInit( Expression *value, bool maybeConstructed = false ); 69 67 SingleInit( const SingleInit &other ); … … 77 75 virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); } 78 76 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 79 80 }; 80 81 … … 83 84 class ListInit : public Initializer { 84 85 public: 85 std::list<Initializer *> initializers; // order *is* important86 std::list<Designation *> designations; // order/length is consistent with initializers87 88 86 ListInit( const std::list<Initializer*> &initializers, 89 87 const std::list<Designation *> &designators = {}, bool maybeConstructed = false ); … … 105 103 virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); } 106 104 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 107 108 }; 108 109 … … 113 114 class ConstructorInit : public Initializer { 114 115 public: 115 Statement * ctor;116 Statement * dtor;117 118 116 ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init ); 119 117 ConstructorInit( const ConstructorInit &other ); … … 133 131 134 132 private: 133 Statement * ctor; 134 Statement * dtor; 135 135 // C-style initializer made up of SingleInit and ListInit nodes to use as a fallback 136 136 // if an appropriate constructor definition is not found by the resolver … … 141 141 std::ostream & operator<<( std::ostream & out, const Designation * des ); 142 142 143 #endif // INITIALIZER_H 144 143 145 // Local Variables: // 144 146 // tab-width: 4 //
Note:
See TracChangeset
for help on using the changeset viewer.