Update procedures
[shapes.git] / source / corelocation.cc
blobafd7a4558c825cb8ab034e7ca135c6b3fe6f9f0d
1 /* This file is part of Shapes.
3 * Shapes is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * any later version.
8 * Shapes is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright 2015 Henrik Tidefelt
19 #include "corelocation.h"
20 #include "sourcelocation.h"
21 #include "environment.h"
22 #include "classtypes.h"
24 using namespace Shapes;
27 Interaction::CoreLocation::~CoreLocation( )
28 { }
31 std::ostream &
32 Interaction::operator << ( std::ostream & os, const Interaction::CoreLocation & self )
34 self.show( os );
35 return os;
39 Interaction::CharPtrLocation::CharPtrLocation( const char * loc )
40 : loc_( loc )
41 { }
43 Interaction::CharPtrLocation::~CharPtrLocation( )
44 { }
46 void
47 Interaction::CharPtrLocation::show( std::ostream & os ) const
49 os << loc_ ;
53 Interaction::CharRefPtrLocation::CharRefPtrLocation( const RefCountPtr< const char > & loc )
54 : loc_( loc )
55 { }
57 Interaction::CharRefPtrLocation::~CharRefPtrLocation( )
58 { }
60 void
61 Interaction::CharRefPtrLocation::show( std::ostream & os ) const
63 os << loc_ ;
67 Interaction::BoundLocation::BoundLocation( const Ast::PlacedIdentifier & loc, Ast::Identifier::Type type )
68 : loc_( loc ), type_( type )
69 { }
71 Interaction::BoundLocation::~BoundLocation( )
72 { }
74 void
75 Interaction::BoundLocation::show( std::ostream & os ) const
77 loc_.show( os, type_ );
81 Interaction::MethodLocation::MethodLocation( const Kernel::MethodId method )
82 : method_( method )
83 { }
85 Interaction::MethodLocation::~MethodLocation( )
86 { }
88 void
89 Interaction::MethodLocation::show( std::ostream & os ) const
91 os << method_.prettyName( ) ;
95 Interaction::MutatorLocation::MutatorLocation( const Kernel::State * state, const char * name )
96 : class_( state->getClass( ) ), name_( name )
97 { }
99 Interaction::MutatorLocation::~MutatorLocation( )
102 void
103 Interaction::MutatorLocation::show( std::ostream & os ) const
105 os << class_->getTypeName( ) << "." << name_ ;
109 Interaction::FileIDLocation::FileIDLocation( const Ast::FileID * fileID )
110 : fileID_( fileID )
113 Interaction::FileIDLocation::~FileIDLocation( )
116 void
117 Interaction::FileIDLocation::show( std::ostream & os ) const
119 os << fileID_->name( ) ;