X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=scripts%2Fdtc%2Fdtc-lexer.lex.c_shipped;h=11cd78e723050e56d00709ef63164bd83cccff9e;hb=22a093b2fb52fb656658a32adc80c24ddc200ca4;hp=2d30f41778b7270b074798b4439952dca28d9c53;hpb=d1447464789918db1e1a3d0aaf50d3d0f6487a4f;p=firefly-linux-kernel-4.4.55.git diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped index 2d30f41778b7..11cd78e72305 100644 --- a/scripts/dtc/dtc-lexer.lex.c_shipped +++ b/scripts/dtc/dtc-lexer.lex.c_shipped @@ -9,7 +9,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -162,7 +162,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int yyleng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t yyleng; extern FILE *yyin, *yyout; @@ -171,6 +176,7 @@ extern FILE *yyin, *yyout; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -188,11 +194,6 @@ extern FILE *yyin, *yyout; #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -210,7 +211,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -280,8 +281,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -309,7 +310,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); @@ -341,7 +342,7 @@ void yyfree (void * ); /* Begin user sect3 */ -#define yywrap(n) 1 +#define yywrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -381,25 +382,25 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[161] = +static yyconst flex_int16_t yy_accept[159] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 + 0, 0, 0, 0, 0, 0, 0, 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, + 13, 19, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 16, 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] = @@ -440,157 +441,157 @@ static yyconst flex_int32_t yy_meta[47] = 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 + 8, 8, 8, 3, 1, 4 } ; -static yyconst flex_int16_t yy_base[175] = +static yyconst flex_int16_t yy_base[173] = { 0, - 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 + 0, 383, 34, 382, 65, 381, 37, 105, 387, 391, + 54, 111, 367, 110, 109, 109, 112, 41, 366, 104, + 367, 338, 124, 117, 0, 144, 391, 0, 121, 0, + 135, 155, 140, 179, 391, 160, 391, 379, 391, 0, + 368, 141, 391, 167, 370, 376, 346, 103, 342, 345, + 391, 391, 391, 391, 391, 358, 391, 391, 175, 342, + 338, 391, 355, 0, 185, 339, 184, 347, 346, 0, + 0, 322, 175, 357, 175, 363, 352, 324, 330, 323, + 332, 326, 201, 324, 329, 322, 391, 333, 181, 309, + 391, 341, 340, 313, 320, 338, 178, 311, 146, 317, + + 314, 315, 335, 331, 303, 300, 309, 299, 308, 188, + 336, 335, 391, 305, 320, 281, 283, 271, 203, 288, + 281, 271, 266, 264, 245, 242, 208, 104, 391, 391, + 244, 218, 204, 219, 206, 224, 201, 212, 204, 229, + 215, 208, 207, 200, 219, 391, 233, 221, 200, 181, + 391, 391, 149, 122, 86, 41, 391, 391, 245, 251, + 259, 263, 267, 273, 280, 284, 292, 300, 304, 310, + 318, 326 } ; -static yyconst flex_int16_t yy_def[175] = +static yyconst flex_int16_t yy_def[173] = { 0, - 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 + 158, 1, 1, 3, 158, 5, 1, 1, 158, 158, + 158, 158, 158, 159, 160, 161, 158, 158, 158, 158, + 162, 158, 158, 158, 163, 162, 158, 164, 165, 164, + 164, 158, 158, 158, 158, 159, 158, 159, 158, 166, + 158, 161, 158, 161, 167, 168, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 162, 158, 158, 158, 158, + 158, 158, 162, 164, 165, 164, 158, 158, 158, 169, + 166, 170, 161, 167, 167, 168, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 164, 158, 158, 169, 170, + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + + 158, 164, 158, 158, 158, 158, 158, 158, 158, 171, + 158, 164, 158, 158, 158, 158, 158, 158, 171, 158, + 171, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 172, 158, 158, 158, 172, 158, 172, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 158, 0, 158, 158, + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158 } ; -static yyconst flex_int16_t yy_nxt[440] = +static yyconst flex_int16_t yy_nxt[438] = { 0, - 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 + 10, 11, 12, 11, 13, 14, 10, 15, 16, 10, + 10, 10, 17, 10, 10, 10, 10, 18, 19, 20, + 21, 21, 21, 21, 21, 10, 10, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 10, 22, 10, 24, 25, 25, 25, + 32, 33, 33, 157, 26, 34, 34, 34, 51, 52, + 27, 26, 26, 26, 26, 10, 11, 12, 11, 13, + 14, 28, 15, 16, 28, 28, 28, 24, 28, 28, + 28, 10, 18, 19, 20, 29, 29, 29, 29, 29, + 30, 10, 29, 29, 29, 29, 29, 29, 29, 29, + + 29, 29, 29, 29, 29, 29, 29, 29, 10, 22, + 10, 23, 34, 34, 34, 37, 39, 43, 32, 33, + 33, 45, 54, 55, 46, 59, 45, 64, 156, 46, + 64, 64, 64, 79, 44, 38, 59, 57, 134, 47, + 135, 48, 80, 49, 47, 50, 48, 99, 61, 43, + 50, 110, 41, 67, 67, 67, 60, 63, 63, 63, + 57, 155, 68, 69, 63, 37, 44, 66, 67, 67, + 67, 63, 63, 63, 63, 73, 59, 68, 69, 70, + 34, 34, 34, 43, 75, 38, 154, 92, 83, 83, + 83, 64, 44, 120, 64, 64, 64, 67, 67, 67, + + 44, 57, 99, 68, 69, 107, 68, 69, 120, 127, + 108, 153, 152, 121, 83, 83, 83, 133, 133, 133, + 146, 133, 133, 133, 146, 140, 140, 140, 121, 141, + 140, 140, 140, 151, 141, 158, 150, 149, 148, 144, + 147, 143, 142, 139, 147, 36, 36, 36, 36, 36, + 36, 36, 36, 40, 138, 137, 136, 40, 40, 42, + 42, 42, 42, 42, 42, 42, 42, 56, 56, 56, + 56, 62, 132, 62, 64, 131, 130, 64, 129, 64, + 64, 65, 128, 158, 65, 65, 65, 65, 71, 127, + 71, 71, 74, 74, 74, 74, 74, 74, 74, 74, + + 76, 76, 76, 76, 76, 76, 76, 76, 89, 126, + 89, 90, 125, 90, 90, 124, 90, 90, 119, 119, + 119, 119, 119, 119, 119, 119, 145, 145, 145, 145, + 145, 145, 145, 145, 123, 122, 59, 59, 118, 117, + 116, 115, 114, 113, 45, 112, 108, 111, 109, 106, + 105, 104, 46, 103, 91, 87, 102, 101, 100, 98, + 97, 96, 95, 94, 93, 77, 75, 91, 88, 87, + 86, 57, 85, 84, 57, 82, 81, 78, 77, 75, + 72, 158, 58, 57, 53, 35, 158, 31, 23, 23, + 9, 158, 158, 158, 158, 158, 158, 158, 158, 158, + + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 158 } ; -static yyconst flex_int16_t yy_chk[440] = +static yyconst flex_int16_t yy_chk[438] = { 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, 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, - 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 + 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, + 7, 7, 7, 156, 3, 11, 11, 11, 18, 18, + 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 8, 12, 12, 12, 14, 15, 16, 8, 8, + 8, 17, 20, 20, 17, 23, 24, 29, 155, 24, + 29, 29, 29, 48, 16, 14, 31, 29, 128, 17, + 128, 17, 48, 17, 24, 17, 24, 99, 24, 42, + 24, 99, 15, 33, 33, 33, 23, 26, 26, 26, + 26, 154, 33, 33, 26, 36, 42, 31, 32, 32, + 32, 26, 26, 26, 26, 44, 59, 32, 32, 32, + 34, 34, 34, 73, 75, 36, 153, 75, 59, 59, + 59, 65, 44, 110, 65, 65, 65, 67, 67, 67, + + 73, 65, 83, 89, 89, 97, 67, 67, 119, 127, + 97, 150, 149, 110, 83, 83, 83, 133, 133, 133, + 141, 127, 127, 127, 145, 136, 136, 136, 119, 136, + 140, 140, 140, 148, 140, 147, 144, 143, 142, 139, + 141, 138, 137, 135, 145, 159, 159, 159, 159, 159, + 159, 159, 159, 160, 134, 132, 131, 160, 160, 161, + 161, 161, 161, 161, 161, 161, 161, 162, 162, 162, + 162, 163, 126, 163, 164, 125, 124, 164, 123, 164, + 164, 165, 122, 121, 165, 165, 165, 165, 166, 120, + 166, 166, 167, 167, 167, 167, 167, 167, 167, 167, + + 168, 168, 168, 168, 168, 168, 168, 168, 169, 118, + 169, 170, 117, 170, 170, 116, 170, 170, 171, 171, + 171, 171, 171, 171, 171, 171, 172, 172, 172, 172, + 172, 172, 172, 172, 115, 114, 112, 111, 109, 108, + 107, 106, 105, 104, 103, 102, 101, 100, 98, 96, + 95, 94, 93, 92, 90, 88, 86, 85, 84, 82, + 81, 80, 79, 78, 77, 76, 74, 72, 69, 68, + 66, 63, 61, 60, 56, 50, 49, 47, 46, 45, + 41, 38, 22, 21, 19, 13, 9, 6, 4, 2, + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 158 } ; static yy_state_type yy_last_accepting_state; @@ -631,13 +632,13 @@ char *yytext; - -#line 38 "dtc-lexer.l" +#line 37 "dtc-lexer.l" #include "dtc.h" #include "srcpos.h" #include "dtc-parser.tab.h" YYLTYPE yylloc; +extern bool treesource_error; /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ #define YY_USER_ACTION \ @@ -659,14 +660,14 @@ static int dts_version = 1; BEGIN(V1); \ static void push_input_file(const char *filename); -static int pop_input_file(void); -#line 664 "dtc-lexer.lex.c" +static bool pop_input_file(void); +static void lexical_error(const char *fmt, ...); +#line 666 "dtc-lexer.lex.c" #define INITIAL 0 -#define INCLUDE 1 -#define BYTESTRING 2 -#define PROPNODENAME 3 -#define V1 4 +#define BYTESTRING 1 +#define PROPNODENAME 2 +#define V1 3 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way @@ -703,7 +704,7 @@ FILE *yyget_out (void ); void yyset_out (FILE * out_str ); -int yyget_leng (void ); +yy_size_t yyget_leng (void ); char *yyget_text (void ); @@ -852,10 +853,6 @@ 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; @@ -882,6 +879,11 @@ YY_DECL yy_load_buffer_state( ); } + { +#line 68 "dtc-lexer.l" + +#line 886 "dtc-lexer.lex.c" + while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -899,7 +901,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -908,13 +910,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 >= 161 ) + if ( yy_current_state >= 159 ) 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 != 160 ); + while ( yy_current_state != 158 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -937,7 +939,7 @@ 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" +#line 69 "dtc-lexer.l" { char *name = strchr(yytext, '\"') + 1; yytext[yyleng-1] = '\0'; @@ -947,16 +949,16 @@ YY_RULE_SETUP case 2: /* rule 2 can match eol */ YY_RULE_SETUP -#line 74 "dtc-lexer.l" +#line 75 "dtc-lexer.l" { char *line, *tmp, *fn; /* skip text before line # */ line = yytext; - while (!isdigit(*line)) + while (!isdigit((unsigned char)*line)) line++; /* skip digits in line # */ tmp = line; - while (!isspace(*tmp)) + while (!isspace((unsigned char)*tmp)) tmp++; /* "NULL"-terminate line # */ *tmp = '\0'; @@ -970,11 +972,10 @@ YY_RULE_SETUP } 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" +#line 96 "dtc-lexer.l" { if (!pop_input_file()) { yyterminate(); @@ -984,7 +985,7 @@ case YY_STATE_EOF(V1): case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 101 "dtc-lexer.l" +#line 102 "dtc-lexer.l" { DPRINT("String: %s\n", yytext); yylval.data = data_copy_escape_string(yytext+1, @@ -994,7 +995,7 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 108 "dtc-lexer.l" +#line 109 "dtc-lexer.l" { DPRINT("Keyword: /dts-v1/\n"); dts_version = 1; @@ -1004,7 +1005,7 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP -#line 115 "dtc-lexer.l" +#line 116 "dtc-lexer.l" { DPRINT("Keyword: /memreserve/\n"); BEGIN_DEFAULT(); @@ -1013,7 +1014,7 @@ YY_RULE_SETUP YY_BREAK case 6: YY_RULE_SETUP -#line 121 "dtc-lexer.l" +#line 122 "dtc-lexer.l" { DPRINT("Keyword: /bits/\n"); BEGIN_DEFAULT(); @@ -1022,7 +1023,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 127 "dtc-lexer.l" +#line 128 "dtc-lexer.l" { DPRINT("Keyword: /delete-property/\n"); DPRINT("\n"); @@ -1032,7 +1033,7 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 134 "dtc-lexer.l" +#line 135 "dtc-lexer.l" { DPRINT("Keyword: /delete-node/\n"); DPRINT("\n"); @@ -1042,7 +1043,7 @@ YY_RULE_SETUP YY_BREAK case 9: YY_RULE_SETUP -#line 141 "dtc-lexer.l" +#line 142 "dtc-lexer.l" { DPRINT("Label: %s\n", yytext); yylval.labelref = xstrdup(yytext); @@ -1052,27 +1053,54 @@ YY_RULE_SETUP YY_BREAK case 10: YY_RULE_SETUP -#line 148 "dtc-lexer.l" +#line 149 "dtc-lexer.l" { - yylval.literal = xstrdup(yytext); - DPRINT("Literal: '%s'\n", yylval.literal); + char *e; + DPRINT("Integer Literal: '%s'\n", yytext); + + errno = 0; + yylval.integer = strtoull(yytext, &e, 0); + + assert(!(*e) || !e[strspn(e, "UL")]); + + if (errno == ERANGE) + lexical_error("Integer literal '%s' out of range", + yytext); + else + /* ERANGE is the only strtoull error triggerable + * by strings matching the pattern */ + assert(errno == 0); return DT_LITERAL; } YY_BREAK case 11: /* rule 11 can match eol */ YY_RULE_SETUP -#line 154 "dtc-lexer.l" +#line 168 "dtc-lexer.l" { - yytext[yyleng-1] = '\0'; - yylval.literal = xstrdup(yytext+1); - DPRINT("Character literal: %s\n", yylval.literal); + struct data d; + DPRINT("Character literal: %s\n", yytext); + + d = data_copy_escape_string(yytext+1, yyleng-2); + if (d.len == 1) { + lexical_error("Empty character literal"); + yylval.integer = 0; + return DT_CHAR_LITERAL; + } + + yylval.integer = (unsigned char)d.val[0]; + + if (d.len > 2) + lexical_error("Character literal has %d" + " characters instead of 1", + d.len - 1); + return DT_CHAR_LITERAL; } YY_BREAK case 12: YY_RULE_SETUP -#line 161 "dtc-lexer.l" +#line 189 "dtc-lexer.l" { /* label reference */ DPRINT("Ref: %s\n", yytext+1); yylval.labelref = xstrdup(yytext+1); @@ -1081,7 +1109,7 @@ YY_RULE_SETUP YY_BREAK case 13: YY_RULE_SETUP -#line 167 "dtc-lexer.l" +#line 195 "dtc-lexer.l" { /* new-style path reference */ yytext[yyleng-1] = '\0'; DPRINT("Ref: %s\n", yytext+2); @@ -1091,7 +1119,7 @@ YY_RULE_SETUP YY_BREAK case 14: YY_RULE_SETUP -#line 174 "dtc-lexer.l" +#line 202 "dtc-lexer.l" { yylval.byte = strtol(yytext, NULL, 16); DPRINT("Byte: %02x\n", (int)yylval.byte); @@ -1100,7 +1128,7 @@ YY_RULE_SETUP YY_BREAK case 15: YY_RULE_SETUP -#line 180 "dtc-lexer.l" +#line 208 "dtc-lexer.l" { DPRINT("/BYTESTRING\n"); BEGIN_DEFAULT(); @@ -1109,7 +1137,7 @@ YY_RULE_SETUP YY_BREAK case 16: YY_RULE_SETUP -#line 186 "dtc-lexer.l" +#line 214 "dtc-lexer.l" { DPRINT("PropNodeName: %s\n", yytext); yylval.propnodename = xstrdup((yytext[0] == '\\') ? @@ -1120,7 +1148,7 @@ YY_RULE_SETUP YY_BREAK case 17: YY_RULE_SETUP -#line 194 "dtc-lexer.l" +#line 222 "dtc-lexer.l" { DPRINT("Binary Include\n"); return DT_INCBIN; @@ -1129,64 +1157,64 @@ YY_RULE_SETUP case 18: /* rule 18 can match eol */ YY_RULE_SETUP -#line 199 "dtc-lexer.l" +#line 227 "dtc-lexer.l" /* eat whitespace */ YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP -#line 200 "dtc-lexer.l" +#line 228 "dtc-lexer.l" /* eat C-style comments */ YY_BREAK case 20: /* rule 20 can match eol */ YY_RULE_SETUP -#line 201 "dtc-lexer.l" +#line 229 "dtc-lexer.l" /* eat C++-style comments */ YY_BREAK case 21: YY_RULE_SETUP -#line 203 "dtc-lexer.l" +#line 231 "dtc-lexer.l" { return DT_LSHIFT; }; YY_BREAK case 22: YY_RULE_SETUP -#line 204 "dtc-lexer.l" +#line 232 "dtc-lexer.l" { return DT_RSHIFT; }; YY_BREAK case 23: YY_RULE_SETUP -#line 205 "dtc-lexer.l" +#line 233 "dtc-lexer.l" { return DT_LE; }; YY_BREAK case 24: YY_RULE_SETUP -#line 206 "dtc-lexer.l" +#line 234 "dtc-lexer.l" { return DT_GE; }; YY_BREAK case 25: YY_RULE_SETUP -#line 207 "dtc-lexer.l" +#line 235 "dtc-lexer.l" { return DT_EQ; }; YY_BREAK case 26: YY_RULE_SETUP -#line 208 "dtc-lexer.l" +#line 236 "dtc-lexer.l" { return DT_NE; }; YY_BREAK case 27: YY_RULE_SETUP -#line 209 "dtc-lexer.l" +#line 237 "dtc-lexer.l" { return DT_AND; }; YY_BREAK case 28: YY_RULE_SETUP -#line 210 "dtc-lexer.l" +#line 238 "dtc-lexer.l" { return DT_OR; }; YY_BREAK case 29: YY_RULE_SETUP -#line 212 "dtc-lexer.l" +#line 240 "dtc-lexer.l" { DPRINT("Char: %c (\\x%02x)\n", yytext[0], (unsigned)yytext[0]); @@ -1204,10 +1232,10 @@ YY_RULE_SETUP YY_BREAK case 30: YY_RULE_SETUP -#line 227 "dtc-lexer.l" +#line 255 "dtc-lexer.l" ECHO; YY_BREAK -#line 1211 "dtc-lexer.lex.c" +#line 1239 "dtc-lexer.lex.c" case YY_END_OF_BUFFER: { @@ -1337,6 +1365,7 @@ ECHO; "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1392,21 +1421,21 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1437,7 +1466,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1499,7 +1528,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 >= 161 ) + if ( yy_current_state >= 159 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1527,13 +1556,13 @@ 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 >= 161 ) + if ( yy_current_state >= 159 ) 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 == 160); + yy_is_jam = (yy_current_state == 158); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT @@ -1560,7 +1589,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -1834,7 +1863,7 @@ void yypop_buffer_state (void) */ static void yyensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -1931,12 +1960,12 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -2018,7 +2047,7 @@ FILE *yyget_out (void) /** Get the length of the current token. * */ -int yyget_leng (void) +yy_size_t yyget_leng (void) { return yyleng; } @@ -2166,7 +2195,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 227 "dtc-lexer.l" +#line 254 "dtc-lexer.l" @@ -2182,14 +2211,25 @@ static void push_input_file(const char *filename) } -static int pop_input_file(void) +static bool pop_input_file(void) { if (srcfile_pop() == 0) - return 0; + return false; yypop_buffer_state(); yyin = current_srcfile->f; - return 1; + return true; +} + +static void lexical_error(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + srcpos_verror(&yylloc, "Lexical error", fmt, ap); + va_end(ap); + + treesource_error = true; }