2016-11-29 03:32:50 +01:00
|
|
|
#ifndef __ANTHEM__INPUT__LOCATION_H
|
|
|
|
#define __ANTHEM__INPUT__LOCATION_H
|
2016-11-24 00:21:01 +01:00
|
|
|
|
2016-11-24 00:52:28 +01:00
|
|
|
#include <cstdlib>
|
|
|
|
|
2017-05-31 18:03:19 +02:00
|
|
|
#include <clingo.hh>
|
|
|
|
|
2016-11-24 00:21:01 +01:00
|
|
|
namespace anthem
|
|
|
|
{
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Location
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
struct Location
|
|
|
|
{
|
2017-05-31 18:03:19 +02:00
|
|
|
Location() = default;
|
|
|
|
|
|
|
|
Location(const Clingo::Location &clingoLocation)
|
|
|
|
: sectionStart{clingoLocation.begin_file()},
|
|
|
|
sectionEnd{clingoLocation.end_file()},
|
|
|
|
rowStart{clingoLocation.begin_line()},
|
|
|
|
rowEnd{clingoLocation.end_line()},
|
|
|
|
columnStart{clingoLocation.begin_column()},
|
|
|
|
columnEnd{clingoLocation.end_column()}
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Location(const Location &other) = default;
|
|
|
|
Location &operator=(const Location &other) = default;
|
|
|
|
Location(Location &&other) = default;
|
|
|
|
Location &operator=(Location &&other) = default;
|
|
|
|
|
2016-11-24 00:21:01 +01:00
|
|
|
const char *sectionStart = nullptr;
|
|
|
|
const char *sectionEnd = nullptr;
|
|
|
|
|
2016-11-24 00:52:28 +01:00
|
|
|
std::size_t rowStart = -1;
|
|
|
|
std::size_t rowEnd = -1;
|
2016-11-24 00:21:01 +01:00
|
|
|
|
2016-11-24 00:52:28 +01:00
|
|
|
std::size_t columnStart = -1;
|
|
|
|
std::size_t columnEnd = -1;
|
2016-11-24 00:21:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|