1/* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef SOURCE_CODE_H 6#define SOURCE_CODE_H 7 8 9#include <Referenceable.h> 10 11#include "LineDataSource.h" 12#include "TargetAddressRange.h" 13 14 15class LocatableFile; 16class SourceLanguage; 17class SourceLocation; 18class Statement; 19 20 21class SourceCode : public LineDataSource { 22public: 23 virtual ~SourceCode(); 24 25 // Locking needed for GetStatementLocationRange(), since that might use 26 // mutable data. 27 virtual bool Lock() = 0; 28 virtual void Unlock() = 0; 29 30 virtual SourceLanguage* GetSourceLanguage() const = 0; 31 32 virtual bool GetStatementLocationRange( 33 const SourceLocation& location, 34 SourceLocation& _start, 35 SourceLocation& _end) const = 0; 36 37 virtual LocatableFile* GetSourceFile() const = 0; 38}; 39 40 41#endif // SOURCE_CODE_H 42