2023-01-05 20:12:15 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <BaseErrorListener.h>
|
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
namespace xlang {
|
|
|
|
|
|
|
|
class ErrorListener : public antlr4::BaseErrorListener {
|
|
|
|
std::string_view file;
|
|
|
|
bool has_error;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ErrorListener(std::string_view inputfile);
|
2023-01-06 02:56:33 +00:00
|
|
|
|
2023-01-05 20:12:15 +00:00
|
|
|
bool hasError();
|
|
|
|
void syntaxError(antlr4::Recognizer *recognizer,
|
|
|
|
antlr4::Token *offendingSymbol, size_t line,
|
|
|
|
size_t charPositionInLine, const std::string &msg,
|
|
|
|
std::exception_ptr e) override;
|
2023-01-06 02:56:33 +00:00
|
|
|
void typeError(size_t line, size_t charPositionInLine, std::string_view msg);
|
2023-01-05 20:12:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace xlang
|