forked from thewhoo/ifj15
-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.h
55 lines (48 loc) · 983 Bytes
/
error.h
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
47
48
49
50
51
52
53
54
55
/*
* Course IFJ @ FIT VUT Brno, 2015
* IFJ15 Interpreter Project
*
* Authors:
* Lukas Osadsky - xosads00
* Pavol Plaskon - xplask00
* Pavel Pospisil - xpospi88
* Matej Postolka - xposto02
*
* Unless otherwise stated, all code is licensed under a
* GNU General Public License v2.0
*
*/
/**
* @file error.h
* @brief Error states library
*
* Include this file to report errors in program
*
*/
#ifndef ERROR_H
#define ERROR_H
enum error_codes
{
E_OK = 0,
E_LEX = 1,
E_SYNTAX = 2,
E_SEMANTIC_DEF = 3,
E_SEMANTIC_TYPES = 4,
E_AUTO_TYPE = 5,
E_SEMANTIC_OTHERS = 6,
E_READ_NUMBER = 7,
E_UNINITIALIZED = 8,
E_ZERO_DIVISION = 9,
E_RUNTIME_OTHERS = 10,
E_INTERNAL = 99, //return values defined in project description
//local errors
E_ALLOC
};
/**
* @brief Writes specific error message, clean up allocated memory and exit
*
* @param err error code
* @return void
*/
void exit_error(int err);
#endif //ERROR_H