Changeset 8bf784a for src/SynTree
- Timestamp:
- Dec 21, 2016, 2:54:31 PM (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:
- e33f321
- Parents:
- 6d4d1a6
- Location:
- src/SynTree
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/SynTree/Declaration.cc ¶
r6d4d1a6 r8bf784a 57 57 58 58 std::ostream & operator<<( std::ostream & out, const Declaration * decl ) { 59 decl->print( out ); 59 if ( decl ){ 60 decl->print( out ); 61 } else { 62 out << "nullptr"; 63 } 60 64 return out; 61 65 } -
TabularUnified src/SynTree/Expression.cc ¶
r6d4d1a6 r8bf784a 672 672 673 673 std::ostream & operator<<( std::ostream & out, const Expression * expr ) { 674 expr->print( out ); 674 if ( expr ) { 675 expr->print( out ); 676 } else { 677 out << "nullptr"; 678 } 675 679 return out; 676 680 } -
TabularUnified src/SynTree/FunctionType.cc ¶
r6d4d1a6 r8bf784a 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FunctionType.cc -- 7 // FunctionType.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 19 19 #include "Declaration.h" 20 20 #include "Common/utility.h" 21 #include "Tuples/Tuples.h" 21 22 22 23 FunctionType::FunctionType( const Type::Qualifiers &tq, bool isVarArgs ) : Type( tq ), isVarArgs( isVarArgs ) { … … 31 32 deleteAll( returnVals ); 32 33 deleteAll( parameters ); 34 } 35 36 namespace { 37 bool containsTtype( const std::list<DeclarationWithType * > & l ) { 38 if ( ! l.empty() ) { 39 return Tuples::isTtype( l.back()->get_type() ); 40 } 41 return false; 42 } 43 } 44 45 bool FunctionType::isTtype() const { 46 return containsTtype( returnVals ) || containsTtype( parameters ); 33 47 } 34 48 -
TabularUnified src/SynTree/Statement.cc ¶
r6d4d1a6 r8bf784a 388 388 389 389 std::ostream & operator<<( std::ostream & out, const Statement * statement ) { 390 statement->print( out ); 390 if ( statement ) { 391 statement->print( out ); 392 } else { 393 out << "nullptr"; 394 } 391 395 return out; 392 396 } -
TabularUnified src/SynTree/Type.cc ¶
r6d4d1a6 r8bf784a 85 85 86 86 std::ostream & operator<<( std::ostream & out, const Type * type ) { 87 type->print( out ); 87 if ( type ) { 88 type->print( out ); 89 } else { 90 out << "nullptr"; 91 } 88 92 return out; 89 93 } -
TabularUnified src/SynTree/Type.h ¶
r6d4d1a6 r8bf784a 204 204 std::list<DeclarationWithType*> & get_returnVals() { return returnVals; } 205 205 std::list<DeclarationWithType*> & get_parameters() { return parameters; } 206 bool get_isVarArgs() { return isVarArgs; }206 bool get_isVarArgs() const { return isVarArgs; } 207 207 void set_isVarArgs( bool newValue ) { isVarArgs = newValue; } 208 209 bool isTtype() const; 208 210 209 211 virtual FunctionType *clone() const { return new FunctionType( *this ); } -
TabularUnified src/SynTree/TypeDecl.cc ¶
r6d4d1a6 r8bf784a 18 18 #include "Common/utility.h" 19 19 20 TypeDecl::TypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type, Kind kind ) : Parent( name, sc, type ), kind( kind ), sized( kind == Any ) {20 TypeDecl::TypeDecl( const std::string &name, DeclarationNode::StorageClass sc, Type *type, Kind kind ) : Parent( name, sc, type ), kind( kind ), sized( kind == Any || kind == Ttype ) { 21 21 } 22 22 … … 25 25 26 26 std::string TypeDecl::typeString() const { 27 static const char *kindNames[] = { "type", "incomplete type", "function type" };27 static const char *kindNames[] = { "type", "incomplete type", "function type", "tuple type" }; 28 28 return kindNames[ kind ]; 29 29 }
Note: See TracChangeset
for help on using the changeset viewer.