Changeset 0dd3a2f for translator/SynTree/AttrType.cc
- Timestamp:
- May 18, 2015, 11:20:23 AM (9 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:
- 51587aa
- Parents:
- a32b204
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/SynTree/AttrType.cc
ra32b204 r0dd3a2f 1 /* 2 * This file is part of the Cforall project 3 * 4 * $Id: AttrType.cc,v 1.3 2005/08/29 20:59:25 rcbilson Exp $ 5 * 6 */ 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo 3 // 4 // The contents of this file are covered under the licence agreement in the 5 // file "LICENCE" distributed with Cforall. 6 // 7 // XXX.cc -- 8 // 9 // Author : Richard C. Bilson 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 07:53:48 2015 13 // Update Count : 1 14 // 7 15 8 16 #include "Type.h" … … 12 20 13 21 AttrType::AttrType( const Type::Qualifiers &tq, const std::string &name, Expression *expr ) 14 : Type( tq ), name( name ), expr( expr ), type( 0 ), isType( false ) 15 { 22 : Type( tq ), name( name ), expr( expr ), type( 0 ), isType( false ) { 16 23 } 17 24 18 25 AttrType::AttrType( const Type::Qualifiers &tq, const std::string &name, Type *type ) 19 : Type( tq ), name( name ), expr( 0 ), type( type ), isType( true ) 20 { 26 : Type( tq ), name( name ), expr( 0 ), type( type ), isType( true ) { 21 27 } 22 28 23 29 AttrType::AttrType( const AttrType &other ) 24 : Type( other ), name( other.name ), expr( maybeClone( other.expr ) ), type( maybeClone( other.type ) ), isType( other.isType ) 25 { 30 : Type( other ), name( other.name ), expr( maybeClone( other.expr ) ), type( maybeClone( other.type ) ), isType( other.isType ) { 26 31 } 27 32 28 AttrType::~AttrType() 29 { 30 delete expr; 31 delete type; 33 AttrType::~AttrType() { 34 delete expr; 35 delete type; 32 36 } 33 37 34 void 35 AttrType::print( std::ostream &os, int indent ) const 36 { 37 Type::print( os, indent ); 38 os << "attribute " << name << " applied to "; 39 if ( expr ) { 40 os << "expression "; 41 expr->print( os, indent ); 42 } 43 if ( type ) { 44 os << "type "; 45 type->print( os, indent ); 46 } 38 void AttrType::print( std::ostream &os, int indent ) const { 39 Type::print( os, indent ); 40 os << "attribute " << name << " applied to "; 41 if ( expr ) { 42 os << "expression "; 43 expr->print( os, indent ); 44 } // if 45 if ( type ) { 46 os << "type "; 47 type->print( os, indent ); 48 } // if 47 49 } 48 50 51 // Local Variables: // 52 // tab-width: 4 // 53 // mode: c++ // 54 // compile-command: "make install" // 55 // End: //
Note: See TracChangeset
for help on using the changeset viewer.