37 lines
595 B
C++
37 lines
595 B
C++
#ifndef SOURCELOCATION_HPP
|
|
#define SOURCELOCATION_HPP
|
|
|
|
#include <string>
|
|
|
|
class SourceLocation
|
|
{
|
|
public:
|
|
SourceLocation();
|
|
SourceLocation(std::string file, int line, int column);
|
|
|
|
bool isValid() const;
|
|
|
|
void print() const;
|
|
std::string printToString() const;
|
|
|
|
std::string file() const;
|
|
void setFile(std::string);
|
|
|
|
int lineLocation() const;
|
|
void setLineLocation(int);
|
|
|
|
int columnLocation() const;
|
|
void setColumnLocation(int);
|
|
|
|
int offset() const;
|
|
void setOffset(int);
|
|
|
|
private:
|
|
std::string _file;
|
|
int _column;
|
|
int _line;
|
|
|
|
};
|
|
|
|
#endif
|