-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.h
50 lines (36 loc) · 968 Bytes
/
constants.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
//
// constants.h
// Système Info
//
// Created on 26/02/2015.
//
#ifndef Syste_me_Info_constants_h
#define Syste_me_Info_constants_h
//#define YACC_DEBUG
#ifdef YACC_DEBUG
#define YYDEBUG 1
#endif
#include <errno.h>
#include <stdbool.h>
#include <stdint.h>
#define OPEN_OUTPUT_FAILURE 3
#define INVALID_INVOCATION 4
#define INTERNAL_FAILURE 5
#define COMPILATION_FAILURE 6
void yyerror(char const *s, ...);
void compilerError(char const *s, ...);
struct symbol_t;
typedef enum { BT_INT, BT_VOID, BT_CHAR } baseType_t;
typedef struct dereferencedSymbol_t {
struct symbol_t *symbol;
int dereferenceCount;
bool lvalue;
} dereferencedSymbol_t;
typedef struct {
uint32_t constMask;
int indirectionCount;
baseType_t baseType;
} varType_t;
#define DEREF(S, D) (dereferencedSymbol_t){.symbol = (S), .dereferenceCount = (D), .lvalue = false}
#define LDEREF(S, D, L) (dereferencedSymbol_t){.symbol = (S), .dereferenceCount = (D), .lvalue = (L)}
#endif