KCC - Kayte C Compiler 1.10.0
A C compiler implementation with preprocessor, lexer, parser, and code generator
Loading...
Searching...
No Matches
error.h
1#ifndef ERROR_H
2#define ERROR_H
3
4#include <stdio.h>
5#include <stdlib.h>
6#include <stdarg.h>
7#include <stdbool.h>
8
9typedef enum {
10 ERROR_LEXICAL,
11 ERROR_SYNTAX,
12 ERROR_SEMANTIC,
13 ERROR_INTERNAL,
14 ERROR_FATAL
15} ErrorType;
16
17// Error reporting functions
18void error_report(ErrorType type, int line, int column, const char *format, ...);
19void error_syntax(int line, int column, const char *format, ...);
20void error_semantic(int line, int column, const char *format, ...);
21void error_fatal(const char *format, ...);
22
23// Error state management
24void error_init(void);
25int error_count(void);
26bool error_has_errors(void);
27void error_reset(void);
28
29
30#endif // ERROR_H