2 * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * Augment the standard YYLTYPE with a filenum index into an
22 * array of all opened filenames.
33 #if ! defined(YYLTYPE) && ! defined(YYLTYPE_IS_DECLARED)
34 typedef struct YYLTYPE
{
39 struct dtc_file
*file
;
42 #define YYLTYPE_IS_DECLARED 1
43 #define YYLTYPE_IS_TRIVIAL 1
46 /* Cater to old parser templates. */
51 #define YYLLOC_DEFAULT(Current, Rhs, N) \
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; \
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; \
73 extern void yyerror(char const *);
74 extern void yyerrorf(char const *, ...) __attribute__((format(printf
, 1, 2)));
76 extern struct dtc_file
*srcpos_file
;
79 const char *dir
; /* NULL for current directory */
80 struct search_path
*prev
, *next
;
83 extern struct dtc_file
*dtc_open_file(const char *fname
,
84 const struct search_path
*search
);
85 extern void dtc_close_file(struct dtc_file
*file
);