• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef	DISSECT_H
2 #define	DISSECT_H
3 
4 #include <stdio.h>
5 #include "parse.h"
6 #include "expression.h"
7 #include "scope.h"
8 
9 #define	U_SHIFT		8
10 
11 #define	U_R_AOF		0x01
12 #define	U_W_AOF		0x02
13 
14 #define	U_R_VAL		0x04
15 #define	U_W_VAL		0x08
16 
17 #define	U_R_PTR		(U_R_VAL << U_SHIFT)
18 #define	U_W_PTR		(U_W_VAL << U_SHIFT)
19 
20 struct reporter
21 {
22 	void (*r_symdef)(struct symbol *);
23 	void (*r_memdef)(struct symbol *, struct symbol *);
24 
25 	void (*r_symbol)(unsigned, struct position *, struct symbol *);
26 	void (*r_member)(unsigned, struct position *, struct symbol *, struct symbol *);
27 };
28 
29 extern struct symbol *dissect_ctx;
30 
sym_is_local(struct symbol * sym)31 static inline bool sym_is_local(struct symbol *sym)
32 {
33 	return !toplevel(sym->scope);
34 }
35 
36 extern void dissect(struct reporter *, struct string_list *);
37 
38 #endif
39