-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.c
More file actions
46 lines (44 loc) · 953 Bytes
/
error.c
File metadata and controls
46 lines (44 loc) · 953 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* IFJ20 - Error lib
* Authors:
* Juraj Marticek, xmarti97
*/
#include <stdio.h>
#include <stdlib.h>
#include "error.h"
// Function for converting enum (ErrorTypes) to string
char *errTypeToString(ErrorTypes err_no)
{
switch (err_no)
{
case LEXICAL_ERROR:
return "LEXICAL ERROR";
break;
case SYNTAX_ERROR:
return "SYNTAX ERROR";
break;
case DEFINITION_ERROR:
return "DEFINITION ERROR";
break;
case TYPE_DEFINITION_ERROR:
return "TYPE DEFINITION ERROR";
break;
case INCOMPATIBLE_EXPRESSION_ERROR:
return "INCOMPATIBLE EXPRESSION ERROR";
break;
case FUNCTION_DEFINITION_ERROR:
return "FUNCTION DEFINITION ERROR";
break;
case OTHER_SEMANTIC_ERROR:
return "SEMANTIC ERROR - OTHER";
break;
case ZERO_DIVISION_ERROR:
return "DIVISION BY ZERO";
break;
case INTERNAL_ERROR:
return "INTERNAL ERROR";
break;
default:
return "UNKNOWN ERROR";
break;
}
}