Changeset 937e51d for src/SynTree
- Timestamp:
- Jun 26, 2015, 4:00:26 PM (11 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 0df292b, e0ff3e6
- Parents:
- eb50842 (diff), 1869adf (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. - Location:
- src/SynTree
- Files:
-
- 21 edited
-
AggregateDecl.cc (modified) (2 diffs)
-
ArrayType.cc (modified) (4 diffs)
-
BasicType.cc (modified) (1 diff)
-
CompoundStmt.cc (modified) (2 diffs)
-
Constant.cc (modified) (3 diffs)
-
DeclStmt.cc (modified) (2 diffs)
-
Declaration.cc (modified) (3 diffs)
-
Declaration.h (modified) (11 diffs)
-
DeclarationWithType.cc (modified) (2 diffs)
-
Expression.cc (modified) (14 diffs)
-
Expression.h (modified) (2 diffs)
-
FunctionDecl.cc (modified) (7 diffs)
-
Mutator.h (modified) (2 diffs)
-
NamedTypeDecl.cc (modified) (4 diffs)
-
ObjectDecl.cc (modified) (5 diffs)
-
ReferenceToType.cc (modified) (2 diffs)
-
Statement.cc (modified) (18 diffs)
-
Statement.h (modified) (21 diffs)
-
Type.h (modified) (4 diffs)
-
TypeDecl.cc (modified) (2 diffs)
-
module.mk (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/AggregateDecl.cc
reb50842 r937e51d 10 10 // Created On : Sun May 17 23:56:39 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 19 16:52:08201513 // Update Count : 512 // Last Modified On : Sat Jun 13 08:12:49 2015 13 // Update Count : 6 14 14 // 15 15 … … 19 19 20 20 21 AggregateDecl::AggregateDecl( const std::string &name ) : Parent( name, Declaration ::NoStorageClass, LinkageSpec::Cforall ) {21 AggregateDecl::AggregateDecl( const std::string &name ) : Parent( name, DeclarationNode::NoStorageClass, LinkageSpec::Cforall ) { 22 22 } 23 23 -
src/SynTree/ArrayType.cc
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 07:52:08 201513 // Update Count : 212 // Last Modified On : Sat Jun 6 14:11:48 2015 13 // Update Count : 9 14 14 // 15 15 … … 25 25 26 26 ArrayType::ArrayType( const ArrayType &other ) 27 : Type( other ), base( maybeClone( other.base ) ), dimension( maybeClone( other.dimension ) ),28 isVarLen( other.isVarLen ), isStatic( other.isStatic ) {27 : Type( other ), base( maybeClone( other.base ) ), dimension( maybeClone( other.dimension ) ), 28 isVarLen( other.isVarLen ), isStatic( other.isStatic ) { 29 29 } 30 30 … … 43 43 } else if ( dimension ) { 44 44 os << "array of "; 45 dimension->print( os, indent );46 45 } else { 47 46 os << "open array of "; … … 49 48 if ( base ) { 50 49 base->print( os, indent ); 50 } // if 51 if ( dimension ) { 52 os << "with dimension of "; 53 dimension->print( os, indent ); 51 54 } // if 52 55 } -
src/SynTree/BasicType.cc
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 07:55:16 201513 // Update Count : 112 // Last Modified On : Sun Jun 7 08:44:36 2015 13 // Update Count : 5 14 14 // 15 15 -
src/SynTree/CompoundStmt.cc
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 08:11:02201513 // Update Count : 112 // Last Modified On : Tue Jun 23 11:37:49 2015 13 // Update Count : 3 14 14 // 15 15 … … 33 33 } 34 34 35 void CompoundStmt::print( std::ostream &os, int indent ) {36 os << "\r" << string(indent, ' ') << "CompoundStmt" << endl ;37 printAll( kids, os, indent +2 );35 void CompoundStmt::print( std::ostream &os, int indent ) const { 36 os << string( indent, ' ' ) << "CompoundStmt" << endl ; 37 printAll( kids, os, indent + 2 ); 38 38 } 39 39 -
src/SynTree/Constant.cc
reb50842 r937e51d 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 : Mon May 18 08:13:25201513 // Update Count : 111 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Jun 10 14:41:03 2015 13 // Update Count : 8 14 14 // 15 15 … … 20 20 #include "Type.h" 21 21 22 Constant::Constant( Type * _type, std::string _value ) : type(_type), value(_value) {}22 Constant::Constant( Type *type_, std::string value_ ) : type( type_ ), value( value_ ) {} 23 23 24 24 Constant::~Constant() {} … … 27 27 28 28 void Constant::print( std::ostream &os ) const { 29 os << value;29 os << "(" << value; 30 30 if ( type ) { 31 os << " (type: ";31 os << ": "; 32 32 type->print( os ); 33 os << ")";34 33 } // if 34 os << ")"; 35 35 } 36 36 -
src/SynTree/DeclStmt.cc
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 08:16:03201513 // Update Count : 212 // Last Modified On : Tue Jun 23 11:38:15 2015 13 // Update Count : 4 14 14 // 15 15 … … 28 28 } 29 29 30 void DeclStmt::print( std::ostream &os, int indent ) { 30 void DeclStmt::print( std::ostream &os, int indent ) const { 31 assert( decl != 0 ); 31 32 os << "Declaration of "; 32 if ( decl ) { 33 decl->print( os, indent ); 34 } // if 33 decl->print( os, indent ); 35 34 } 36 35 -
src/SynTree/Declaration.cc
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 08:18:35201513 // Update Count : 212 // Last Modified On : Sat Jun 13 08:07:20 2015 13 // Update Count : 9 14 14 // 15 15 … … 22 22 #include "utility.h" 23 23 24 const char* Declaration::storageClassName[] = { "", "auto", "static", "extern", "register" };25 26 24 static UniqueId lastUniqueId = 0; 27 25 typedef std::map< UniqueId, Declaration* > IdMapType; 28 26 static IdMapType idMap; 29 27 30 Declaration::Declaration( const std::string &name, StorageClass sc, LinkageSpec::Type linkage )31 : name( name ), storageClass( sc ), linkage( linkage ), uniqueId( 0 ) {28 Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage ) 29 : name( name ), storageClass( sc ), linkage( linkage ), uniqueId( 0 ) { 32 30 } 33 31 34 32 Declaration::Declaration( const Declaration &other ) 35 : name( other.name ), storageClass( other.storageClass ), linkage( other.linkage ), uniqueId( other.uniqueId ) {33 : name( other.name ), storageClass( other.storageClass ), linkage( other.linkage ), uniqueId( other.uniqueId ) { 36 34 } 37 35 … … 44 42 } 45 43 46 /* static class method */47 44 Declaration *Declaration::declFromId( UniqueId id ) { 48 45 IdMapType::const_iterator i = idMap.find( id ); 49 if ( i != idMap.end() ) { 50 return i->second; 51 } else { 52 return 0; 53 } // if 46 return i != idMap.end() ? i->second : 0; 54 47 } 55 48 56 /* static class method */57 49 void Declaration::dumpIds( std::ostream &os ) { 58 50 for ( IdMapType::const_iterator i = idMap.begin(); i != idMap.end(); ++i ) { -
src/SynTree/Declaration.h
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 08:46:25201513 // Update Count : 2 12 // Last Modified On : Sat Jun 13 09:10:31 2015 13 // Update Count : 25 14 14 // 15 15 … … 21 21 #include "Mutator.h" 22 22 #include "Parser/LinkageSpec.h" 23 #include "Parser/ParseNode.h" 23 24 24 25 class Declaration { 25 26 public: 26 enum StorageClass { 27 NoStorageClass, 28 Extern, 29 Static, 30 Auto, 31 Register, 32 Inline, 33 Fortran, 34 }; 35 36 Declaration( const std::string &name, StorageClass sc, LinkageSpec::Type linkage ); 27 Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage ); 37 28 Declaration( const Declaration &other ); 38 29 virtual ~Declaration(); 39 30 40 std::stringget_name() const { return name; }31 const std::string &get_name() const { return name; } 41 32 void set_name( std::string newValue ) { name = newValue; } 42 StorageClass get_storageClass() const { return storageClass; }43 void set_storageClass( StorageClass newValue ) { storageClass = newValue; }33 DeclarationNode::StorageClass get_storageClass() const { return storageClass; } 34 void set_storageClass( DeclarationNode::StorageClass newValue ) { storageClass = newValue; } 44 35 LinkageSpec::Type get_linkage() const { return linkage; } 45 36 void set_linkage( LinkageSpec::Type newValue ) { linkage = newValue; } … … 53 44 virtual void printShort( std::ostream &os, int indent = 0 ) const = 0; 54 45 55 static const char* storageClassName[];56 57 46 static void dumpIds( std::ostream &os ); 58 47 static Declaration *declFromId( UniqueId id ); 59 48 private: 60 49 std::string name; 61 StorageClass storageClass;50 DeclarationNode::StorageClass storageClass; 62 51 LinkageSpec::Type linkage; 63 52 UniqueId uniqueId; … … 66 55 class DeclarationWithType : public Declaration { 67 56 public: 68 DeclarationWithType( const std::string &name, StorageClass sc, LinkageSpec::Type linkage );57 DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage ); 69 58 DeclarationWithType( const DeclarationWithType &other ); 70 59 virtual ~DeclarationWithType(); … … 86 75 typedef DeclarationWithType Parent; 87 76 public: 88 ObjectDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init );77 ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init ); 89 78 ObjectDecl( const ObjectDecl &other ); 90 79 virtual ~ObjectDecl(); … … 112 101 typedef DeclarationWithType Parent; 113 102 public: 114 FunctionDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline);103 FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn ); 115 104 FunctionDecl( const FunctionDecl &other ); 116 105 virtual ~FunctionDecl(); … … 123 112 CompoundStmt *get_statements() const { return statements; } 124 113 void set_statements( CompoundStmt *newValue ) { statements = newValue; } 125 //bool get_isInline() const { return isInline; }126 // void set_isInline( bool newValue ) { isInline = newValue; }114 bool get_isInline() const { return isInline; } 115 bool get_isNoreturn() const { return isNoreturn; } 127 116 std::list< std::string >& get_oldIdents() { return oldIdents; } 128 117 std::list< Declaration* >& get_oldDecls() { return oldDecls; } … … 136 125 FunctionType *type; 137 126 CompoundStmt *statements; 138 bool isInline ;127 bool isInline, isNoreturn; 139 128 std::list< std::string > oldIdents; 140 129 std::list< Declaration* > oldDecls; … … 144 133 typedef Declaration Parent; 145 134 public: 146 NamedTypeDecl( const std::string &name, StorageClass sc, Type *type );135 NamedTypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type ); 147 136 NamedTypeDecl( const TypeDecl &other ); 148 137 virtual ~NamedTypeDecl(); … … 169 158 enum Kind { Any, Dtype, Ftype }; 170 159 171 TypeDecl( const std::string &name, StorageClass sc, Type *type, Kind kind );160 TypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type, Kind kind ); 172 161 TypeDecl( const TypeDecl &other ); 173 162 … … 185 174 typedef NamedTypeDecl Parent; 186 175 public: 187 TypedefDecl( const std::string &name, StorageClass sc, Type *type ) : Parent( name, sc, type ) {}176 TypedefDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type ) : Parent( name, sc, type ) {} 188 177 TypedefDecl( const TypedefDecl &other ) : Parent( other ) {} 189 178 -
src/SynTree/DeclarationWithType.cc
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 08:20:23201513 // Update Count : 212 // Last Modified On : Sat Jun 13 08:08:07 2015 13 // Update Count : 3 14 14 // 15 15 … … 18 18 #include "utility.h" 19 19 20 DeclarationWithType::DeclarationWithType( const std::string &name, StorageClass sc, LinkageSpec::Type linkage )20 DeclarationWithType::DeclarationWithType( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage ) 21 21 : Declaration( name, sc, linkage ) { 22 22 } -
src/SynTree/Expression.cc
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 08:27:07201513 // Update Count : 212 // Last Modified On : Sun Jun 7 08:40:46 2015 13 // Update Count : 16 14 14 // 15 15 … … 50 50 } 51 51 52 void Expression::print( std::ostream &os, int indent) const {52 void Expression::print( std::ostream &os, int indent ) const { 53 53 if ( env ) { 54 os << std::string( indent, ' ') << "with environment:" << std::endl;54 os << std::string( indent, ' ' ) << "with environment:" << std::endl; 55 55 env->print( os, indent+2 ); 56 56 } // if 57 57 58 58 if ( argName ) { 59 os << std::string( indent, ' ') << "with designator:";59 os << std::string( indent, ' ' ) << "with designator:"; 60 60 argName->print( os, indent+2 ); 61 61 } // if … … 72 72 73 73 void ConstantExpr::print( std::ostream &os, int indent ) const { 74 os << std::string(indent, ' ') << "Constant Expression: " ; 75 constant.print(os); 76 os << std::endl; 74 os << "constant expression " ; 75 constant.print( os ); 77 76 Expression::print( os, indent ); 78 77 } … … 93 92 94 93 void VariableExpr::print( std::ostream &os, int indent ) const { 95 os << std::string( indent, ' ') << "Variable Expression: ";94 os << std::string( indent, ' ' ) << "Variable Expression: "; 96 95 97 96 Declaration *decl = get_var(); … … 122 121 123 122 void SizeofExpr::print( std::ostream &os, int indent) const { 124 os << std::string( indent, ' ') << "Sizeof Expression on: ";123 os << std::string( indent, ' ' ) << "Sizeof Expression on: "; 125 124 126 125 if (isType) … … 152 151 153 152 void AttrExpr::print( std::ostream &os, int indent) const { 154 os << std::string( indent, ' ') << "Attr ";153 os << std::string( indent, ' ' ) << "Attr "; 155 154 attr->print( os, indent + 2 ); 156 155 if ( isType || expr ) { … … 184 183 185 184 void CastExpr::print( std::ostream &os, int indent ) const { 186 os << std::string( indent, ' ') << "Cast of:" << std::endl;185 os << std::string( indent, ' ' ) << "Cast of:" << std::endl; 187 186 arg->print(os, indent+2); 188 os << std::endl << std::string( indent, ' ') << "to:" << std::endl;187 os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl; 189 188 if ( results.empty() ) { 190 os << std::string( indent+2, ' ') << "nothing" << std::endl;189 os << std::string( indent+2, ' ' ) << "nothing" << std::endl; 191 190 } else { 192 191 printAll(results, os, indent+2); … … 207 206 208 207 void UntypedMemberExpr::print( std::ostream &os, int indent ) const { 209 os << std::string( indent, ' ') << "Member Expression, with field: " << get_member();208 os << std::string( indent, ' ' ) << "Member Expression, with field: " << get_member(); 210 209 211 210 Expression *agg = get_aggregate(); 212 os << std::string( indent, ' ') << "from aggregate: ";211 os << std::string( indent, ' ' ) << "from aggregate: "; 213 212 if (agg != 0) agg->print(os, indent + 2); 214 213 Expression::print( os, indent ); … … 234 233 235 234 void MemberExpr::print( std::ostream &os, int indent ) const { 236 os << std::string( indent, ' ') << "Member Expression, with field: " << std::endl;235 os << std::string( indent, ' ' ) << "Member Expression, with field: " << std::endl; 237 236 238 237 assert( member ); 239 os << std::string( indent + 2, ' ');238 os << std::string( indent + 2, ' ' ); 240 239 member->print( os, indent + 2 ); 241 240 os << std::endl; 242 241 243 242 Expression *agg = get_aggregate(); 244 os << std::string( indent, ' ') << "from aggregate: " << std::endl;243 os << std::string( indent, ' ' ) << "from aggregate: " << std::endl; 245 244 if (agg != 0) agg->print(os, indent + 2); 246 245 Expression::print( os, indent ); … … 261 260 262 261 void UntypedExpr::print( std::ostream &os, int indent ) const { 263 os << std::string( indent, ' ') << "Applying untyped: " << std::endl;262 os << std::string( indent, ' ' ) << "Applying untyped: " << std::endl; 264 263 function->print(os, indent + 4); 265 os << "\r" << std::string(indent, ' ') << "...to: " << std::endl;264 os << std::string( indent, ' ' ) << "...to: " << std::endl; 266 265 printArgs(os, indent + 4); 267 266 Expression::print( os, indent ); … … 282 281 283 282 void NameExpr::print( std::ostream &os, int indent ) const { 284 os << std::string( indent, ' ') << "Name: " << get_name() << std::endl;283 os << std::string( indent, ' ' ) << "Name: " << get_name() << std::endl; 285 284 Expression::print( os, indent ); 286 285 } … … 301 300 302 301 void LogicalExpr::print( std::ostream &os, int indent )const { 303 os << std::string( indent, ' ') << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";302 os << std::string( indent, ' ' ) << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: "; 304 303 arg1->print(os); 305 304 os << " and "; … … 323 322 324 323 void ConditionalExpr::print( std::ostream &os, int indent ) const { 325 os << std::string( indent, ' ') << "Conditional expression on: " << std::endl;324 os << std::string( indent, ' ' ) << "Conditional expression on: " << std::endl; 326 325 arg1->print( os, indent+2 ); 327 os << std::string( indent, ' ') << "First alternative:" << std::endl;326 os << std::string( indent, ' ' ) << "First alternative:" << std::endl; 328 327 arg2->print( os, indent+2 ); 329 os << std::string( indent, ' ') << "Second alternative:" << std::endl;328 os << std::string( indent, ' ' ) << "Second alternative:" << std::endl; 330 329 arg3->print( os, indent+2 ); 331 330 os << std::endl; … … 334 333 335 334 void UntypedValofExpr::print( std::ostream &os, int indent ) const { 336 os << std::string( indent, ' ') << "Valof Expression: " << std::endl;335 os << std::string( indent, ' ' ) << "Valof Expression: " << std::endl; 337 336 if ( get_body() != 0 ) 338 337 get_body()->print( os, indent + 2 ); -
src/SynTree/Expression.h
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 08:46:15201513 // Update Count : 312 // Last Modified On : Sun Jun 7 22:03:44 2015 13 // Update Count : 4 14 14 // 15 15 … … 125 125 virtual ~NameExpr(); 126 126 127 std::stringget_name() const { return name; }127 const std::string &get_name() const { return name; } 128 128 void set_name( std::string newValue ) { name = newValue; } 129 129 -
src/SynTree/FunctionDecl.cc
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu May 21 21:31:16201513 // Update Count : 1 112 // Last Modified On : Sat Jun 13 09:10:32 2015 13 // Update Count : 16 14 14 // 15 15 … … 21 21 #include "utility.h" 22 22 23 FunctionDecl::FunctionDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline)24 : Parent( name, sc, linkage ), type( type ), statements( statements ), isInline( isInline ) {23 FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn ) 24 : Parent( name, sc, linkage ), type( type ), statements( statements ), isInline( isInline ), isNoreturn( isNoreturn ) { 25 25 // this is a brazen hack to force the function "main" to have C linkage 26 26 if ( name == "main" ) { … … 30 30 31 31 FunctionDecl::FunctionDecl( const FunctionDecl &other ) 32 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ), isInline( other.isInline) {32 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ), isInline( other.isInline ), isNoreturn( other.isNoreturn ) { 33 33 } 34 34 … … 52 52 53 53 if ( get_name() != "" ) { 54 os << get_name() << ": a";54 os << get_name() << ": "; 55 55 } // if 56 56 if ( get_linkage() != LinkageSpec::Cforall ) { … … 60 60 os << "inline "; 61 61 } // if 62 if ( get_storageClass() != NoStorageClass ) { 63 os << storageClassName[ get_storageClass() ] << ' '; 62 if ( isNoreturn ) { 63 os << "_Noreturn "; 64 } // if 65 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 66 os << DeclarationNode::storageName[ get_storageClass() ] << ' '; 64 67 } // if 65 68 if ( get_type() ) { … … 70 73 71 74 if ( ! oldIdents.empty() ) { 72 os << string( indent +2, ' ' ) << "with parameter names" << endl;75 os << string( indent + 2, ' ' ) << "with parameter names" << endl; 73 76 for ( std::list< std::string >::const_iterator i = oldIdents.begin(); i != oldIdents.end(); ++i ) { 74 os << string( indent +4, ' ' ) << *i << endl;77 os << string( indent + 4, ' ' ) << *i << endl; 75 78 } // for 76 79 } // if 77 80 78 81 if ( ! oldDecls.empty() ) { 79 os << string( indent +2, ' ' ) << "with parameter declarations" << endl;80 printAll( oldDecls, os, indent +4 );82 os << string( indent + 2, ' ' ) << "with parameter declarations" << endl; 83 printAll( oldDecls, os, indent + 4 ); 81 84 } // if 82 85 if ( statements ) { 83 os << string( indent +2, ' ' ) << "with body " << endl;84 statements->print( os, indent +4 );86 os << string( indent + 2, ' ' ) << "with body " << endl; 87 statements->print( os, indent + 4 ); 85 88 } // if 86 89 } … … 91 94 92 95 if ( get_name() != "" ) { 93 os << get_name() << ": a";96 os << get_name() << ": "; 94 97 } // if 95 98 if ( isInline ) { 96 99 os << "inline "; 97 100 } // if 98 if ( get_storageClass() != NoStorageClass ) { 99 os << storageClassName[ get_storageClass() ] << ' '; 101 if ( isNoreturn ) { 102 os << "_Noreturn "; 103 } // if 104 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 105 os << DeclarationNode::storageName[ get_storageClass() ] << ' '; 100 106 } // if 101 107 if ( get_type() ) { -
src/SynTree/Mutator.h
reb50842 r937e51d 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 : Mon May 18 10:12:28 201513 // Update Count : 311 // Last Modified By : Rob Schluntz 12 // Last Modified On : Fri May 29 16:34:08 2015 13 // Update Count : 4 14 14 // 15 15 #include <cassert> … … 104 104 assert( newnode ); 105 105 return newnode; 106 /// return tree->acceptMutator( mutator );107 106 } else { 108 107 return 0; -
src/SynTree/NamedTypeDecl.cc
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 10:13:19201513 // Update Count : 112 // Last Modified On : Sat Jun 13 08:13:55 2015 13 // Update Count : 3 14 14 // 15 15 … … 18 18 #include "utility.h" 19 19 20 NamedTypeDecl::NamedTypeDecl( const std::string &name, StorageClass sc, Type *base )20 NamedTypeDecl::NamedTypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *base ) 21 21 : Parent( name, sc, LinkageSpec::Cforall ), base( base ) {} 22 22 … … 37 37 38 38 if ( get_name() != "" ) { 39 os << get_name() << ": a";39 os << get_name() << ": "; 40 40 } // if 41 if ( get_storageClass() != NoStorageClass ) {42 os << storageClassName[ get_storageClass() ] << ' ';41 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 42 os << DeclarationNode::storageName[ get_storageClass() ] << ' '; 43 43 } // if 44 44 os << typeString(); … … 61 61 62 62 if ( get_name() != "" ) { 63 os << get_name() << ": a";63 os << get_name() << ": "; 64 64 } // if 65 if ( get_storageClass() != NoStorageClass ) {66 os << storageClassName[ get_storageClass() ] << ' ';65 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 66 os << DeclarationNode::storageName[ get_storageClass() ] << ' '; 67 67 } // if 68 68 os << typeString(); -
src/SynTree/ObjectDecl.cc
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 10:14:18201513 // Update Count : 212 // Last Modified On : Sat Jun 13 08:10:16 2015 13 // Update Count : 15 14 14 // 15 15 … … 20 20 #include "utility.h" 21 21 22 ObjectDecl::ObjectDecl( const std::string &name, StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init )22 ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init ) 23 23 : Parent( name, sc, linkage ), type( type ), init( init ), bitfieldWidth( bitfieldWidth ) { 24 24 } … … 36 36 void ObjectDecl::print( std::ostream &os, int indent ) const { 37 37 if ( get_name() != "" ) { 38 os << get_name() << ": a";38 os << get_name() << ": "; 39 39 } // if 40 40 … … 43 43 } // if 44 44 45 if ( get_storageClass() != NoStorageClass ) {46 os << storageClassName[ get_storageClass() ] << ' ';45 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 46 os << DeclarationNode::storageName[ get_storageClass() ] << ' '; 47 47 } // if 48 48 … … 65 65 66 66 void ObjectDecl::printShort( std::ostream &os, int indent ) const { 67 #if 0 68 if ( get_mangleName() != "") { 69 os << get_mangleName() << ": "; 70 } else 71 #endif 67 72 if ( get_name() != "" ) { 68 os << get_name() << ": a";73 os << get_name() << ": "; 69 74 } // if 70 75 71 if ( get_storageClass() != NoStorageClass ) {72 os << storageClassName[ get_storageClass() ] << ' ';76 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { 77 os << DeclarationNode::storageName[ get_storageClass() ] << ' '; 73 78 } // if 74 79 -
src/SynTree/ReferenceToType.cc
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 19 16:52:40201513 // Update Count : 312 // Last Modified On : Sun Jun 7 08:31:48 2015 13 // Update Count : 4 14 14 // 15 15 … … 101 101 102 102 Type::print( os, indent ); 103 os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " afunction type) ";103 os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " function type) "; 104 104 if ( ! parameters.empty() ) { 105 105 os << endl << std::string( indent, ' ' ) << "with parameters" << endl; -
src/SynTree/Statement.cc
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 10:55:19 201513 // Update Count : 2 12 // Last Modified On : Tue Jun 23 11:42:09 2015 13 // Update Count : 21 14 14 // 15 15 … … 30 30 Statement::Statement( std::list<Label> _labels ) : labels(_labels ) {} 31 31 32 void Statement::print( std::ostream &, int indent ) {}32 void Statement::print( std::ostream &, int indent ) const {} 33 33 34 34 Statement::~Statement() {} … … 38 38 ExprStmt::~ExprStmt() {} 39 39 40 void ExprStmt::print( std::ostream &os, int indent ) {41 os << "\r" << string(indent, ' ') << "Expression Statement:" << endl;40 void ExprStmt::print( std::ostream &os, int indent ) const { 41 os << string( indent, ' ' ) << "Expression Statement:" << endl; 42 42 expr->print( os, indent + 2 ); 43 43 } … … 46 46 47 47 BranchStmt::BranchStmt( std::list<Label> labels, Label _target, Type _type ) throw ( SemanticError ) : 48 Statement( labels ), target(_target ), type(_type ) {48 Statement( labels ), originalTarget(_target ), target(_target ), type(_type ) { 49 49 //actually this is a syntactic error signaled by the parser 50 50 if ( type == BranchStmt::Goto && target.size() == 0 ) … … 58 58 } 59 59 60 void BranchStmt::print( std::ostream &os, int indent ) {61 os << "\r" << string( indent, ' ') << "Branch (" << brType[type] << ")" << endl ;60 void BranchStmt::print( std::ostream &os, int indent ) const { 61 os << string( indent, ' ' ) << "Branch (" << brType[type] << ")" << endl ; 62 62 } 63 63 … … 68 68 } 69 69 70 void ReturnStmt::print( std::ostream &os, int indent ) {71 os << "\r" << std::string( indent, ' ') << string ( isThrow? "Throw":"Return" ) << " Statement, returning: ";70 void ReturnStmt::print( std::ostream &os, int indent ) const { 71 os << std::string( indent, ' ' ) << string ( isThrow? "Throw":"Return" ) << " Statement, returning: "; 72 72 if ( expr != 0 ) expr->print( os ); 73 73 os << endl; … … 79 79 IfStmt::~IfStmt() {} 80 80 81 void IfStmt::print( std::ostream &os, int indent ) {82 os << "\r" << string( indent, ' ') << "If on condition: " << endl ;81 void IfStmt::print( std::ostream &os, int indent ) const { 82 os << string( indent, ' ' ) << "If on condition: " << endl ; 83 83 condition->print( os, indent + 4 ); 84 84 85 os << string( indent, ' ' ) << ".... and branches: " << endl;85 os << string( indent, ' ' ) << ".... and branches: " << endl; 86 86 87 87 thenPart->print( os, indent + 4 ); … … 103 103 void SwitchStmt::add_case( CaseStmt *c ) {} 104 104 105 void SwitchStmt::print( std::ostream &os, int indent ) {106 os << "\r" << string( indent, ' ') << "Switch on condition: ";105 void SwitchStmt::print( std::ostream &os, int indent ) const { 106 os << string( indent, ' ' ) << "Switch on condition: "; 107 107 condition->print( os ); 108 108 os << endl; 109 109 110 110 // branches 111 std::list<Statement *>:: iterator i;111 std::list<Statement *>::const_iterator i; 112 112 for ( i = branches.begin(); i != branches.end(); i++) 113 (*i )->print( os, indent + 4 );113 (*i)->print( os, indent + 4 ); 114 114 115 115 //for_each( branches.begin(), branches.end(), mem_fun( bind1st(&Statement::print ), os )); … … 126 126 } 127 127 128 void CaseStmt::print( std::ostream &os, int indent ) { 129 os << "\r" << string( indent, ' '); 130 131 if ( isDefault()) 128 CaseStmt * CaseStmt::makeDefault( std::list<Label> labels, std::list<Statement *> branches ) { 129 return new CaseStmt( labels, 0, branches, true ); 130 } 131 132 void CaseStmt::print( std::ostream &os, int indent ) const { 133 os << string( indent, ' ' ); 134 135 if ( isDefault() ) 132 136 os << "Default "; 133 137 else { … … 138 142 os << endl; 139 143 140 std::list<Statement *>:: iterator i;144 std::list<Statement *>::const_iterator i; 141 145 for ( i = stmts.begin(); i != stmts.end(); i++) 142 146 (*i )->print( os, indent + 4 ); … … 154 158 void ChooseStmt::add_case( CaseStmt *c ) {} 155 159 156 void ChooseStmt::print( std::ostream &os, int indent ) {157 os << "\r" << string( indent, ' ') << "Choose on condition: ";160 void ChooseStmt::print( std::ostream &os, int indent ) const { 161 os << string( indent, ' ' ) << "Choose on condition: "; 158 162 condition->print( os ); 159 163 os << endl; 160 164 161 165 // branches 162 std::list<Statement *>:: iterator i;166 std::list<Statement *>::const_iterator i; 163 167 for ( i = branches.begin(); i != branches.end(); i++) 164 168 (*i )->print( os, indent + 4 ); … … 167 171 } 168 172 169 void FallthruStmt::print( std::ostream &os, int indent ) {170 os << "\r" << string( indent, ' ') << "Fall-through statement" << endl;173 void FallthruStmt::print( std::ostream &os, int indent ) const { 174 os << string( indent, ' ' ) << "Fall-through statement" << endl; 171 175 } 172 176 … … 179 183 } 180 184 181 void WhileStmt::print( std::ostream &os, int indent ) {182 os << "\r" << string( indent, ' ') << "While on condition: " << endl ;185 void WhileStmt::print( std::ostream &os, int indent ) const { 186 os << string( indent, ' ' ) << "While on condition: " << endl ; 183 187 condition->print( os, indent + 4 ); 184 188 185 os << string( indent, ' ' ) << ".... with body: " << endl;189 os << string( indent, ' ' ) << ".... with body: " << endl; 186 190 187 191 if ( body != 0 ) body->print( os, indent + 4 ); … … 199 203 } 200 204 201 void ForStmt::print( std::ostream &os, int indent ) { 202 os << "\r" << string( indent, ' ') << "For Statement" << endl ; 203 204 os << "\r" << string( indent + 2, ' ') << "initialization: \n"; 205 void ForStmt::print( std::ostream &os, int indent ) const { 206 os << string( indent, ' ' ) << "Labels: {"; 207 for ( std::list<Label>::const_iterator it = get_labels().begin(); it != get_labels().end(); ++it) { 208 os << *it << ","; 209 } 210 os << "}" << endl; 211 212 os << string( indent, ' ' ) << "For Statement" << endl ; 213 214 os << string( indent + 2, ' ' ) << "initialization: \n"; 205 215 if ( initialization != 0 ) 206 216 initialization->print( os, indent + 4 ); 207 217 208 os << "\n \r" << string( indent + 2, ' ') << "condition: \n";218 os << "\n" << string( indent + 2, ' ' ) << "condition: \n"; 209 219 if ( condition != 0 ) 210 220 condition->print( os, indent + 4 ); 211 221 212 os << "\n \r" << string( indent + 2, ' ') << "increment: \n";222 os << "\n" << string( indent + 2, ' ' ) << "increment: \n"; 213 223 if ( increment != 0 ) 214 224 increment->print( os, indent + 4 ); 215 225 216 os << "\n \r" << string( indent + 2, ' ') << "statement block: \n";226 os << "\n" << string( indent + 2, ' ' ) << "statement block: \n"; 217 227 if ( body != 0 ) 218 228 body->print( os, indent + 4 ); … … 235 245 } 236 246 237 void TryStmt::print( std::ostream &os, int indent ) {238 os << "\r" << string( indent, ' ') << "Try Statement" << endl;239 os << string( indent + 2, ' ' ) << "with block: " << endl;247 void TryStmt::print( std::ostream &os, int indent ) const { 248 os << string( indent, ' ' ) << "Try Statement" << endl; 249 os << string( indent + 2, ' ' ) << "with block: " << endl; 240 250 block->print( os, indent + 4 ); 241 251 242 252 // handlers 243 os << string( indent + 2, ' ') << "and handlers: " << endl; 244 std::list<Statement *>::iterator i; 245 for ( i = handlers.begin(); i != handlers.end(); i++) 253 os << string( indent + 2, ' ' ) << "and handlers: " << endl; 254 for ( std::list<Statement *>::const_iterator i = handlers.begin(); i != handlers.end(); i++) 246 255 (*i )->print( os, indent + 4 ); 247 256 248 257 // finally block 249 258 if ( finallyBlock != 0 ) { 250 os << string( indent + 2, ' ' ) << "Finally block: " << endl;259 os << string( indent + 2, ' ' ) << "Finally block: " << endl; 251 260 finallyBlock->print( os, indent + 4 ); 252 261 } // if … … 262 271 } 263 272 264 void CatchStmt::print( std::ostream &os, int indent ) {265 os << "\r" << string( indent, ' ') << "Catch Statement" << endl;266 267 os << "\r" << string( indent, ' ') << "... catching" << endl;273 void CatchStmt::print( std::ostream &os, int indent ) const { 274 os << string( indent, ' ' ) << "Catch Statement" << endl; 275 276 os << string( indent, ' ' ) << "... catching" << endl; 268 277 if ( decl ) { 269 278 decl->printShort( os, indent + 4 ); 270 279 os << endl; 271 280 } else if ( catchRest ) 272 os << "\r" << string( indent + 4 , ' ') << "the rest" << endl;281 os << string( indent + 4 , ' ' ) << "the rest" << endl; 273 282 else 274 os << "\r" << string( indent + 4 , ' ') << ">>> Error: this catch clause must have a declaration <<<" << endl;283 os << string( indent + 4 , ' ' ) << ">>> Error: this catch clause must have a declaration <<<" << endl; 275 284 } 276 285 … … 284 293 } 285 294 286 void FinallyStmt::print( std::ostream &os, int indent ) {287 os << "\r" << string( indent, ' ') << "Finally Statement" << endl;288 os << string( indent + 2, ' ' ) << "with block: " << endl;295 void FinallyStmt::print( std::ostream &os, int indent ) const { 296 os << string( indent, ' ' ) << "Finally Statement" << endl; 297 os << string( indent + 2, ' ' ) << "with block: " << endl; 289 298 block->print( os, indent + 4 ); 290 299 } … … 294 303 NullStmt::~NullStmt() {} 295 304 296 void NullStmt::print( std::ostream &os, int indent ) {297 os << "\r" << string( indent, ' ') << "Null Statement" << endl ;305 void NullStmt::print( std::ostream &os, int indent ) const { 306 os << string( indent, ' ' ) << "Null Statement" << endl ; 298 307 } 299 308 -
src/SynTree/Statement.h
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 10:57:40201513 // Update Count : 2 12 // Last Modified On : Tue Jun 23 11:44:27 2015 13 // Update Count : 20 14 14 // 15 15 … … 28 28 29 29 std::list<Label> & get_labels() { return labels; } 30 const std::list<Label> & get_labels() const { return labels; } 30 31 31 32 virtual Statement *clone() const = 0; 32 33 virtual void accept( Visitor &v ) = 0; 33 34 virtual Statement *acceptMutator( Mutator &m ) = 0; 34 virtual void print( std::ostream &os, int indent = 0 ) ;35 virtual void print( std::ostream &os, int indent = 0 ) const; 35 36 protected: 36 37 std::list<Label> labels; … … 48 49 virtual void accept( Visitor &v ) { v.visit( this ); } 49 50 virtual CompoundStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); } 50 virtual void print( std::ostream &os, int indent = 0 ) ;51 virtual void print( std::ostream &os, int indent = 0 ) const; 51 52 private: 52 53 std::list<Statement*> kids; … … 64 65 virtual void accept( Visitor &v ) { v.visit( this ); } 65 66 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 66 virtual void print( std::ostream &os, int indent = 0 ) ;67 virtual void print( std::ostream &os, int indent = 0 ) const; 67 68 private: 68 69 Expression *expr; … … 84 85 virtual void accept( Visitor &v ) { v.visit( this ); } 85 86 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 86 virtual void print( std::ostream &os, int indent = 0 ) ;87 virtual void print( std::ostream &os, int indent = 0 ) const; 87 88 private: 88 89 Expression *condition; … … 106 107 107 108 virtual SwitchStmt *clone() const { return new SwitchStmt( *this ); } 108 virtual void print( std::ostream &os, int indent = 0 ) ;109 virtual void print( std::ostream &os, int indent = 0 ) const; 109 110 private: 110 111 Expression * condition; … … 127 128 128 129 virtual ChooseStmt *clone() const { return new ChooseStmt( *this ); } 129 virtual void print( std::ostream &os, int indent = 0 ) ;130 virtual void print( std::ostream &os, int indent = 0 ) const; 130 131 private: 131 132 Expression *condition; … … 141 142 142 143 virtual FallthruStmt *clone() const { return new FallthruStmt( *this ); } 143 virtual void print( std::ostream &os, int indent = 0 ) ;144 virtual void print( std::ostream &os, int indent = 0 ) const; 144 145 }; 145 146 … … 150 151 virtual ~CaseStmt(); 151 152 152 bool isDefault() { return _isDefault; } 153 static CaseStmt * makeDefault( std::list<Label> labels = std::list<Label>(), 154 std::list<Statement *> stmts = std::list<Statement *>() ); 155 156 bool isDefault() const { return _isDefault; } 153 157 void set_default(bool b) { _isDefault = b; } 154 158 … … 163 167 164 168 virtual CaseStmt *clone() const { return new CaseStmt( *this ); } 165 virtual void print( std::ostream &os, int indent = 0 ) ;169 virtual void print( std::ostream &os, int indent = 0 ) const; 166 170 private: 167 171 Expression * condition; … … 186 190 virtual void accept( Visitor &v ) { v.visit( this ); } 187 191 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 188 virtual void print( std::ostream &os, int indent = 0 ) ;192 virtual void print( std::ostream &os, int indent = 0 ) const; 189 193 private: 190 194 Expression *condition; … … 211 215 virtual void accept( Visitor &v ) { v.visit( this ); } 212 216 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 213 virtual void print( std::ostream &os, int indent = 0 ) ;217 virtual void print( std::ostream &os, int indent = 0 ) const; 214 218 private: 215 219 Statement *initialization; … … 221 225 class BranchStmt : public Statement { 222 226 public: 223 enum Type { Goto = 0 , Break, Continue };227 enum Type { Goto = 0, Break, Continue }; 224 228 225 229 BranchStmt( std::list<Label> labels, Label target, Type ) throw (SemanticError); … … 227 231 virtual ~BranchStmt() {} 228 232 233 Label get_originalTarget() { return originalTarget; } 229 234 Label get_target() { return target; } 230 235 void set_target( Label newValue ) { target = newValue; } … … 239 244 virtual void accept( Visitor &v ) { v.visit( this ); } 240 245 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 241 virtual void print( std::ostream &os, int indent = 0 ) ;246 virtual void print( std::ostream &os, int indent = 0 ) const; 242 247 private: 243 248 static const char *brType[]; 249 Label originalTarget; // can give better error messages if we remember the label name that the user entered 244 250 Label target; 245 251 Expression *computedTarget; … … 258 264 virtual void accept( Visitor &v ) { v.visit( this ); } 259 265 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 260 virtual void print( std::ostream &os, int indent = 0 ) ;266 virtual void print( std::ostream &os, int indent = 0 ) const; 261 267 private: 262 268 Expression *expr; … … 274 280 virtual void accept( Visitor &v ) { v.visit( this ); } 275 281 virtual NullStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); } 276 virtual void print( std::ostream &os, int indent = 0 ) ;282 virtual void print( std::ostream &os, int indent = 0 ) const; 277 283 278 284 private: … … 295 301 virtual void accept( Visitor &v ) { v.visit( this ); } 296 302 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 297 virtual void print( std::ostream &os, int indent = 0 ) ;303 virtual void print( std::ostream &os, int indent = 0 ) const; 298 304 299 305 private: … … 317 323 virtual void accept( Visitor &v ) { v.visit( this ); } 318 324 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 319 virtual void print( std::ostream &os, int indent = 0 ) ;325 virtual void print( std::ostream &os, int indent = 0 ) const; 320 326 321 327 private: … … 336 342 virtual void accept( Visitor &v ) { v.visit( this ); } 337 343 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 338 virtual void print( std::ostream &os, int indent = 0 ) ;344 virtual void print( std::ostream &os, int indent = 0 ) const; 339 345 private: 340 346 CompoundStmt *block; … … 355 361 virtual void accept( Visitor &v ) { v.visit( this ); } 356 362 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 357 virtual void print( std::ostream &os, int indent = 0 ) ;363 virtual void print( std::ostream &os, int indent = 0 ) const; 358 364 private: 359 365 Declaration *decl; -
src/SynTree/Type.h
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 11:01:40201513 // Update Count : 1 12 // Last Modified On : Sun Jun 7 21:50:38 2015 13 // Update Count : 12 14 14 // 15 15 … … 110 110 }; 111 111 112 static const char *typeNames[]; // string names for basic types, MUST MATCH with Kind112 static const char *typeNames[]; // string names for basic types, MUST MATCH with Kind 113 113 114 114 BasicType( const Type::Qualifiers &tq, Kind bt ); … … 214 214 virtual ~ReferenceToType(); 215 215 216 std::stringget_name() const { return name; }216 const std::string &get_name() const { return name; } 217 217 void set_name( std::string newValue ) { name = newValue; } 218 218 std::list< Expression* >& get_parameters() { return parameters; } … … 372 372 virtual ~AttrType(); 373 373 374 std::stringget_name() const { return name; }374 const std::string &get_name() const { return name; } 375 375 void set_name( const std::string &newValue ) { name = newValue; } 376 376 Expression *get_expr() const { return expr; } -
src/SynTree/TypeDecl.cc
reb50842 r937e51d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 11:02:11201513 // Update Count : 112 // Last Modified On : Sat Jun 13 08:14:35 2015 13 // Update Count : 2 14 14 // 15 15 … … 18 18 #include "utility.h" 19 19 20 TypeDecl::TypeDecl( const std::string &name, StorageClass sc, Type *type, Kind kind ) : Parent( name, sc, type ), kind( kind ) {20 TypeDecl::TypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type, Kind kind ) : Parent( name, sc, type ), kind( kind ) { 21 21 } 22 22 -
src/SynTree/module.mk
reb50842 r937e51d 1 ######################### -*- Mode: Makefile-Gmake -*- ######################## 2 ## 3 ## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo 4 ## 5 ## The contents of this file are covered under the licence agreement in the 6 ## file "LICENCE" distributed with Cforall. 7 ## 8 ## module.mk -- 9 ## 10 ## Author : Richard C. Bilson 11 ## Created On : Mon Jun 1 17:49:17 2015 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Mon Jun 1 17:54:09 2015 14 ## Update Count : 1 15 ############################################################################### 16 1 17 SRC += SynTree/Type.cc \ 2 18 SynTree/VoidType.cc \ … … 30 46 SynTree/Mutator.cc \ 31 47 SynTree/CodeGenVisitor.cc \ 32 SynTree/TypeSubstitution.cc \ 33 $(NULL) 48 SynTree/TypeSubstitution.cc 34 49
Note:
See TracChangeset
for help on using the changeset viewer.