aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/parser/proto_ast/collect_issues/collect_issues.h
blob: 8fd8be4b3d427e4109d21343c715cd6fdf631b29 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include <yql/essentials/parser/proto_ast/common.h>
#include <yql/essentials/public/issue/yql_issue.h>

namespace NSQLTranslation {

class TErrorCollectorOverIssues : public NProtoAST::IErrorCollector {
public:
    TErrorCollectorOverIssues(NYql::TIssues& issues, size_t maxErrors, const TString& file)
        : IErrorCollector(maxErrors)
        , Issues_(issues)
        , File_(file)
    {
    }

private:
    void AddError(ui32 line, ui32 col, const TString& message) override {
        Issues_.AddIssue(NYql::TPosition(col, line, File_), message);
    }

private:
    NYql::TIssues& Issues_;
    const TString File_;
};

}  // namespace NSQLTranslation