1 // Define the diagnostic mappings.
3 def MAP_IGNORE : DiagMapping;
4 def MAP_WARNING : DiagMapping;
5 def MAP_ERROR : DiagMapping;
6 def MAP_FATAL : DiagMapping;
8 // Define the diagnostic classes.
10 def CLASS_NOTE : DiagClass;
11 def CLASS_WARNING : DiagClass;
12 def CLASS_EXTENSION : DiagClass;
13 def CLASS_ERROR : DiagClass;
15 class DiagGroup<string Name, list<DiagGroup> subgroups = []> {
16 string GroupName = Name;
17 list<DiagGroup> SubGroups = subgroups;
18 string CategoryName = "";
20 class InGroup<DiagGroup G> { DiagGroup Group = G; }
22 // All diagnostics emitted by the compiler are an indirect subclass of this.
23 class Diagnostic<string text, DiagClass DC, DiagMapping defaultmapping> {
26 DiagMapping DefaultMapping = defaultmapping;
28 string CategoryName = "";
31 class Error<string str> : Diagnostic<str, CLASS_ERROR, MAP_ERROR>;
32 class Warning<string str> : Diagnostic<str, CLASS_WARNING, MAP_WARNING>;
33 class Extension<string str> : Diagnostic<str, CLASS_EXTENSION, MAP_IGNORE>;
34 class ExtWarn<string str> : Diagnostic<str, CLASS_EXTENSION, MAP_WARNING>;
35 class Note<string str> : Diagnostic<str, CLASS_NOTE, MAP_FATAL/*ignored*/>;