diff options
Diffstat (limited to 'dist/Mesa/src/glsl/glcpp/glcpp-lex.c')
-rw-r--r-- | dist/Mesa/src/glsl/glcpp/glcpp-lex.c | 739 |
1 files changed, 352 insertions, 387 deletions
diff --git a/dist/Mesa/src/glsl/glcpp/glcpp-lex.c b/dist/Mesa/src/glsl/glcpp/glcpp-lex.c index 6f1d9ebbf..577d5d53c 100644 --- a/dist/Mesa/src/glsl/glcpp/glcpp-lex.c +++ b/dist/Mesa/src/glsl/glcpp/glcpp-lex.c @@ -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 36 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -54,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 @@ -85,6 +84,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -170,6 +171,11 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 @@ -192,11 +198,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -#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 @@ -214,7 +215,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 @@ -293,7 +294,7 @@ static void glcpp__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner YY_BUFFER_STATE glcpp__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE glcpp__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE glcpp__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); +YY_BUFFER_STATE glcpp__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); void *glcpp_alloc (yy_size_t ,yyscan_t yyscanner ); void *glcpp_realloc (void *,yy_size_t ,yyscan_t yyscanner ); @@ -325,7 +326,7 @@ void glcpp_free (void * ,yyscan_t yyscanner ); /* Begin user sect3 */ -#define glcpp_wrap(n) 1 +#define glcpp_wrap(yyscanner) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -358,43 +359,24 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_acclist[125] = +static yyconst flex_int16_t yy_accept[150] = { 0, - 3, 3, 44, 39, 43, 40, 43, 41, 43, 43, - 38, 43, 43, 38, 43, 38, 43, 38, 43, 25, - 39, 43, 24, 39, 43, 38, 43, 38, 43, 38, - 43, 37, 39, 43, 37, 39, 43, 38, 43, 40, - 43, 23, 43, 3, 43, 4, 43, 5, 43, 42, - 43, 18, 43, 18, 43, 18, 43, 39, 40, 32, - 35, 33, 2, 1, 25, 39, 25, 39, 39, 24, - 39, 24, 39, 27, 29, 31, 30, 28, 37, 39, - 37, 39, 34, 40, 23, 23, 3, 4, 5, 6, - 5, 7, 1, 26, 39, 37, 39, 26, 39, 37, - - 39, 14, 37, 39, 15, 16, 37, 39, 17, 19, - 12, 22, 36, 37, 39, 21, 19, 13,16404, 11, - 9, 8, 8212, 10 - } ; - -static yyconst flex_int16_t yy_accept[155] = - { 0, - 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, - 3, 4, 6, 8, 10, 11, 13, 14, 16, 18, - 20, 23, 26, 28, 30, 32, 35, 38, 40, 42, - 44, 46, 48, 50, 52, 54, 56, 58, 59, 60, - 61, 62, 63, 64, 65, 67, 69, 70, 72, 74, - 75, 76, 77, 78, 79, 81, 83, 84, 85, 86, - 87, 87, 87, 87, 87, 87, 87, 87, 88, 89, - 90, 91, 92, 93, 93, 93, 93, 93, 94, 96, - 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, - 98, 100, 102, 102, 102, 102, 102, 102, 102, 103, - - 103, 103, 103, 103, 103, 103, 105, 105, 106, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 109, - 109, 110, 111, 111, 112, 112, 112, 112, 113, 113, - 116, 117, 118, 118, 119, 119, 119, 119, 120, 120, - 120, 121, 121, 122, 123, 123, 123, 123, 124, 124, - 124, 125, 125, 125 + 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, + 0, 0, 44, 39, 40, 41, 43, 38, 43, 38, + 38, 38, 25, 24, 38, 38, 38, 37, 37, 38, + 40, 23, 3, 4, 5, 42, 17, 17, 17, 21, + 39, 40, 32, 35, 33, 2, 1, 25, 25, 0, + 24, 24, 27, 29, 31, 30, 28, 37, 37, 34, + 40, 23, 23, 0, 0, 0, 0, 0, 0, 0, + 3, 4, 5, 6, 5, 7, 0, 0, 0, 0, + 20, 21, 1, 26, 37, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 26, 37, 0, 0, 0, + + 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 15, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 37, 0, 14, 16, 18, 0, 11, + 0, 10, 0, 22, 0, 36, 0, 18, 0, 12, + 0, 0, 19, 0, 9, 0, 0, 8, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -431,159 +413,148 @@ static yyconst flex_int32_t yy_ec[256] = static yyconst flex_int32_t yy_meta[40] = { 0, - 1, 2, 3, 4, 4, 4, 4, 4, 5, 6, - 4, 7, 7, 7, 4, 4, 4, 8, 8, 8, - 8, 8, 9, 8, 8, 8, 8, 8, 8, 9, - 8, 8, 8, 8, 8, 8, 8, 8, 4 + 1, 1, 2, 1, 1, 1, 1, 1, 3, 4, + 1, 5, 5, 5, 1, 1, 1, 5, 6, 6, + 6, 5, 7, 5, 5, 6, 6, 6, 6, 8, + 6, 6, 6, 6, 6, 6, 6, 6, 1 } ; -static yyconst flex_int16_t yy_base[168] = +static yyconst flex_int16_t yy_base[164] = { 0, - 0, 38, 0, 0, 38, 39, 328, 327, 326, 44, - 328, 0, 325, 332, 332, 310, 319, 332, 316, 41, - 41, 44, 44, 307, 49, 321, 44, 282, 61, 79, - 317, 332, 72, 332, 332, 67, 68, 0, 317, 332, - 332, 332, 332, 0, 34, 0, 105, 0, 0, 332, - 332, 332, 332, 332, 317, 73, 332, 82, 311, 310, - 291, 61, 289, 286, 279, 281, 286, 306, 332, 90, - 332, 94, 332, 84, 85, 108, 48, 0, 88, 95, - 283, 86, 284, 273, 270, 91, 274, 281, 279, 268, - 0, 124, 273, 274, 274, 270, 265, 271, 332, 267, - - 264, 262, 259, 260, 249, 125, 245, 332, 332, 241, - 229, 231, 223, 209, 222, 194, 197, 194, 130, 196, - 332, 0, 181, 332, 189, 131, 191, 332, 181, 210, - 162, 0, 136, 332, 134, 0, 130, 155, 111, 138, - 332, 153, 0, 332, 125, 41, 156, 332, 34, 136, - 332, 159, 332, 173, 182, 191, 200, 209, 218, 227, - 236, 245, 254, 263, 272, 280, 285 + 0, 38, 0, 0, 38, 39, 321, 320, 319, 44, + 50, 0, 321, 319, 317, 325, 325, 302, 311, 325, + 308, 80, 80, 83, 83, 299, 88, 0, 290, 274, + 100, 118, 309, 325, 104, 325, 325, 106, 107, 302, + 309, 307, 325, 325, 325, 325, 0, 113, 325, 0, + 115, 325, 325, 325, 325, 325, 325, 0, 283, 325, + 111, 301, 300, 281, 110, 279, 276, 269, 271, 276, + 296, 325, 149, 325, 153, 325, 130, 120, 151, 15, + 325, 289, 0, 74, 270, 271, 96, 272, 261, 258, + 135, 262, 269, 267, 256, 325, 258, 260, 261, 261, + + 257, 252, 258, 325, 257, 257, 255, 252, 253, 242, + 245, 231, 0, 325, 228, 219, 216, 213, 208, 216, + 148, 151, 147, 150, 148, 325, 325, 0, 137, 325, + 145, 167, 146, 325, 136, 0, 164, 0, 135, 325, + 0, 131, 155, 108, 0, 135, 91, 109, 325, 178, + 186, 194, 202, 206, 214, 222, 228, 236, 240, 247, + 255, 259, 267 } ; -static yyconst flex_int16_t yy_def[168] = +static yyconst flex_int16_t yy_def[164] = { 0, - 153, 1, 154, 154, 155, 155, 156, 156, 157, 157, - 153, 158, 153, 153, 153, 153, 153, 153, 153, 153, - 158, 158, 153, 153, 153, 159, 159, 153, 153, 153, - 160, 153, 161, 153, 153, 153, 153, 158, 153, 153, - 153, 153, 153, 162, 21, 158, 158, 22, 158, 153, - 153, 153, 153, 153, 159, 159, 153, 153, 30, 30, - 153, 153, 153, 153, 153, 153, 153, 160, 153, 161, - 153, 161, 153, 153, 153, 153, 153, 162, 47, 159, - 153, 153, 153, 153, 153, 163, 153, 153, 153, 153, - 158, 159, 153, 153, 153, 153, 153, 153, 153, 153, - - 153, 153, 153, 153, 153, 159, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 159, 153, - 153, 164, 153, 153, 153, 153, 153, 153, 153, 159, - 153, 164, 153, 153, 153, 165, 153, 166, 153, 153, - 153, 153, 165, 153, 167, 153, 153, 153, 167, 153, - 153, 153, 0, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153 + 149, 1, 150, 150, 151, 151, 152, 152, 153, 153, + 149, 11, 149, 149, 149, 149, 149, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 154, 154, 149, + 149, 149, 155, 149, 156, 149, 149, 149, 149, 157, + 149, 149, 149, 149, 149, 149, 158, 149, 149, 159, + 149, 149, 149, 149, 149, 149, 149, 154, 154, 149, + 149, 32, 32, 149, 149, 149, 149, 149, 149, 149, + 155, 149, 156, 149, 156, 149, 149, 149, 149, 149, + 149, 157, 158, 159, 154, 149, 149, 149, 149, 149, + 160, 149, 149, 149, 149, 149, 154, 149, 149, 149, + + 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, + 154, 149, 161, 149, 149, 149, 149, 149, 149, 149, + 149, 149, 149, 154, 149, 149, 149, 162, 149, 149, + 149, 149, 149, 149, 149, 154, 149, 162, 149, 149, + 163, 149, 149, 149, 163, 149, 149, 149, 0, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, + 149, 149, 149 } ; -static yyconst flex_int16_t yy_nxt[372] = +static yyconst flex_int16_t yy_nxt[365] = { 0, - 12, 13, 14, 15, 16, 17, 18, 19, 18, 18, - 20, 21, 22, 22, 23, 24, 25, 26, 26, 26, - 26, 26, 27, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 28, 29, - 32, 32, 148, 30, 38, 36, 14, 33, 33, 37, - 43, 44, 45, 45, 38, 48, 48, 48, 50, 51, - 46, 47, 58, 49, 53, 54, 59, 56, 74, 76, - 136, 38, 75, 38, 71, 82, 46, 83, 47, 49, - 60, 72, 73, 58, 41, 74, 76, 59, 82, 75, - 83, 77, 71, 84, 63, 38, 71, 80, 85, 153, - - 153, 61, 62, 72, 73, 63, 64, 91, 77, 76, - 65, 63, 94, 100, 66, 67, 79, 79, 79, 95, - 101, 92, 79, 91, 38, 38, 79, 79, 79, 79, - 38, 77, 126, 148, 63, 140, 141, 150, 151, 140, - 141, 146, 135, 135, 135, 142, 142, 142, 119, 147, - 147, 147, 130, 106, 140, 141, 138, 150, 151, 144, - 150, 151, 139, 138, 142, 142, 142, 152, 152, 152, - 152, 152, 152, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 34, 34, 34, 34, 34, 34, 34, 34, 34, - - 35, 35, 35, 35, 35, 35, 35, 35, 35, 38, - 38, 137, 136, 134, 133, 38, 38, 38, 55, 131, - 129, 128, 127, 126, 55, 55, 55, 68, 68, 68, - 68, 68, 125, 68, 68, 68, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 78, 78, 124, 78, 78, - 78, 78, 78, 78, 99, 99, 99, 99, 99, 99, - 123, 122, 99, 132, 132, 121, 132, 132, 132, 132, - 132, 132, 143, 143, 120, 143, 143, 143, 143, 143, - 143, 145, 118, 117, 116, 115, 114, 145, 145, 149, - 113, 149, 149, 149, 112, 111, 110, 109, 108, 107, - - 105, 104, 103, 102, 98, 97, 96, 93, 69, 90, - 89, 88, 87, 86, 81, 153, 153, 38, 39, 69, - 57, 38, 52, 42, 41, 40, 39, 153, 14, 15, - 15, 11, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153 + 14, 15, 16, 17, 18, 19, 20, 21, 20, 20, + 22, 23, 24, 24, 25, 26, 27, 28, 28, 28, + 28, 28, 29, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 30, 31, + 34, 34, 87, 32, 88, 38, 16, 35, 35, 39, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 17, 46, + 47, 48, 48, 96, 51, 51, 51, 53, 54, 49, + + 50, 61, 52, 56, 57, 62, 74, 77, 79, 96, + 148, 78, 61, 75, 76, 49, 62, 50, 52, 63, + 141, 79, 99, 44, 48, 48, 51, 51, 51, 100, + 80, 77, 49, 66, 52, 78, 148, 87, 147, 88, + 64, 65, 89, 80, 66, 67, 66, 90, 49, 68, + 52, 74, 79, 69, 70, 74, 143, 105, 149, 149, + 146, 144, 75, 76, 106, 143, 142, 141, 132, 140, + 139, 137, 136, 135, 80, 134, 133, 66, 17, 17, + 17, 17, 17, 17, 17, 17, 33, 33, 33, 33, + 33, 33, 33, 33, 36, 36, 36, 36, 36, 36, + + 36, 36, 37, 37, 37, 37, 37, 37, 37, 37, + 58, 58, 58, 58, 71, 71, 71, 132, 71, 71, + 71, 71, 73, 73, 73, 73, 73, 73, 73, 73, + 82, 131, 82, 82, 82, 82, 83, 130, 83, 83, + 83, 83, 83, 83, 84, 129, 84, 104, 104, 104, + 104, 128, 127, 104, 104, 126, 126, 126, 126, 138, + 125, 138, 138, 138, 138, 138, 138, 145, 124, 145, + 145, 145, 145, 145, 145, 123, 122, 121, 120, 119, + 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, + 108, 107, 103, 102, 101, 98, 97, 81, 72, 95, + + 94, 93, 92, 91, 86, 149, 149, 85, 42, 41, + 81, 72, 60, 59, 55, 45, 44, 43, 42, 41, + 149, 16, 17, 17, 13, 149, 149, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, + 149, 149, 149, 149 } ; -static yyconst flex_int16_t yy_chk[372] = +static yyconst flex_int16_t yy_chk[365] = { 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, 2, - 5, 6, 149, 2, 27, 10, 10, 5, 6, 10, - 20, 20, 21, 21, 45, 22, 22, 22, 23, 23, - 21, 21, 29, 22, 25, 25, 29, 27, 36, 37, - 146, 45, 36, 56, 33, 77, 21, 77, 21, 22, - 30, 33, 33, 58, 30, 74, 75, 58, 62, 74, - 62, 37, 70, 62, 37, 80, 72, 56, 62, 70, - - 70, 30, 30, 72, 72, 30, 30, 79, 75, 76, - 30, 75, 82, 86, 30, 30, 47, 47, 47, 82, - 86, 80, 47, 79, 92, 106, 47, 47, 47, 47, - 119, 76, 126, 145, 76, 135, 135, 150, 150, 140, - 140, 139, 126, 126, 126, 135, 135, 135, 106, 140, - 140, 140, 119, 92, 142, 142, 138, 147, 147, 137, - 152, 152, 133, 131, 142, 142, 142, 147, 147, 147, - 152, 152, 152, 154, 154, 154, 154, 154, 154, 154, - 154, 154, 155, 155, 155, 155, 155, 155, 155, 155, - 155, 156, 156, 156, 156, 156, 156, 156, 156, 156, - - 157, 157, 157, 157, 157, 157, 157, 157, 157, 158, - 130, 129, 127, 125, 123, 158, 158, 158, 159, 120, - 118, 117, 116, 115, 159, 159, 159, 160, 160, 160, - 160, 160, 114, 160, 160, 160, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 162, 162, 113, 162, 162, - 162, 162, 162, 162, 163, 163, 163, 163, 163, 163, - 112, 111, 163, 164, 164, 110, 164, 164, 164, 164, - 164, 164, 165, 165, 107, 165, 165, 165, 165, 165, - 165, 166, 105, 104, 103, 102, 101, 166, 166, 167, - 100, 167, 167, 167, 98, 97, 96, 95, 94, 93, - - 90, 89, 88, 87, 85, 84, 83, 81, 68, 67, - 66, 65, 64, 63, 61, 60, 59, 55, 39, 31, - 28, 26, 24, 19, 17, 16, 13, 11, 9, 8, - 7, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153 + 5, 6, 80, 2, 80, 10, 10, 5, 6, 10, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 22, + 22, 23, 23, 84, 24, 24, 24, 25, 25, 23, + + 23, 31, 24, 27, 27, 31, 35, 38, 39, 84, + 148, 38, 61, 35, 35, 23, 61, 23, 24, 32, + 147, 78, 87, 32, 48, 48, 51, 51, 51, 87, + 39, 77, 48, 39, 51, 77, 146, 65, 144, 65, + 32, 32, 65, 78, 32, 32, 78, 65, 48, 32, + 51, 73, 79, 32, 32, 75, 143, 91, 73, 73, + 142, 139, 75, 75, 91, 137, 135, 133, 132, 131, + 129, 125, 124, 123, 79, 122, 121, 79, 150, 150, + 150, 150, 150, 150, 150, 150, 151, 151, 151, 151, + 151, 151, 151, 151, 152, 152, 152, 152, 152, 152, + + 152, 152, 153, 153, 153, 153, 153, 153, 153, 153, + 154, 154, 154, 154, 155, 155, 155, 120, 155, 155, + 155, 155, 156, 156, 156, 156, 156, 156, 156, 156, + 157, 119, 157, 157, 157, 157, 158, 118, 158, 158, + 158, 158, 158, 158, 159, 117, 159, 160, 160, 160, + 160, 116, 115, 160, 160, 161, 161, 161, 161, 162, + 112, 162, 162, 162, 162, 162, 162, 163, 111, 163, + 163, 163, 163, 163, 163, 110, 109, 108, 107, 106, + 105, 103, 102, 101, 100, 99, 98, 97, 95, 94, + 93, 92, 90, 89, 88, 86, 85, 82, 71, 70, + + 69, 68, 67, 66, 64, 63, 62, 59, 42, 41, + 40, 33, 30, 29, 26, 21, 19, 18, 15, 14, + 13, 9, 8, 7, 149, 149, 149, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, + 149, 149, 149, 149 } ; -#define YY_TRAILING_MASK 0x2000 -#define YY_TRAILING_HEAD_MASK 0x4000 -#define REJECT \ -{ \ -*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ \ -yy_cp = yyg->yy_full_match; /* restore poss. backed-over text */ \ -yyg->yy_lp = yyg->yy_full_lp; /* restore orig. accepting pos. */ \ -yyg->yy_state_ptr = yyg->yy_full_state; /* restore orig. state */ \ -yy_current_state = *yyg->yy_state_ptr; /* restore curr. state */ \ -++yyg->yy_lp; \ -goto find_rule; \ -} - +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET @@ -630,12 +601,18 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner); #define YY_NO_INPUT -#define YY_USER_ACTION \ - do { \ - yylloc->first_column = yycolumn + 1; \ - yylloc->first_line = yylineno; \ - yycolumn += yyleng; \ - } while(0); +#define YY_USER_ACTION \ + do { \ + if (parser->has_new_line_number) \ + yylineno = parser->new_line_number; \ + if (parser->has_new_source_number) \ + yylloc->source = parser->new_source_number; \ + yylloc->first_column = yycolumn + 1; \ + yylloc->first_line = yylineno; \ + yycolumn += yyleng; \ + parser->has_new_line_number = 0; \ + parser->has_new_source_number = 0; \ + } while(0); #define YY_USER_INIT \ do { \ @@ -644,13 +621,28 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner); yylloc->source = 0; \ } while(0) -#line 648 "glcpp/glcpp-lex.c" +/* The OTHER class is simply a catch-all for things that the CPP +parser just doesn't care about. Since flex regular expressions that +match longer strings take priority over those matching shorter +strings, we have to be careful to avoid OTHER matching and hiding +something that CPP does care about. So we simply exclude all +characters that appear in any other expressions. */ +#line 631 "glcpp/glcpp-lex.c" #define INITIAL 0 #define DONE 1 #define COMMENT 2 #define UNREACHABLE 3 #define SKIP 4 +#define DEFINE 5 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include <unistd.h> +#endif #define YY_EXTRA_TYPE glcpp_parser_t * @@ -667,8 +659,8 @@ struct yyguts_t size_t yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; - int yy_n_chars; - int yyleng_r; + yy_size_t yy_n_chars; + yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -682,17 +674,6 @@ struct yyguts_t int yylineno_r; int yy_flex_debug_r; - yy_state_type *yy_state_buf; - yy_state_type *yy_state_ptr; - char *yy_full_match; - int yy_lp; - - /* These are only needed for trailing context rules, - * but there's no conditional variable for that yet. */ - int yy_looking_for_trail_begin; - int yy_full_lp; - int *yy_full_state; - char *yytext_r; int yy_more_flag; int yy_more_len; @@ -736,7 +717,7 @@ FILE *glcpp_get_out (yyscan_t yyscanner ); void glcpp_set_out (FILE * out_str ,yyscan_t yyscanner ); -int glcpp_get_leng (yyscan_t yyscanner ); +yy_size_t glcpp_get_leng (yyscan_t yyscanner ); char *glcpp_get_text (yyscan_t yyscanner ); @@ -744,6 +725,10 @@ int glcpp_get_lineno (yyscan_t yyscanner ); void glcpp_set_lineno (int line_number ,yyscan_t yyscanner ); +int glcpp_get_column (yyscan_t yyscanner ); + +void glcpp_set_column (int column_no ,yyscan_t yyscanner ); + YYSTYPE * glcpp_get_lval (yyscan_t yyscanner ); void glcpp_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); @@ -800,7 +785,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -811,7 +796,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - int n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -899,7 +884,7 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 80 "glcpp/glcpp-lex.l" +#line 94 "glcpp/glcpp-lex.l" /* Implicitly switch between SKIP and INITIAL (non-skipping); * don't switch if some other state was explicitly set. @@ -914,7 +899,7 @@ YY_DECL } /* Single-line comments */ -#line 918 "glcpp/glcpp-lex.c" +#line 903 "glcpp/glcpp-lex.c" yylval = yylval_param; @@ -928,12 +913,6 @@ YY_DECL YY_USER_INIT; #endif - /* Create the reject buffer large enough to save one state per allowed character. */ - if ( ! yyg->yy_state_buf ) - yyg->yy_state_buf = (yy_state_type *)glcpp_alloc(YY_STATE_BUF_SIZE ,yyscanner); - if ( ! yyg->yy_state_buf ) - YY_FATAL_ERROR( "out of dynamic memory in glcpp_lex()" ); - if ( ! yyg->yy_start ) yyg->yy_start = 1; /* first start state */ @@ -966,64 +945,30 @@ YY_DECL yy_current_state = yyg->yy_start; yy_current_state += YY_AT_BOL(); - - yyg->yy_state_ptr = yyg->yy_state_buf; - *yyg->yy_state_ptr++ = yy_current_state; - yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } 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 >= 154 ) + if ( yy_current_state >= 150 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yyg->yy_state_ptr++ = yy_current_state; ++yy_cp; } - while ( yy_current_state != 153 ); + while ( yy_current_state != 149 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; yy_find_action: - yy_current_state = *--yyg->yy_state_ptr; - yyg->yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yyg->yy_lp && yyg->yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yyg->yy_lp]; - if ( yy_act & YY_TRAILING_HEAD_MASK || - yyg->yy_looking_for_trail_begin ) - { - if ( yy_act == yyg->yy_looking_for_trail_begin ) - { - yyg->yy_looking_for_trail_begin = 0; - yy_act &= ~YY_TRAILING_HEAD_MASK; - break; - } - } - else if ( yy_act & YY_TRAILING_MASK ) - { - yyg->yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK; - yyg->yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK; - } - else - { - yyg->yy_full_match = yy_cp; - yyg->yy_full_state = yyg->yy_state_ptr; - yyg->yy_full_lp = yyg->yy_lp; - break; - } - ++yyg->yy_lp; - goto find_rule; - } - --yy_cp; - yy_current_state = *--yyg->yy_state_ptr; - yyg->yy_lp = yy_accept[yy_current_state]; - } + yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; @@ -1031,43 +976,50 @@ do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + case 1: YY_RULE_SETUP -#line 94 "glcpp/glcpp-lex.l" +#line 108 "glcpp/glcpp-lex.l" { } YY_BREAK /* Multi-line comments */ case 2: YY_RULE_SETUP -#line 98 "glcpp/glcpp-lex.l" +#line 112 "glcpp/glcpp-lex.l" { yy_push_state(COMMENT, yyscanner); } YY_BREAK case 3: YY_RULE_SETUP -#line 99 "glcpp/glcpp-lex.l" +#line 113 "glcpp/glcpp-lex.l" YY_BREAK case 4: /* rule 4 can match eol */ YY_RULE_SETUP -#line 100 "glcpp/glcpp-lex.l" +#line 114 "glcpp/glcpp-lex.l" { yylineno++; yycolumn = 0; return NEWLINE; } YY_BREAK case 5: YY_RULE_SETUP -#line 101 "glcpp/glcpp-lex.l" +#line 115 "glcpp/glcpp-lex.l" YY_BREAK case 6: /* rule 6 can match eol */ YY_RULE_SETUP -#line 102 "glcpp/glcpp-lex.l" +#line 116 "glcpp/glcpp-lex.l" { yylineno++; yycolumn = 0; return NEWLINE; } YY_BREAK case 7: YY_RULE_SETUP -#line 103 "glcpp/glcpp-lex.l" +#line 117 "glcpp/glcpp-lex.l" { yy_pop_state(yyscanner); if (yyextra->space_tokens) @@ -1076,7 +1028,7 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 109 "glcpp/glcpp-lex.l" +#line 123 "glcpp/glcpp-lex.l" { yylval->str = ralloc_strdup (yyextra, yytext); yyextra->space_tokens = 0; @@ -1087,7 +1039,7 @@ YY_RULE_SETUP * Simply pass them through to the main compiler's lexer/parser. */ case 9: YY_RULE_SETUP -#line 117 "glcpp/glcpp-lex.l" +#line 131 "glcpp/glcpp-lex.l" { yylval->str = ralloc_strdup (yyextra, yytext); yylineno++; @@ -1096,114 +1048,82 @@ YY_RULE_SETUP } YY_BREAK case 10: -*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ -yyg->yy_c_buf_p = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 124 "glcpp/glcpp-lex.l" +#line 138 "glcpp/glcpp-lex.l" { - /* Eat characters until the first digit is - * encountered - */ - char *ptr = yytext; - while (!isdigit(*ptr)) - ptr++; - - /* Subtract one from the line number because - * yylineno is zero-based instead of - * one-based. - */ - yylineno = strtol(ptr, &ptr, 0) - 1; - yylloc->source = strtol(ptr, NULL, 0); -} - YY_BREAK -case 11: -*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ -yyg->yy_c_buf_p = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 140 "glcpp/glcpp-lex.l" -{ - /* Eat characters until the first digit is - * encountered - */ - char *ptr = yytext; - while (!isdigit(*ptr)) - ptr++; - - /* Subtract one from the line number because - * yylineno is zero-based instead of - * one-based. - */ - yylineno = strtol(ptr, &ptr, 0) - 1; + return HASH_LINE; } YY_BREAK -case 12: +case 11: YY_RULE_SETUP -#line 156 "glcpp/glcpp-lex.l" +#line 143 "glcpp/glcpp-lex.l" { yyextra->lexing_if = 1; yyextra->space_tokens = 0; return HASH_IFDEF; } YY_BREAK -case 13: +case 12: YY_RULE_SETUP -#line 162 "glcpp/glcpp-lex.l" +#line 149 "glcpp/glcpp-lex.l" { yyextra->lexing_if = 1; yyextra->space_tokens = 0; return HASH_IFNDEF; } YY_BREAK -case 14: -/* rule 14 can match eol */ +case 13: +/* rule 13 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 168 "glcpp/glcpp-lex.l" +#line 155 "glcpp/glcpp-lex.l" { yyextra->lexing_if = 1; yyextra->space_tokens = 0; return HASH_IF; } YY_BREAK -case 15: +case 14: +/* rule 14 can match eol */ +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 174 "glcpp/glcpp-lex.l" +#line 161 "glcpp/glcpp-lex.l" { yyextra->lexing_if = 1; yyextra->space_tokens = 0; return HASH_ELIF; } YY_BREAK -case 16: +case 15: YY_RULE_SETUP -#line 180 "glcpp/glcpp-lex.l" +#line 167 "glcpp/glcpp-lex.l" { yyextra->space_tokens = 0; return HASH_ELSE; } YY_BREAK -case 17: +case 16: YY_RULE_SETUP -#line 185 "glcpp/glcpp-lex.l" +#line 172 "glcpp/glcpp-lex.l" { yyextra->space_tokens = 0; return HASH_ENDIF; } YY_BREAK -case 18: +case 17: YY_RULE_SETUP -#line 191 "glcpp/glcpp-lex.l" +#line 178 "glcpp/glcpp-lex.l" ; YY_BREAK -case 19: +case 18: YY_RULE_SETUP -#line 193 "glcpp/glcpp-lex.l" +#line 180 "glcpp/glcpp-lex.l" { char *p; for (p = yytext; !isalpha(p[0]); p++); /* skip " # " */ @@ -1211,25 +1131,39 @@ YY_RULE_SETUP glcpp_error(yylloc, yyextra, "#error%s", p); } YY_BREAK -case 20: +case 19: YY_RULE_SETUP -#line 200 "glcpp/glcpp-lex.l" +#line 187 "glcpp/glcpp-lex.l" { yyextra->space_tokens = 0; - return HASH_DEFINE_FUNC; + yy_push_state(DEFINE, yyscanner); + return HASH_DEFINE; +} + YY_BREAK +case 20: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 193 "glcpp/glcpp-lex.l" +{ + yy_pop_state(yyscanner); + yylval->str = ralloc_strdup (yyextra, yytext); + return FUNC_IDENTIFIER; } YY_BREAK case 21: YY_RULE_SETUP -#line 205 "glcpp/glcpp-lex.l" +#line 199 "glcpp/glcpp-lex.l" { - yyextra->space_tokens = 0; - return HASH_DEFINE_OBJ; + yy_pop_state(yyscanner); + yylval->str = ralloc_strdup (yyextra, yytext); + return OBJ_IDENTIFIER; } YY_BREAK case 22: YY_RULE_SETUP -#line 210 "glcpp/glcpp-lex.l" +#line 205 "glcpp/glcpp-lex.l" { yyextra->space_tokens = 0; return HASH_UNDEF; @@ -1237,7 +1171,7 @@ YY_RULE_SETUP YY_BREAK case 23: YY_RULE_SETUP -#line 215 "glcpp/glcpp-lex.l" +#line 210 "glcpp/glcpp-lex.l" { yyextra->space_tokens = 0; return HASH; @@ -1245,7 +1179,7 @@ YY_RULE_SETUP YY_BREAK case 24: YY_RULE_SETUP -#line 220 "glcpp/glcpp-lex.l" +#line 215 "glcpp/glcpp-lex.l" { yylval->str = ralloc_strdup (yyextra, yytext); return INTEGER_STRING; @@ -1253,7 +1187,7 @@ YY_RULE_SETUP YY_BREAK case 25: YY_RULE_SETUP -#line 225 "glcpp/glcpp-lex.l" +#line 220 "glcpp/glcpp-lex.l" { yylval->str = ralloc_strdup (yyextra, yytext); return INTEGER_STRING; @@ -1261,7 +1195,7 @@ YY_RULE_SETUP YY_BREAK case 26: YY_RULE_SETUP -#line 230 "glcpp/glcpp-lex.l" +#line 225 "glcpp/glcpp-lex.l" { yylval->str = ralloc_strdup (yyextra, yytext); return INTEGER_STRING; @@ -1269,77 +1203,79 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 235 "glcpp/glcpp-lex.l" +#line 230 "glcpp/glcpp-lex.l" { return LEFT_SHIFT; } YY_BREAK case 28: YY_RULE_SETUP -#line 239 "glcpp/glcpp-lex.l" +#line 234 "glcpp/glcpp-lex.l" { return RIGHT_SHIFT; } YY_BREAK case 29: YY_RULE_SETUP -#line 243 "glcpp/glcpp-lex.l" +#line 238 "glcpp/glcpp-lex.l" { return LESS_OR_EQUAL; } YY_BREAK case 30: YY_RULE_SETUP -#line 247 "glcpp/glcpp-lex.l" +#line 242 "glcpp/glcpp-lex.l" { return GREATER_OR_EQUAL; } YY_BREAK case 31: YY_RULE_SETUP -#line 251 "glcpp/glcpp-lex.l" +#line 246 "glcpp/glcpp-lex.l" { return EQUAL; } YY_BREAK case 32: YY_RULE_SETUP -#line 255 "glcpp/glcpp-lex.l" +#line 250 "glcpp/glcpp-lex.l" { return NOT_EQUAL; } YY_BREAK case 33: YY_RULE_SETUP -#line 259 "glcpp/glcpp-lex.l" +#line 254 "glcpp/glcpp-lex.l" { return AND; } YY_BREAK case 34: YY_RULE_SETUP -#line 263 "glcpp/glcpp-lex.l" +#line 258 "glcpp/glcpp-lex.l" { return OR; } YY_BREAK case 35: YY_RULE_SETUP -#line 267 "glcpp/glcpp-lex.l" +#line 262 "glcpp/glcpp-lex.l" { + if (parser->is_gles) + glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES"); return PASTE; } YY_BREAK case 36: YY_RULE_SETUP -#line 271 "glcpp/glcpp-lex.l" +#line 268 "glcpp/glcpp-lex.l" { return DEFINED; } YY_BREAK case 37: YY_RULE_SETUP -#line 275 "glcpp/glcpp-lex.l" +#line 272 "glcpp/glcpp-lex.l" { yylval->str = ralloc_strdup (yyextra, yytext); return IDENTIFIER; @@ -1347,14 +1283,14 @@ YY_RULE_SETUP YY_BREAK case 38: YY_RULE_SETUP -#line 280 "glcpp/glcpp-lex.l" +#line 277 "glcpp/glcpp-lex.l" { return yytext[0]; } YY_BREAK case 39: YY_RULE_SETUP -#line 284 "glcpp/glcpp-lex.l" +#line 281 "glcpp/glcpp-lex.l" { yylval->str = ralloc_strdup (yyextra, yytext); return OTHER; @@ -1362,7 +1298,7 @@ YY_RULE_SETUP YY_BREAK case 40: YY_RULE_SETUP -#line 289 "glcpp/glcpp-lex.l" +#line 286 "glcpp/glcpp-lex.l" { if (yyextra->space_tokens) { return SPACE; @@ -1372,7 +1308,7 @@ YY_RULE_SETUP case 41: /* rule 41 can match eol */ YY_RULE_SETUP -#line 295 "glcpp/glcpp-lex.l" +#line 292 "glcpp/glcpp-lex.l" { yyextra->lexing_if = 0; yylineno++; @@ -1382,7 +1318,7 @@ YY_RULE_SETUP YY_BREAK /* Handle missing newline at EOF. */ case YY_STATE_EOF(INITIAL): -#line 303 "glcpp/glcpp-lex.l" +#line 300 "glcpp/glcpp-lex.l" { BEGIN DONE; /* Don't keep matching this rule forever. */ yyextra->lexing_if = 0; @@ -1395,7 +1331,7 @@ case YY_STATE_EOF(INITIAL): warnings. */ case 42: YY_RULE_SETUP -#line 313 "glcpp/glcpp-lex.l" +#line 310 "glcpp/glcpp-lex.l" { unput('.'); yy_top_state(yyextra); @@ -1403,15 +1339,16 @@ YY_RULE_SETUP YY_BREAK case 43: YY_RULE_SETUP -#line 318 "glcpp/glcpp-lex.l" +#line 315 "glcpp/glcpp-lex.l" ECHO; YY_BREAK -#line 1410 "glcpp/glcpp-lex.c" - case YY_STATE_EOF(DONE): - case YY_STATE_EOF(COMMENT): - case YY_STATE_EOF(UNREACHABLE): - case YY_STATE_EOF(SKIP): - yyterminate(); +#line 1346 "glcpp/glcpp-lex.c" +case YY_STATE_EOF(DONE): +case YY_STATE_EOF(COMMENT): +case YY_STATE_EOF(UNREACHABLE): +case YY_STATE_EOF(SKIP): +case YY_STATE_EOF(DEFINE): + yyterminate(); case YY_END_OF_BUFFER: { @@ -1476,7 +1413,8 @@ ECHO; else { - yy_cp = yyg->yy_c_buf_p; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; goto yy_find_action; } } @@ -1596,14 +1534,43 @@ static int yy_get_next_buffer (yyscan_t yyscanner) 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. */ - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + yy_size_t new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + glcpp_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; } @@ -1612,7 +1579,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, (size_t) num_to_read ); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -1664,20 +1631,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yy_current_state = yyg->yy_start; yy_current_state += YY_AT_BOL(); - yyg->yy_state_ptr = yyg->yy_state_buf; - *yyg->yy_state_ptr++ = yy_current_state; - for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } 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 >= 154 ) + if ( yy_current_state >= 150 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yyg->yy_state_ptr++ = yy_current_state; } return yy_current_state; @@ -1692,19 +1660,24 @@ static int yy_get_next_buffer (yyscan_t yyscanner) { register int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + register char *yy_cp = yyg->yy_c_buf_p; register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } 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 >= 154 ) + if ( yy_current_state >= 150 ) 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 == 153); - if ( ! yy_is_jam ) - *yyg->yy_state_ptr++ = yy_current_state; + yy_is_jam = (yy_current_state == 149); + (void)yyg; return yy_is_jam ? 0 : yy_current_state; } @@ -1721,7 +1694,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yyg->yy_n_chars + 2; + register yy_size_t number_to_move = yyg->yy_n_chars + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = @@ -1771,7 +1744,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -2053,7 +2026,7 @@ void glcpp_pop_buffer_state (yyscan_t yyscanner) */ static void glcpp_ensure_buffer_stack (yyscan_t yyscanner) { - int num_to_alloc; + yy_size_t num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { @@ -2146,12 +2119,12 @@ YY_BUFFER_STATE glcpp__scan_string (yyconst char * yystr , yyscan_t yyscanner) /** Setup the input buffer state to scan the given bytes. The next call to glcpp_lex() 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. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; @@ -2306,7 +2279,7 @@ FILE *glcpp_get_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -int glcpp_get_leng (yyscan_t yyscanner) +yy_size_t glcpp_get_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -2342,7 +2315,7 @@ void glcpp_set_lineno (int line_number , yyscan_t yyscanner) /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "glcpp_set_lineno called with no buffer" , yyscanner); + YY_FATAL_ERROR( "glcpp_set_lineno called with no buffer" ); yylineno = line_number; } @@ -2357,7 +2330,7 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner) /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "glcpp_set_column called with no buffer" , yyscanner); + YY_FATAL_ERROR( "glcpp_set_column called with no buffer" ); yycolumn = column_no; } @@ -2500,11 +2473,6 @@ static int yy_init_globals (yyscan_t yyscanner) yyg->yy_start_stack_depth = 0; yyg->yy_start_stack = NULL; - yyg->yy_state_buf = 0; - yyg->yy_state_ptr = 0; - yyg->yy_full_match = 0; - yyg->yy_lp = 0; - /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; @@ -2540,9 +2508,6 @@ int glcpp_lex_destroy (yyscan_t yyscanner) glcpp_free(yyg->yy_start_stack ,yyscanner ); yyg->yy_start_stack = NULL; - glcpp_free ( yyg->yy_state_buf , yyscanner); - yyg->yy_state_buf = NULL; - /* Reset the globals. This is important in a non-reentrant scanner so the next time * glcpp_lex() is called, initialization will occur. */ yy_init_globals( yyscanner); @@ -2601,7 +2566,7 @@ void glcpp_free (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 318 "glcpp/glcpp-lex.l" +#line 315 "glcpp/glcpp-lex.l" |