Sen API
Sen Libraries
Toggle main menu visibility
Loading...
Searching...
No Matches
error_reporter.h
Go to the documentation of this file.
1
// === error_reporter.h ================================================================================================
2
// Sen Infrastructure
3
// Released under the Apache License v2.0 (SPDX-License-Identifier Apache-2.0).
4
// See the LICENSE.txt file for more information.
5
// © Airbus SAS, Airbus Helicopters, and Airbus Defence and Space SAU/GmbH/SAS.
6
// =====================================================================================================================
7
8
#ifndef SEN_CORE_LANG_ERROR_REPORTER_H
9
#define SEN_CORE_LANG_ERROR_REPORTER_H
10
11
#include "
code_location.h
"
12
13
// std
14
#include <cstddef>
15
#include <functional>
16
#include <string>
17
18
namespace
sen::lang
19
{
20
23
25
class
ErrorReporter
26
{
27
public
:
29
using
ReportFunc
= std::function<void(
const
CodeLocation
&,
const
std::string&, std::size_t,
bool
isWarning)>;
30
36
static
void
report
(
const
CodeLocation
& loc,
37
const
std::string& message,
38
std::size_t width = 0U,
39
bool
isWarning =
false
);
40
};
41
43
44
}
// namespace sen::lang
45
46
#endif
// SEN_CORE_LANG_ERROR_REPORTER_H
sen::lang::ErrorReporter
Utility class for reporting errors in the source code.
Definition
error_reporter.h:26
sen::lang::ErrorReporter::ReportFunc
std::function< void(const CodeLocation &, const std::string &, std::size_t, bool isWarning)> ReportFunc
A function that reports the error to some sink.
Definition
error_reporter.h:29
sen::lang::ErrorReporter::report
static void report(const CodeLocation &loc, const std::string &message, std::size_t width=0U, bool isWarning=false)
Reports an error using the defined function.
code_location.h
sen::lang::CodeLocation
Location of a character in a program.
Definition
code_location.h:21
sen::lang
Definition
code_location.h:14
libs
core
include
sen
core
lang
error_reporter.h
Generated by
1.17.0