-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy patherrorobj.h
94 lines (84 loc) · 2.55 KB
/
errorobj.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
$Id: errorobj.h 3136 2024-05-11 09:05:50Z soci $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef ERROROBJ_H
#define ERROROBJ_H
#include "obj.h"
#include "errors_e.h"
#include "oper_e.h"
#include "stdbool.h"
extern struct Type *const ERROR_OBJ;
typedef struct Error {
Obj v;
Error_types num;
const struct file_list_s *file_list;
struct linepos_s epoint;
linecpos_t caret;
const uint8_t *line;
union {
struct {
Oper_types op;
Obj *v1;
Obj *v2;
} invoper;
struct {
Obj *symbol;
struct Namespace *names;
bool down;
} notdef;
struct {
unsigned int bits;
Obj *val;
} intconv;
struct {
const struct Type *t;
Obj *val;
} conv;
Obj *obj;
struct {
uint32_t am, cod;
} addressing;
struct {
struct Register *reg;
uint32_t cod;
} reg;
struct {
size_t num;
uint32_t cod;
} opers;
struct {
uint32_t cod;
} addresssize;
struct {
size_t v1;
size_t v2;
} broadcast;
struct {
argcount_t num, min, max;
} argnum;
struct {
const struct Type *t1;
const struct Type *t2;
} otype;
} u;
} Error;
#define Error(a) OBJ_CAST(Error, a)
extern void errorobj_init(void);
extern MUST_CHECK Error *new_error(Error_types, linepos_t);
extern MUST_CHECK Obj *new_error_mem(linepos_t);
extern MUST_CHECK Obj *new_error_obj(Error_types, Obj *, linepos_t);
extern MUST_CHECK Obj *new_error_conv(Obj *, struct Type *, linepos_t);
extern MUST_CHECK Obj *new_error_argnum(argcount_t, argcount_t, argcount_t, linepos_t);
extern void error_obj_update(Error *, const Obj *, Obj *);
#endif