-#line 2 "dtc-lexer.lex.c"
-#line 4 "dtc-lexer.lex.c"
+#line 3 "scripts/dtc/dtc-lexer.lex.c_shipped"
#define YY_INT_ALIGNED short int
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
#define UINT32_MAX (4294967295U)
#endif
-#endif /* ! C99 */
-
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k.
- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
- * Ditto for the __ia64__ case accordingly.
- */
-#define YY_BUF_SIZE 32768
-#else
#define YY_BUF_SIZE 16384
-#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
-#line 1 "dtc-lexer.l"
/*
* (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005.
*
*/
#define YY_NO_INPUT 1
-
-
-
-#line 37 "dtc-lexer.l"
#include "dtc.h"
#include "srcpos.h"
#include "dtc-parser.tab.h"
static void push_input_file(const char *filename);
static int pop_input_file(void);
-#line 607 "dtc-lexer.lex.c"
#define INITIAL 0
#define INCLUDE 1
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k */
-#define YY_READ_BUF_SIZE 16384
-#else
#define YY_READ_BUF_SIZE 8192
-#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ unsigned n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 66 "dtc-lexer.l"
-
-#line 798 "dtc-lexer.lex.c"
-
if ( !(yy_init) )
{
(yy_init) = 1;
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
-#line 67 "dtc-lexer.l"
{
char *name = strchr(yytext, '\"') + 1;
yytext[yyleng-1] = '\0';
case YY_STATE_EOF(BYTESTRING):
case YY_STATE_EOF(PROPNODENAME):
case YY_STATE_EOF(V1):
-#line 73 "dtc-lexer.l"
{
if (!pop_input_file()) {
yyterminate();
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
-#line 79 "dtc-lexer.l"
{
DPRINT("String: %s\n", yytext);
yylval.data = data_copy_escape_string(yytext+1,
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 86 "dtc-lexer.l"
{
DPRINT("Keyword: /dts-v1/\n");
dts_version = 1;
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 93 "dtc-lexer.l"
{
DPRINT("Keyword: /memreserve/\n");
BEGIN_DEFAULT();
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 99 "dtc-lexer.l"
{
DPRINT("Label: %s\n", yytext);
yylval.labelref = xstrdup(yytext);
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 106 "dtc-lexer.l"
{
yylval.literal = xstrdup(yytext);
DPRINT("Literal: '%s'\n", yylval.literal);
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 112 "dtc-lexer.l"
{ /* label reference */
DPRINT("Ref: %s\n", yytext+1);
yylval.labelref = xstrdup(yytext+1);
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 118 "dtc-lexer.l"
{ /* new-style path reference */
yytext[yyleng-1] = '\0';
DPRINT("Ref: %s\n", yytext+2);
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 125 "dtc-lexer.l"
{
yylval.byte = strtol(yytext, NULL, 16);
DPRINT("Byte: %02x\n", (int)yylval.byte);
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 131 "dtc-lexer.l"
{
DPRINT("/BYTESTRING\n");
BEGIN_DEFAULT();
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 137 "dtc-lexer.l"
{
DPRINT("PropNodeName: %s\n", yytext);
yylval.propnodename = xstrdup(yytext);
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 144 "dtc-lexer.l"
{
DPRINT("Binary Include\n");
return DT_INCBIN;
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
-#line 149 "dtc-lexer.l"
/* eat whitespace */
YY_BREAK
case 14:
/* rule 14 can match eol */
YY_RULE_SETUP
-#line 150 "dtc-lexer.l"
/* eat C-style comments */
YY_BREAK
case 15:
/* rule 15 can match eol */
YY_RULE_SETUP
-#line 151 "dtc-lexer.l"
/* eat C++-style comments */
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 153 "dtc-lexer.l"
{
DPRINT("Char: %c (\\x%02x)\n", yytext[0],
(unsigned)yytext[0]);
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 168 "dtc-lexer.l"
ECHO;
YY_BREAK
-#line 1044 "dtc-lexer.lex.c"
case YY_END_OF_BUFFER:
{
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
- * @param yybytes the byte buffer to scan
- * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
#define YYTABLES_NAME "yytables"
-#line 168 "dtc-lexer.l"
-
-
-
static void push_input_file(const char *filename)
{
assert(filename);
yypush_buffer_state(yy_create_buffer(yyin,YY_BUF_SIZE));
}
-
static int pop_input_file(void)
{
if (srcfile_pop() == 0)
-
-/* A Bison parser, made by GNU Bison 2.4.1. */
+/* A Bison parser, made by GNU Bison 2.4.3. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2009, 2010 Free Software Foundation, Inc.
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
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.4.1"
+#define YYBISON_VERSION "2.4.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* Copy the first part of user declarations. */
-/* Line 189 of yacc.c */
-#line 21 "dtc-parser.y"
#include <stdio.h>
static unsigned long long eval_literal(const char *s, int base, int bits);
-/* Line 189 of yacc.c */
-#line 92 "dtc-parser.tab.c"
/* Enabling traces. */
#ifndef YYDEBUG
-# define YYDEBUG 0
+# define YYDEBUG 1
#endif
/* Enabling verbose error messages. */
typedef union YYSTYPE
{
-/* Line 214 of yacc.c */
-#line 39 "dtc-parser.y"
char *propnodename;
char *literal;
-/* Line 214 of yacc.c */
-#line 159 "dtc-parser.tab.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
/* Copy the second part of user declarations. */
-/* Line 264 of yacc.c */
-#line 171 "dtc-parser.tab.c"
#ifdef short
# undef short
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
+ Once GCC version 2 has supplanted version 1, this can go. However,
+ YYFAIL appears to be in use. Nevertheless, it is formally deprecated
+ in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+ discussed. */
#define YYFAIL goto yyerrlab
+#if defined YYFAIL
+ /* This is here to suppress warnings from the GCC cpp's
+ -Wunused-macros. Normally we don't worry about that warning, but
+ some users do, and we want to make it easy for users to remove
+ YYFAIL uses, which will produce warnings from Bison 2.5. */
+#endif
#define YYRECOVERING() (!!yyerrstatus)
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
{
case 2:
-/* Line 1455 of yacc.c */
-#line 87 "dtc-parser.y"
{
the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node),
guess_boot_cpuid((yyvsp[(4) - (4)].node)));
case 3:
-/* Line 1455 of yacc.c */
-#line 95 "dtc-parser.y"
{
(yyval.re) = NULL;
;}
case 4:
-/* Line 1455 of yacc.c */
-#line 99 "dtc-parser.y"
{
(yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
;}
case 5:
-/* Line 1455 of yacc.c */
-#line 106 "dtc-parser.y"
{
(yyval.re) = build_reserve_entry((yyvsp[(2) - (4)].addr), (yyvsp[(3) - (4)].addr));
;}
case 6:
-/* Line 1455 of yacc.c */
-#line 110 "dtc-parser.y"
{
add_label(&(yyvsp[(2) - (2)].re)->labels, (yyvsp[(1) - (2)].labelref));
(yyval.re) = (yyvsp[(2) - (2)].re);
case 7:
-/* Line 1455 of yacc.c */
-#line 118 "dtc-parser.y"
{
(yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
;}
case 8:
-/* Line 1455 of yacc.c */
-#line 125 "dtc-parser.y"
{
(yyval.node) = name_node((yyvsp[(2) - (2)].node), "");
;}
case 9:
-/* Line 1455 of yacc.c */
-#line 129 "dtc-parser.y"
{
(yyval.node) = merge_nodes((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
;}
case 10:
-/* Line 1455 of yacc.c */
-#line 133 "dtc-parser.y"
{
struct node *target = get_node_by_ref((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].labelref));
case 11:
-/* Line 1455 of yacc.c */
-#line 146 "dtc-parser.y"
{
(yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
;}
case 12:
-/* Line 1455 of yacc.c */
-#line 153 "dtc-parser.y"
{
(yyval.proplist) = NULL;
;}
case 13:
-/* Line 1455 of yacc.c */
-#line 157 "dtc-parser.y"
{
(yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
;}
case 14:
-/* Line 1455 of yacc.c */
-#line 164 "dtc-parser.y"
{
(yyval.prop) = build_property((yyvsp[(1) - (4)].propnodename), (yyvsp[(3) - (4)].data));
;}
case 15:
-/* Line 1455 of yacc.c */
-#line 168 "dtc-parser.y"
{
(yyval.prop) = build_property((yyvsp[(1) - (2)].propnodename), empty_data);
;}
case 16:
-/* Line 1455 of yacc.c */
-#line 172 "dtc-parser.y"
{
add_label(&(yyvsp[(2) - (2)].prop)->labels, (yyvsp[(1) - (2)].labelref));
(yyval.prop) = (yyvsp[(2) - (2)].prop);
case 17:
-/* Line 1455 of yacc.c */
-#line 180 "dtc-parser.y"
{
(yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
;}
case 18:
-/* Line 1455 of yacc.c */
-#line 184 "dtc-parser.y"
{
(yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
;}
case 19:
-/* Line 1455 of yacc.c */
-#line 188 "dtc-parser.y"
{
(yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
;}
case 20:
-/* Line 1455 of yacc.c */
-#line 192 "dtc-parser.y"
{
(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
;}
case 21:
-/* Line 1455 of yacc.c */
-#line 196 "dtc-parser.y"
{
FILE *f = srcfile_relative_open((yyvsp[(4) - (9)].data).val, NULL);
struct data d;
case 22:
-/* Line 1455 of yacc.c */
-#line 213 "dtc-parser.y"
{
FILE *f = srcfile_relative_open((yyvsp[(4) - (5)].data).val, NULL);
struct data d = empty_data;
case 23:
-/* Line 1455 of yacc.c */
-#line 223 "dtc-parser.y"
{
(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
;}
case 24:
-/* Line 1455 of yacc.c */
-#line 230 "dtc-parser.y"
{
(yyval.data) = empty_data;
;}
case 25:
-/* Line 1455 of yacc.c */
-#line 234 "dtc-parser.y"
{
(yyval.data) = (yyvsp[(1) - (2)].data);
;}
case 26:
-/* Line 1455 of yacc.c */
-#line 238 "dtc-parser.y"
{
(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
;}
case 27:
-/* Line 1455 of yacc.c */
-#line 245 "dtc-parser.y"
{
(yyval.data) = empty_data;
;}
case 28:
-/* Line 1455 of yacc.c */
-#line 249 "dtc-parser.y"
{
(yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell));
;}
case 29:
-/* Line 1455 of yacc.c */
-#line 253 "dtc-parser.y"
{
(yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE,
(yyvsp[(2) - (2)].labelref)), -1);
case 30:
-/* Line 1455 of yacc.c */
-#line 258 "dtc-parser.y"
{
(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
;}
case 31:
-/* Line 1455 of yacc.c */
-#line 265 "dtc-parser.y"
{
(yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32);
;}
case 32:
-/* Line 1455 of yacc.c */
-#line 272 "dtc-parser.y"
{
(yyval.data) = empty_data;
;}
case 33:
-/* Line 1455 of yacc.c */
-#line 276 "dtc-parser.y"
{
(yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
;}
case 34:
-/* Line 1455 of yacc.c */
-#line 280 "dtc-parser.y"
{
(yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
;}
case 35:
-/* Line 1455 of yacc.c */
-#line 287 "dtc-parser.y"
{
(yyval.nodelist) = NULL;
;}
case 36:
-/* Line 1455 of yacc.c */
-#line 291 "dtc-parser.y"
{
(yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
;}
case 37:
-/* Line 1455 of yacc.c */
-#line 295 "dtc-parser.y"
{
print_error("syntax error: properties must precede subnodes");
YYERROR;
case 38:
-/* Line 1455 of yacc.c */
-#line 303 "dtc-parser.y"
{
(yyval.node) = name_node((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].propnodename));
;}
case 39:
-/* Line 1455 of yacc.c */
-#line 307 "dtc-parser.y"
{
add_label(&(yyvsp[(2) - (2)].node)->labels, (yyvsp[(1) - (2)].labelref));
(yyval.node) = (yyvsp[(2) - (2)].node);
-/* Line 1455 of yacc.c */
-#line 1783 "dtc-parser.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-/* Line 1675 of yacc.c */
-#line 313 "dtc-parser.y"
void print_error(char const *fmt, ...)