mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
DTC: Add support for a C-like #include "file" mechanism.
Keeps track of open files in a stack, and assigns a filenum to source positions for each lexical token. Modified error reporting to show source file as well. No policy on file directory basis has been decided. Still handles stdin. Tested on all arch/powerpc/boot/dts DTS files Signed-off-by: Jon Loeliger <jdl@freescale.com>
This commit is contained in:
parent
b29597d9a3
commit
e45e6fd274
9 changed files with 369 additions and 23 deletions
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
|
||||
#include "dtc.h"
|
||||
#include "srcpos.h"
|
||||
|
||||
extern FILE *yyin;
|
||||
extern int yyparse(void);
|
||||
|
@ -26,11 +27,12 @@ extern void yyerror(char const *);
|
|||
|
||||
struct boot_info *the_boot_info;
|
||||
|
||||
struct boot_info *dt_from_source(FILE *f)
|
||||
struct boot_info *dt_from_source(const char *fname)
|
||||
{
|
||||
the_boot_info = NULL;
|
||||
|
||||
yyin = f;
|
||||
push_input_file(fname);
|
||||
|
||||
if (yyparse() != 0)
|
||||
return NULL;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue