Changeset 0720e049 for src/SynTree/Initializer.h
- Timestamp:
- Aug 11, 2017, 10:33:37 AM (8 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Initializer.h
r3d4b23fa r0720e049 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Mar 23 16:12:42201713 // Update Count : 2 011 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Aug 9 10:19:00 2017 13 // Update Count : 22 14 14 // 15 15 16 #ifndef INITIALIZER_H 17 #define INITIALIZER_H 16 #pragma once 18 17 19 18 #include <cassert> … … 28 27 class Designation : public BaseSyntaxNode { 29 28 public: 29 std::list< Expression * > designators; 30 30 31 Designation( const std::list< Expression * > & designators ); 31 32 Designation( const Designation & other ); … … 38 39 virtual Designation * acceptMutator( Mutator &m ) { return m.mutate( this ); } 39 40 virtual void print( std::ostream &os, int indent = 0 ) const; 40 private:41 std::list< Expression * > designators;42 41 }; 43 42 … … 64 63 class SingleInit : public Initializer { 65 64 public: 65 //Constant *value; 66 Expression *value; // has to be a compile-time constant 67 66 68 SingleInit( Expression *value, bool maybeConstructed = false ); 67 69 SingleInit( const SingleInit &other ); … … 75 77 virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); } 76 78 virtual void print( std::ostream &os, int indent = 0 ) const; 77 private:78 //Constant *value;79 Expression *value; // has to be a compile-time constant80 79 }; 81 80 … … 84 83 class ListInit : public Initializer { 85 84 public: 85 std::list<Initializer *> initializers; // order *is* important 86 std::list<Designation *> designations; // order/length is consistent with initializers 87 86 88 ListInit( const std::list<Initializer*> &initializers, 87 89 const std::list<Designation *> &designators = {}, bool maybeConstructed = false ); … … 103 105 virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); } 104 106 virtual void print( std::ostream &os, int indent = 0 ) const; 105 private:106 std::list<Initializer *> initializers; // order *is* important107 std::list<Designation *> designations; // order/length is consistent with initializers108 107 }; 109 108 … … 114 113 class ConstructorInit : public Initializer { 115 114 public: 115 Statement * ctor; 116 Statement * dtor; 117 116 118 ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init ); 117 119 ConstructorInit( const ConstructorInit &other ); … … 131 133 132 134 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_H144 145 143 // Local Variables: // 146 144 // tab-width: 4 //
Note:
See TracChangeset
for help on using the changeset viewer.