dtc: import latest upstream dtc

This updates scripts/dtc to commit 317a5d9 "dtc: zero out new label
objects" from git://git.jdl.com/software/dtc.git.

This adds features such as:
* /bits/ syntax for cell data.
* Math expressions within cell data.
* The ability to delete properties or nodes.
* Support for #line directives in the input file, which allows the use of
  cpp on *.dts.
* -i command-line option (/include/ path)
* -W/-E command-line options for error/warning control.
* Removal of spew to STDOUT containing the filename being compiled.
* Many additions to the libfdt API.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Jon Loeliger <jdl@jdl.com>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
This commit is contained in:
Stephen Warren
2012-09-28 21:25:59 +00:00
committed by Rob Herring
parent acc2097934
commit cd296721a9
30 changed files with 3845 additions and 699 deletions

View File

@@ -1,5 +1,6 @@
#line 2 "dtc-lexer.lex.c"
#line 3 "scripts/dtc/dtc-lexer.lex.c_shipped"
#line 4 "dtc-lexer.lex.c"
#define YY_INT_ALIGNED short int
@@ -53,7 +54,6 @@ typedef int flex_int32_t;
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
@@ -84,6 +84,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -140,7 +142,15 @@ typedef unsigned int flex_uint32_t;
/* 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.
@@ -362,8 +372,8 @@ static void yy_fatal_error (yyconst char msg[] );
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 17
#define YY_END_OF_BUFFER 18
#define YY_NUM_RULES 30
#define YY_END_OF_BUFFER 31
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -371,19 +381,25 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_accept[94] =
static yyconst flex_int16_t yy_accept[161] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
18, 16, 13, 13, 16, 16, 16, 16, 16, 16,
16, 10, 11, 11, 6, 6, 13, 0, 2, 0,
7, 0, 0, 0, 0, 0, 0, 0, 5, 0,
9, 9, 11, 11, 6, 0, 7, 0, 0, 0,
0, 15, 0, 0, 0, 0, 6, 0, 14, 0,
0, 0, 0, 0, 8, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 3, 12,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
0, 4, 0
31, 29, 18, 18, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 15, 16,
16, 29, 16, 10, 10, 18, 26, 0, 3, 0,
27, 12, 0, 0, 11, 0, 0, 0, 0, 0,
0, 0, 21, 23, 25, 24, 22, 0, 9, 28,
0, 0, 0, 14, 14, 16, 16, 16, 10, 10,
10, 0, 12, 0, 11, 0, 0, 0, 20, 0,
0, 0, 0, 0, 0, 0, 0, 16, 10, 10,
10, 0, 19, 0, 0, 0, 0, 0, 0, 0,
0, 0, 16, 13, 0, 0, 0, 0, 0, 0,
0, 0, 0, 16, 6, 0, 0, 0, 0, 0,
0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
4, 17, 0, 0, 2, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
0, 0, 5, 8, 0, 0, 0, 0, 7, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -391,17 +407,17 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 1, 4, 5, 1, 1, 6, 1, 1,
1, 7, 5, 5, 8, 5, 9, 10, 11, 12,
12, 12, 12, 12, 12, 12, 12, 13, 1, 1,
1, 1, 5, 5, 14, 14, 14, 14, 14, 14,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 16, 15, 15,
1, 17, 18, 1, 15, 1, 14, 19, 20, 21,
1, 2, 4, 5, 6, 1, 1, 7, 8, 1,
1, 9, 10, 10, 11, 10, 12, 13, 14, 15,
15, 15, 15, 15, 15, 15, 15, 16, 1, 17,
18, 19, 10, 10, 20, 20, 20, 20, 20, 20,
21, 21, 21, 21, 21, 22, 21, 21, 21, 21,
21, 21, 21, 21, 23, 21, 21, 24, 21, 21,
1, 25, 26, 1, 21, 1, 20, 27, 28, 29,
22, 14, 15, 15, 23, 15, 15, 24, 25, 26,
15, 15, 15, 27, 28, 29, 30, 31, 15, 16,
15, 15, 32, 1, 33, 1, 1, 1, 1, 1,
30, 20, 21, 21, 31, 21, 21, 32, 33, 34,
35, 36, 21, 37, 38, 39, 40, 41, 21, 24,
42, 21, 43, 44, 45, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -418,112 +434,163 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;
static yyconst flex_int32_t yy_meta[34] =
static yyconst flex_int32_t yy_meta[46] =
{ 0,
1, 1, 1, 1, 2, 1, 2, 2, 3, 4,
4, 4, 5, 6, 7, 7, 1, 1, 6, 6,
6, 6, 7, 7, 7, 7, 7, 7, 7, 7,
7, 8, 1
1, 1, 1, 1, 1, 2, 3, 1, 2, 2,
2, 4, 5, 5, 5, 6, 1, 1, 1, 7,
8, 8, 8, 8, 1, 1, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 3, 1, 1
} ;
static yyconst flex_int16_t yy_base[106] =
static yyconst flex_int16_t yy_base[175] =
{ 0,
0, 0, 237, 236, 25, 0, 47, 0, 30, 71,
244, 247, 82, 84, 84, 211, 95, 229, 218, 0,
111, 247, 0, 84, 83, 95, 106, 86, 247, 237,
0, 230, 231, 234, 207, 209, 212, 220, 247, 206,
247, 218, 0, 106, 116, 0, 0, 0, 223, 89,
226, 219, 199, 206, 200, 204, 0, 190, 213, 212,
202, 91, 178, 161, 247, 172, 144, 150, 140, 130,
140, 124, 128, 120, 138, 137, 123, 122, 247, 247,
134, 114, 132, 86, 135, 125, 90, 136, 247, 97,
29, 247, 247, 153, 156, 161, 165, 170, 176, 180,
0, 388, 381, 40, 41, 386, 71, 385, 34, 44,
390, 395, 60, 62, 371, 112, 111, 111, 111, 104,
370, 106, 371, 342, 124, 119, 0, 144, 395, 0,
123, 0, 159, 153, 165, 167, 395, 130, 395, 382,
395, 0, 372, 122, 395, 157, 374, 379, 350, 21,
346, 349, 395, 395, 395, 395, 395, 362, 395, 395,
181, 346, 342, 395, 359, 0, 191, 343, 190, 351,
350, 0, 0, 0, 173, 362, 177, 367, 357, 329,
335, 328, 337, 331, 206, 329, 334, 327, 395, 338,
170, 314, 346, 345, 318, 325, 343, 158, 316, 212,
187, 195, 200, 205, 212
322, 319, 320, 395, 340, 336, 308, 305, 314, 304,
295, 138, 208, 220, 395, 292, 305, 265, 264, 254,
201, 222, 285, 275, 273, 270, 236, 235, 225, 115,
395, 395, 252, 216, 216, 217, 214, 230, 209, 220,
213, 239, 211, 217, 216, 209, 229, 395, 240, 225,
206, 169, 395, 395, 116, 106, 99, 54, 395, 395,
254, 260, 268, 272, 276, 282, 289, 293, 301, 309,
313, 319, 327, 335
} ;
static yyconst flex_int16_t yy_def[106] =
static yyconst flex_int16_t yy_def[175] =
{ 0,
93, 1, 1, 1, 1, 5, 93, 7, 1, 1,
93, 93, 93, 93, 94, 95, 93, 96, 17, 97,
96, 93, 98, 99, 93, 93, 93, 94, 93, 94,
100, 93, 101, 102, 93, 93, 93, 96, 93, 93,
93, 96, 98, 99, 93, 103, 100, 104, 101, 101,
102, 93, 93, 93, 93, 93, 103, 104, 93, 93,
93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
93, 93, 93, 93, 93, 105, 93, 105, 93, 105,
93, 93, 0, 93, 93, 93, 93, 93, 93, 93,
160, 1, 1, 1, 1, 5, 160, 7, 1, 1,
160, 160, 160, 160, 160, 161, 162, 163, 160, 160,
160, 160, 164, 160, 160, 160, 165, 164, 160, 166,
167, 166, 166, 160, 160, 160, 160, 161, 160, 161,
160, 168, 160, 163, 160, 163, 169, 170, 160, 160,
160, 160, 160, 160, 160, 160, 160, 164, 160, 160,
160, 160, 160, 160, 164, 166, 167, 166, 160, 160,
160, 171, 168, 172, 163, 169, 169, 170, 160, 160,
160, 160, 160, 160, 160, 160, 160, 166, 160, 160,
171, 172, 160, 160, 160, 160, 160, 160, 160, 160,
93, 93, 93, 93, 93
160, 160, 166, 160, 160, 160, 160, 160, 160, 160,
160, 173, 160, 166, 160, 160, 160, 160, 160, 160,
173, 160, 173, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 174, 160, 160, 160, 174, 160, 174, 160,
160, 160, 160, 160, 160, 160, 160, 160, 160, 0,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160
} ;
static yyconst flex_int16_t yy_nxt[281] =
static yyconst flex_int16_t yy_nxt[441] =
{ 0,
12, 13, 14, 15, 12, 16, 12, 12, 17, 12,
12, 12, 12, 18, 18, 18, 12, 12, 18, 18,
18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
18, 12, 12, 19, 20, 20, 20, 92, 21, 25,
26, 26, 22, 21, 21, 21, 21, 12, 13, 14,
15, 23, 16, 23, 23, 19, 23, 23, 23, 12,
24, 24, 24, 12, 12, 24, 24, 24, 24, 24,
24, 24, 24, 24, 24, 24, 24, 24, 12, 12,
25, 26, 26, 27, 27, 27, 27, 29, 43, 29,
43, 43, 45, 45, 45, 50, 39, 59, 46, 93,
12, 13, 14, 15, 16, 12, 17, 18, 12, 12,
12, 19, 12, 12, 12, 12, 20, 21, 22, 23,
23, 23, 23, 23, 12, 12, 23, 23, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
23, 23, 12, 24, 12, 25, 34, 35, 35, 25,
81, 26, 26, 27, 27, 27, 34, 35, 35, 82,
28, 36, 36, 36, 36, 159, 29, 28, 28, 28,
28, 12, 13, 14, 15, 16, 30, 17, 18, 30,
30, 30, 26, 30, 30, 30, 12, 20, 21, 22,
31, 31, 31, 31, 31, 32, 12, 31, 31, 31,
30, 33, 30, 34, 45, 45, 45, 27, 27, 68,
43, 91, 43, 43, 69, 35, 87, 36, 39, 37,
42, 42, 42, 39, 42, 45, 45, 45, 89, 42,
42, 42, 42, 85, 85, 86, 85, 85, 86, 89,
84, 90, 83, 82, 81, 80, 79, 78, 77, 76,
75, 74, 90, 28, 28, 28, 28, 28, 28, 28,
28, 31, 31, 31, 38, 38, 38, 38, 41, 73,
41, 43, 72, 43, 71, 43, 43, 44, 33, 44,
44, 44, 44, 47, 69, 47, 47, 49, 49, 49,
49, 49, 49, 49, 49, 51, 51, 51, 51, 51,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 12, 24, 12, 39, 41, 45, 47,
53, 54, 48, 56, 57, 61, 61, 47, 66, 45,
48, 66, 66, 66, 39, 46, 40, 49, 59, 50,
158, 51, 122, 52, 157, 49, 46, 50, 136, 63,
137, 52, 156, 43, 40, 62, 65, 65, 65, 59,
61, 61, 123, 65, 75, 69, 69, 69, 36, 36,
65, 65, 65, 65, 70, 71, 72, 69, 69, 69,
45, 46, 61, 61, 109, 77, 70, 71, 93, 110,
68, 70, 71, 85, 85, 85, 66, 46, 155, 66,
51, 51, 51, 57, 70, 57, 58, 58, 58, 67,
58, 58, 88, 88, 88, 88, 88, 88, 88, 88,
34, 66, 65, 64, 63, 62, 61, 60, 52, 50,
39, 56, 39, 55, 54, 53, 52, 50, 48, 93,
40, 39, 32, 93, 19, 19, 11, 93, 93, 93,
93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
93, 93, 93, 93, 93, 93, 93, 93, 93, 93
66, 66, 69, 69, 69, 122, 59, 100, 100, 61,
61, 70, 71, 100, 100, 148, 112, 154, 85, 85,
85, 61, 61, 129, 129, 123, 129, 129, 135, 135,
135, 142, 142, 148, 143, 149, 153, 135, 135, 135,
142, 142, 160, 143, 152, 151, 150, 146, 145, 144,
141, 140, 139, 149, 38, 38, 38, 38, 38, 38,
38, 38, 42, 138, 134, 133, 42, 42, 44, 44,
44, 44, 44, 44, 44, 44, 58, 58, 58, 58,
64, 132, 64, 66, 131, 130, 66, 160, 66, 66,
67, 128, 127, 67, 67, 67, 67, 73, 126, 73,
73, 76, 76, 76, 76, 76, 76, 76, 76, 78,
78, 78, 78, 78, 78, 78, 78, 91, 125, 91,
92, 124, 92, 92, 120, 92, 92, 121, 121, 121,
121, 121, 121, 121, 121, 147, 147, 147, 147, 147,
147, 147, 147, 119, 118, 117, 116, 115, 47, 114,
110, 113, 111, 108, 107, 106, 48, 105, 104, 89,
103, 102, 101, 99, 98, 97, 96, 95, 94, 79,
77, 90, 89, 88, 59, 87, 86, 59, 84, 83,
80, 79, 77, 74, 160, 60, 59, 55, 37, 160,
33, 25, 26, 25, 11, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160
} ;
static yyconst flex_int16_t yy_chk[281] =
static yyconst flex_int16_t yy_chk[441] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 5, 5, 5, 5, 91, 5, 9,
9, 9, 5, 5, 5, 5, 5, 7, 7, 7,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 4, 9, 9, 9, 10,
50, 4, 5, 5, 5, 5, 10, 10, 10, 50,
5, 13, 13, 14, 14, 158, 5, 5, 5, 5,
5, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
10, 10, 10, 13, 13, 14, 14, 15, 24, 28,
24, 24, 25, 25, 25, 50, 24, 50, 25, 90,
15, 17, 28, 17, 26, 26, 26, 27, 27, 62,
44, 87, 44, 44, 62, 17, 84, 17, 44, 17,
21, 21, 21, 21, 21, 45, 45, 45, 86, 21,
21, 21, 21, 83, 83, 83, 85, 85, 85, 88,
82, 86, 81, 78, 77, 76, 75, 74, 73, 72,
71, 70, 88, 94, 94, 94, 94, 94, 94, 94,
94, 95, 95, 95, 96, 96, 96, 96, 97, 69,
97, 98, 68, 98, 67, 98, 98, 99, 66, 99,
99, 99, 99, 100, 64, 100, 100, 101, 101, 101,
101, 101, 101, 101, 101, 102, 102, 102, 102, 102,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 16, 17, 18, 19,
20, 20, 19, 22, 22, 25, 25, 26, 31, 44,
26, 31, 31, 31, 38, 18, 16, 19, 31, 19,
157, 19, 112, 19, 156, 26, 44, 26, 130, 26,
130, 26, 155, 17, 38, 25, 28, 28, 28, 28,
33, 33, 112, 28, 46, 34, 34, 34, 36, 36,
28, 28, 28, 28, 34, 34, 34, 35, 35, 35,
75, 46, 61, 61, 98, 77, 35, 35, 77, 98,
33, 91, 91, 61, 61, 61, 67, 75, 152, 67,
102, 102, 102, 103, 63, 103, 104, 104, 104, 61,
104, 104, 105, 105, 105, 105, 105, 105, 105, 105,
60, 59, 58, 56, 55, 54, 53, 52, 51, 49,
42, 40, 38, 37, 36, 35, 34, 33, 32, 30,
19, 18, 16, 11, 4, 3, 93, 93, 93, 93,
93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
93, 93, 93, 93, 93, 93, 93, 93, 93, 93
67, 67, 69, 69, 69, 121, 67, 85, 85, 113,
113, 69, 69, 100, 100, 143, 100, 151, 85, 85,
85, 114, 114, 122, 122, 121, 129, 129, 135, 135,
135, 138, 138, 147, 138, 143, 150, 129, 129, 129,
142, 142, 149, 142, 146, 145, 144, 141, 140, 139,
137, 136, 134, 147, 161, 161, 161, 161, 161, 161,
161, 161, 162, 133, 128, 127, 162, 162, 163, 163,
163, 163, 163, 163, 163, 163, 164, 164, 164, 164,
165, 126, 165, 166, 125, 124, 166, 123, 166, 166,
167, 120, 119, 167, 167, 167, 167, 168, 118, 168,
168, 169, 169, 169, 169, 169, 169, 169, 169, 170,
170, 170, 170, 170, 170, 170, 170, 171, 117, 171,
172, 116, 172, 172, 111, 172, 172, 173, 173, 173,
173, 173, 173, 173, 173, 174, 174, 174, 174, 174,
174, 174, 174, 110, 109, 108, 107, 106, 105, 103,
102, 101, 99, 97, 96, 95, 94, 93, 92, 90,
88, 87, 86, 84, 83, 82, 81, 80, 79, 78,
76, 71, 70, 68, 65, 63, 62, 58, 52, 51,
49, 48, 47, 43, 40, 24, 23, 21, 15, 11,
8, 6, 3, 2, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160
} ;
static yy_state_type yy_last_accepting_state;
@@ -540,6 +607,7 @@ int yy_flex_debug = 0;
#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.
*
@@ -561,6 +629,10 @@ char *yytext;
*/
#define YY_NO_INPUT 1
#line 38 "dtc-lexer.l"
#include "dtc.h"
#include "srcpos.h"
#include "dtc-parser.tab.h"
@@ -588,6 +660,7 @@ static int dts_version = 1;
static void push_input_file(const char *filename);
static int pop_input_file(void);
#line 664 "dtc-lexer.lex.c"
#define INITIAL 0
#define INCLUDE 1
@@ -670,7 +743,12 @@ static int input (void );
/* 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. */
@@ -689,7 +767,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
unsigned n; \
size_t n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -761,6 +839,9 @@ extern int yylex (void);
#endif
#define YY_RULE_SETUP \
if ( yyleng > 0 ) \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
(yytext[yyleng - 1] == '\n'); \
YY_USER_ACTION
/** The main scanner function which does all the work.
@@ -771,6 +852,10 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
#line 67 "dtc-lexer.l"
#line 858 "dtc-lexer.lex.c"
if ( !(yy_init) )
{
(yy_init) = 1;
@@ -810,6 +895,7 @@ YY_DECL
yy_bp = yy_cp;
yy_current_state = (yy_start);
yy_current_state += YY_AT_BOL();
yy_match:
do
{
@@ -822,13 +908,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 94 )
if ( yy_current_state >= 161 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_current_state != 93 );
while ( yy_current_state != 160 );
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
@@ -851,26 +937,54 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
#line 68 "dtc-lexer.l"
{
char *name = strchr(yytext, '\"') + 1;
yytext[yyleng-1] = '\0';
push_input_file(name);
}
YY_BREAK
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
#line 74 "dtc-lexer.l"
{
char *line, *tmp, *fn;
/* skip text before line # */
line = yytext;
while (!isdigit(*line))
line++;
/* skip digits in line # */
tmp = line;
while (!isspace(*tmp))
tmp++;
/* "NULL"-terminate line # */
*tmp = '\0';
/* start of filename */
fn = strchr(tmp + 1, '"') + 1;
/* strip trailing " from filename */
tmp = strchr(fn, '"');
*tmp = 0;
/* -1 since #line is the number of the next line */
srcpos_set_line(xstrdup(fn), atoi(line) - 1);
}
YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(INCLUDE):
case YY_STATE_EOF(BYTESTRING):
case YY_STATE_EOF(PROPNODENAME):
case YY_STATE_EOF(V1):
#line 95 "dtc-lexer.l"
{
if (!pop_input_file()) {
yyterminate();
}
}
YY_BREAK
case 2:
/* rule 2 can match eol */
case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
#line 101 "dtc-lexer.l"
{
DPRINT("String: %s\n", yytext);
yylval.data = data_copy_escape_string(yytext+1,
@@ -878,8 +992,9 @@ YY_RULE_SETUP
return DT_STRING;
}
YY_BREAK
case 3:
case 4:
YY_RULE_SETUP
#line 108 "dtc-lexer.l"
{
DPRINT("Keyword: /dts-v1/\n");
dts_version = 1;
@@ -887,16 +1002,47 @@ YY_RULE_SETUP
return DT_V1;
}
YY_BREAK
case 4:
case 5:
YY_RULE_SETUP
#line 115 "dtc-lexer.l"
{
DPRINT("Keyword: /memreserve/\n");
BEGIN_DEFAULT();
return DT_MEMRESERVE;
}
YY_BREAK
case 5:
case 6:
YY_RULE_SETUP
#line 121 "dtc-lexer.l"
{
DPRINT("Keyword: /bits/\n");
BEGIN_DEFAULT();
return DT_BITS;
}
YY_BREAK
case 7:
YY_RULE_SETUP
#line 127 "dtc-lexer.l"
{
DPRINT("Keyword: /delete-property/\n");
DPRINT("<PROPNODENAME>\n");
BEGIN(PROPNODENAME);
return DT_DEL_PROP;
}
YY_BREAK
case 8:
YY_RULE_SETUP
#line 134 "dtc-lexer.l"
{
DPRINT("Keyword: /delete-node/\n");
DPRINT("<PROPNODENAME>\n");
BEGIN(PROPNODENAME);
return DT_DEL_NODE;
}
YY_BREAK
case 9:
YY_RULE_SETUP
#line 141 "dtc-lexer.l"
{
DPRINT("Label: %s\n", yytext);
yylval.labelref = xstrdup(yytext);
@@ -904,24 +1050,38 @@ YY_RULE_SETUP
return DT_LABEL;
}
YY_BREAK
case 6:
case 10:
YY_RULE_SETUP
#line 148 "dtc-lexer.l"
{
yylval.literal = xstrdup(yytext);
DPRINT("Literal: '%s'\n", yylval.literal);
return DT_LITERAL;
}
YY_BREAK
case 7:
case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
#line 154 "dtc-lexer.l"
{
yytext[yyleng-1] = '\0';
yylval.literal = xstrdup(yytext+1);
DPRINT("Character literal: %s\n", yylval.literal);
return DT_CHAR_LITERAL;
}
YY_BREAK
case 12:
YY_RULE_SETUP
#line 161 "dtc-lexer.l"
{ /* label reference */
DPRINT("Ref: %s\n", yytext+1);
yylval.labelref = xstrdup(yytext+1);
return DT_REF;
}
YY_BREAK
case 8:
case 13:
YY_RULE_SETUP
#line 167 "dtc-lexer.l"
{ /* new-style path reference */
yytext[yyleng-1] = '\0';
DPRINT("Ref: %s\n", yytext+2);
@@ -929,55 +1089,104 @@ YY_RULE_SETUP
return DT_REF;
}
YY_BREAK
case 9:
case 14:
YY_RULE_SETUP
#line 174 "dtc-lexer.l"
{
yylval.byte = strtol(yytext, NULL, 16);
DPRINT("Byte: %02x\n", (int)yylval.byte);
return DT_BYTE;
}
YY_BREAK
case 10:
case 15:
YY_RULE_SETUP
#line 180 "dtc-lexer.l"
{
DPRINT("/BYTESTRING\n");
BEGIN_DEFAULT();
return ']';
}
YY_BREAK
case 11:
case 16:
YY_RULE_SETUP
#line 186 "dtc-lexer.l"
{
DPRINT("PropNodeName: %s\n", yytext);
yylval.propnodename = xstrdup(yytext);
yylval.propnodename = xstrdup((yytext[0] == '\\') ?
yytext + 1 : yytext);
BEGIN_DEFAULT();
return DT_PROPNODENAME;
}
YY_BREAK
case 12:
case 17:
YY_RULE_SETUP
#line 194 "dtc-lexer.l"
{
DPRINT("Binary Include\n");
return DT_INCBIN;
}
YY_BREAK
case 13:
/* rule 13 can match eol */
case 18:
/* rule 18 can match eol */
YY_RULE_SETUP
#line 199 "dtc-lexer.l"
/* eat whitespace */
YY_BREAK
case 14:
/* rule 14 can match eol */
case 19:
/* rule 19 can match eol */
YY_RULE_SETUP
#line 200 "dtc-lexer.l"
/* eat C-style comments */
YY_BREAK
case 15:
/* rule 15 can match eol */
case 20:
/* rule 20 can match eol */
YY_RULE_SETUP
#line 201 "dtc-lexer.l"
/* eat C++-style comments */
YY_BREAK
case 16:
case 21:
YY_RULE_SETUP
#line 203 "dtc-lexer.l"
{ return DT_LSHIFT; };
YY_BREAK
case 22:
YY_RULE_SETUP
#line 204 "dtc-lexer.l"
{ return DT_RSHIFT; };
YY_BREAK
case 23:
YY_RULE_SETUP
#line 205 "dtc-lexer.l"
{ return DT_LE; };
YY_BREAK
case 24:
YY_RULE_SETUP
#line 206 "dtc-lexer.l"
{ return DT_GE; };
YY_BREAK
case 25:
YY_RULE_SETUP
#line 207 "dtc-lexer.l"
{ return DT_EQ; };
YY_BREAK
case 26:
YY_RULE_SETUP
#line 208 "dtc-lexer.l"
{ return DT_NE; };
YY_BREAK
case 27:
YY_RULE_SETUP
#line 209 "dtc-lexer.l"
{ return DT_AND; };
YY_BREAK
case 28:
YY_RULE_SETUP
#line 210 "dtc-lexer.l"
{ return DT_OR; };
YY_BREAK
case 29:
YY_RULE_SETUP
#line 212 "dtc-lexer.l"
{
DPRINT("Char: %c (\\x%02x)\n", yytext[0],
(unsigned)yytext[0]);
@@ -993,10 +1202,12 @@ YY_RULE_SETUP
return yytext[0];
}
YY_BREAK
case 17:
case 30:
YY_RULE_SETUP
#line 227 "dtc-lexer.l"
ECHO;
YY_BREAK
#line 1211 "dtc-lexer.lex.c"
case YY_END_OF_BUFFER:
{
@@ -1275,6 +1486,7 @@ static int yy_get_next_buffer (void)
register char *yy_cp;
yy_current_state = (yy_start);
yy_current_state += YY_AT_BOL();
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
{
@@ -1287,7 +1499,7 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 94 )
if ( yy_current_state >= 161 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1315,11 +1527,11 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 94 )
if ( yy_current_state >= 161 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 93);
yy_is_jam = (yy_current_state == 160);
return yy_is_jam ? 0 : yy_current_state;
}
@@ -1394,6 +1606,8 @@ static int yy_get_next_buffer (void)
*(yy_c_buf_p) = '\0'; /* preserve yytext */
(yy_hold_char) = *++(yy_c_buf_p);
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
return c;
}
#endif /* ifndef YY_NO_INPUT */
@@ -1712,8 +1926,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
/** 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 bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
@@ -1952,6 +2166,10 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
#line 227 "dtc-lexer.l"
static void push_input_file(const char *filename)
{
assert(filename);
@@ -1963,6 +2181,7 @@ static void push_input_file(const char *filename)
yypush_buffer_state(yy_create_buffer(yyin,YY_BUF_SIZE));
}
static int pop_input_file(void)
{
if (srcfile_pop() == 0)