diff options
Diffstat (limited to 'scripts/dtc/dtc-lexer.lex.c_shipped')
| -rw-r--r-- | scripts/dtc/dtc-lexer.lex.c_shipped | 505 |
1 files changed, 362 insertions, 143 deletions
diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped index 8bbe1281705..2d30f41778b 100644 --- a/scripts/dtc/dtc-lexer.lex.c_shipped +++ b/scripts/dtc/dtc-lexer.lex.c_shipped @@ -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,37 +381,43 @@ 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] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, + 4, 4, 4, 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, - - 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, + 1, 2, 5, 6, 7, 1, 1, 8, 9, 1, + 1, 10, 11, 11, 12, 11, 13, 14, 15, 16, + 16, 16, 16, 16, 16, 16, 16, 17, 1, 18, + 19, 20, 11, 11, 21, 21, 21, 21, 21, 21, + 22, 22, 22, 22, 22, 23, 22, 22, 22, 22, + 22, 22, 22, 22, 24, 22, 22, 25, 22, 22, + 1, 26, 27, 1, 22, 1, 21, 28, 29, 30, + + 31, 21, 22, 22, 32, 22, 22, 33, 34, 35, + 36, 37, 22, 38, 39, 40, 41, 42, 22, 25, + 43, 22, 44, 45, 46, 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[47] = { 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, 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, - - 187, 195, 200, 205, 212 + 0, 385, 378, 40, 41, 383, 72, 382, 34, 44, + 388, 393, 61, 117, 368, 116, 115, 115, 115, 48, + 367, 107, 368, 339, 127, 120, 0, 147, 393, 0, + 127, 0, 133, 156, 168, 153, 393, 125, 393, 380, + 393, 0, 369, 127, 393, 160, 371, 377, 347, 21, + 343, 346, 393, 393, 393, 393, 393, 359, 393, 393, + 183, 343, 339, 393, 356, 0, 183, 340, 187, 348, + 347, 0, 0, 0, 178, 359, 195, 365, 354, 326, + 332, 325, 334, 328, 204, 326, 331, 324, 393, 335, + 150, 311, 343, 342, 315, 322, 340, 179, 313, 207, + + 319, 316, 317, 393, 337, 333, 305, 302, 311, 301, + 310, 190, 338, 337, 393, 307, 322, 301, 305, 277, + 208, 311, 307, 278, 271, 270, 248, 246, 213, 130, + 393, 393, 263, 235, 207, 221, 218, 229, 213, 213, + 206, 234, 218, 210, 208, 193, 219, 393, 223, 204, + 176, 157, 393, 393, 120, 106, 97, 119, 393, 393, + 245, 251, 259, 263, 267, 273, 280, 284, 292, 300, + 304, 310, 318, 326 } ; -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, - - 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, + + 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[440] = { 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, - - 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, - - 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 + 12, 13, 14, 13, 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, 53, 54, 29, 28, 28, + 28, 28, 12, 13, 14, 13, 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, 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 12, 24, 12, 36, 36, + 36, 39, 41, 45, 47, 56, 57, 48, 61, 47, + 39, 159, 48, 66, 61, 45, 66, 66, 66, 158, + 46, 40, 49, 59, 50, 157, 51, 49, 52, 50, + 40, 63, 46, 52, 36, 36, 36, 156, 43, 62, + 65, 65, 65, 59, 136, 68, 137, 65, 75, 69, + 69, 69, 70, 71, 65, 65, 65, 65, 70, 71, + 72, 69, 69, 69, 61, 46, 45, 155, 154, 66, + 70, 71, 66, 66, 66, 122, 85, 85, 85, 59, + + 69, 69, 69, 46, 77, 100, 109, 93, 100, 70, + 71, 110, 112, 122, 129, 123, 153, 85, 85, 85, + 135, 135, 135, 148, 148, 160, 135, 135, 135, 152, + 142, 142, 142, 123, 143, 142, 142, 142, 151, 143, + 150, 146, 145, 149, 149, 38, 38, 38, 38, 38, + 38, 38, 38, 42, 144, 141, 140, 42, 42, 44, + 44, 44, 44, 44, 44, 44, 44, 58, 58, 58, + 58, 64, 139, 64, 66, 138, 134, 66, 133, 66, + 66, 67, 132, 131, 67, 67, 67, 67, 73, 130, + 73, 73, 76, 76, 76, 76, 76, 76, 76, 76, + + 78, 78, 78, 78, 78, 78, 78, 78, 91, 160, + 91, 92, 129, 92, 92, 128, 92, 92, 121, 121, + 121, 121, 121, 121, 121, 121, 147, 147, 147, 147, + 147, 147, 147, 147, 127, 126, 125, 124, 61, 61, + 120, 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, 160 } ; -static yyconst flex_int16_t yy_chk[281] = +static yyconst flex_int16_t yy_chk[440] = { 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, 1, 4, 9, 9, 9, + 10, 50, 4, 5, 5, 5, 5, 10, 10, 10, + 50, 5, 13, 13, 13, 20, 20, 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, - 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, - - 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 + 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, + 14, 16, 17, 18, 19, 22, 22, 19, 25, 26, + 38, 158, 26, 31, 33, 44, 31, 31, 31, 157, + 18, 16, 19, 31, 19, 156, 19, 26, 19, 26, + 38, 26, 44, 26, 36, 36, 36, 155, 17, 25, + 28, 28, 28, 28, 130, 33, 130, 28, 46, 34, + 34, 34, 91, 91, 28, 28, 28, 28, 34, 34, + 34, 35, 35, 35, 61, 46, 75, 152, 151, 67, + 35, 35, 67, 67, 67, 112, 61, 61, 61, 67, + + 69, 69, 69, 75, 77, 85, 98, 77, 100, 69, + 69, 98, 100, 121, 129, 112, 150, 85, 85, 85, + 135, 135, 135, 143, 147, 149, 129, 129, 129, 146, + 138, 138, 138, 121, 138, 142, 142, 142, 145, 142, + 144, 141, 140, 143, 147, 161, 161, 161, 161, 161, + 161, 161, 161, 162, 139, 137, 136, 162, 162, 163, + 163, 163, 163, 163, 163, 163, 163, 164, 164, 164, + 164, 165, 134, 165, 166, 133, 128, 166, 127, 166, + 166, 167, 126, 125, 167, 167, 167, 167, 168, 124, + 168, 168, 169, 169, 169, 169, 169, 169, 169, 169, + + 170, 170, 170, 170, 170, 170, 170, 170, 171, 123, + 171, 172, 122, 172, 172, 120, 172, 172, 173, 173, + 173, 173, 173, 173, 173, 173, 174, 174, 174, 174, + 174, 174, 174, 174, 119, 118, 117, 116, 114, 113, + 111, 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, 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) |
