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
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( )
32 Interaction::operator << ( std::ostream
& os
, const Interaction::CoreLocation
& self
)
39 Interaction::CharPtrLocation::CharPtrLocation( const char * loc
)
43 Interaction::CharPtrLocation::~CharPtrLocation( )
47 Interaction::CharPtrLocation::show( std::ostream
& os
) const
53 Interaction::CharRefPtrLocation::CharRefPtrLocation( const RefCountPtr
< const char > & loc
)
57 Interaction::CharRefPtrLocation::~CharRefPtrLocation( )
61 Interaction::CharRefPtrLocation::show( std::ostream
& os
) const
67 Interaction::BoundLocation::BoundLocation( const Ast::PlacedIdentifier
& loc
, Ast::Identifier::Type type
)
68 : loc_( loc
), type_( type
)
71 Interaction::BoundLocation::~BoundLocation( )
75 Interaction::BoundLocation::show( std::ostream
& os
) const
77 loc_
.show( os
, type_
);
81 Interaction::MethodLocation::MethodLocation( const Kernel::MethodId method
)
85 Interaction::MethodLocation::~MethodLocation( )
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
)
99 Interaction::MutatorLocation::~MutatorLocation( )
103 Interaction::MutatorLocation::show( std::ostream
& os
) const
105 os
<< class_
->getTypeName( ) << "." << name_
;
109 Interaction::FileIDLocation::FileIDLocation( const Ast::FileID
* fileID
)
113 Interaction::FileIDLocation::~FileIDLocation( )
117 Interaction::FileIDLocation::show( std::ostream
& os
) const
119 os
<< fileID_
->name( ) ;