You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
604 B
30 lines
604 B
1 year ago
|
#ifndef _SYSYF_ERROR_REPORTER_H_
|
||
|
#define _SYSYF_ERROR_REPORTER_H_
|
||
|
|
||
|
#include <iostream>
|
||
|
#include <deque>
|
||
|
#include <unordered_map>
|
||
|
#include <vector>
|
||
|
#include "SyntaxTree.h"
|
||
|
|
||
|
namespace SysYF
|
||
|
{
|
||
|
class ErrorReporter
|
||
|
{
|
||
|
public:
|
||
|
using Position = SyntaxTree::Position;
|
||
|
explicit ErrorReporter(std::ostream &error_stream);
|
||
|
|
||
|
void error(Position pos, const std::string &msg);
|
||
|
void warn(Position pos, const std::string &msg);
|
||
|
|
||
|
protected:
|
||
|
virtual void report(Position pos, const std::string &msg, const std::string &prefix);
|
||
|
|
||
|
private:
|
||
|
std::ostream &err;
|
||
|
};
|
||
|
|
||
|
}
|
||
|
#endif // _SYSYF_ERROR_REPORTER_H_
|