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#include <stdio.h>
26
27struct dtc_file {
28 char *dir;
29 const char *name;
30 FILE *file;
31};
32
33#if ! defined(YYLTYPE) && ! defined(YYLTYPE_IS_DECLARED)
34typedef struct YYLTYPE {
35 int first_line;
36 int first_column;
37 int last_line;
38 int last_column;
39 struct dtc_file *file;
40} YYLTYPE;
41
42#define YYLTYPE_IS_DECLARED 1
43#define YYLTYPE_IS_TRIVIAL 1
44#endif
45
46
47#ifndef YYID
48#define YYID(n) (n)
49#endif
50
51#define YYLLOC_DEFAULT(Current, Rhs, N) \
52 do \
53 if (YYID (N)) \
54 { \
55 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
56 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
57 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
58 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
59 (Current).file = YYRHSLOC (Rhs, N).file; \
60 } \
61 else \
62 { \
63 (Current).first_line = (Current).last_line = \
64 YYRHSLOC (Rhs, 0).last_line; \
65 (Current).first_column = (Current).last_column = \
66 YYRHSLOC (Rhs, 0).last_column; \
67 (Current).file = YYRHSLOC (Rhs, 0).file; \
68 } \
69 while (YYID (0))
70
71
72
73extern void yyerror(char const *);
74extern void yyerrorf(char const *, ...) __attribute__((format(printf, 1, 2)));
75
76extern struct dtc_file *srcpos_file;
77
78struct search_path {
79 const char *dir;
80 struct search_path *prev, *next;
81};
82
83extern struct dtc_file *dtc_open_file(const char *fname,
84 const struct search_path *search);
85extern void dtc_close_file(struct dtc_file *file);
86