PorygonLang/src/Diagnostics/Diagnostic.hpp

40 lines
927 B
C++
Raw Normal View History

2019-05-21 11:56:08 +00:00
#ifndef PORYGONLANG_DIAGNOSTIC_HPP
#define PORYGONLANG_DIAGNOSTIC_HPP
#include "DiagnosticSeverity.hpp"
#include "DiagnosticCode.hpp"
2019-06-18 14:39:36 +00:00
namespace Porygon::Diagnostics {
class Diagnostic {
DiagnosticSeverity _severity;
DiagnosticCode _code;
unsigned int _start;
unsigned int _length;
public:
Diagnostic(DiagnosticSeverity severity, DiagnosticCode code, unsigned int start, unsigned int length) {
_severity = severity;
_code = code;
_start = start;
_length = length;
}
2019-06-18 14:39:36 +00:00
DiagnosticSeverity GetSeverity() {
return _severity;
}
2019-06-18 14:39:36 +00:00
DiagnosticCode GetCode() {
return _code;
}
2019-06-18 14:39:36 +00:00
unsigned int GetStartPosition() {
return _start;
}
2019-05-21 11:56:08 +00:00
2019-06-18 14:39:36 +00:00
unsigned int GetLength() {
return _length;
}
};
}
2019-05-21 11:56:08 +00:00
#endif //PORYGONLANG_DIAGNOSTIC_HPP