2014-10-30 01:56:49 +00:00
|
|
|
#ifndef DIAGNOSTIC_H
|
|
|
|
#define DIAGNOSTIC_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <iosfwd>
|
|
|
|
#include "location.hh"
|
|
|
|
|
|
|
|
class Diagnostic
|
|
|
|
{
|
|
|
|
public:
|
2019-08-18 11:21:00 +00:00
|
|
|
enum Severity
|
|
|
|
{
|
|
|
|
warning,
|
|
|
|
error,
|
|
|
|
fatalError
|
|
|
|
};
|
2014-10-30 01:56:49 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
Diagnostic();
|
|
|
|
Diagnostic(Severity sev, std::string msg, yy::location loc);
|
2014-10-30 01:56:49 +00:00
|
|
|
|
|
|
|
private:
|
2019-08-18 11:21:00 +00:00
|
|
|
Severity severity;
|
|
|
|
std::string message;
|
|
|
|
yy::location location;
|
2014-10-30 01:56:49 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
friend std::ostream& operator<<(std::ostream&, const Diagnostic&);
|
2014-10-30 01:56:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
std::ostream& operator<<(std::ostream&, const Diagnostic&);
|
|
|
|
|
|
|
|
#endif // DIAGNOSTIC_H
|