Skip to content

Commit

Permalink
fix building flex/bison after upstream merge; rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
aras-p committed Oct 5, 2012
1 parent 3e22837 commit a7666b2
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 168 deletions.
2 changes: 1 addition & 1 deletion generateParsers.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/sh
flex --nounistd -osrc/glsl/glcpp/glcpp-lex.c src/glsl/glcpp/glcpp-lex.l
flex --nounistd -osrc/glsl/glsl_lexer.cpp src/glsl/glsl_lexer.ll
bison -v -o "src/glsl/glcpp/glcpp-parse.c" --defines=src/glsl/glcpp/glcpp-parse.h src/glsl/glcpp/glcpp-parse.y
bison -v -o "src/glsl/glcpp/glcpp-parse.c" -p "glcpp_parser_" --defines=src/glsl/glcpp/glcpp-parse.h src/glsl/glcpp/glcpp-parse.y
bison -v -o "src/glsl/glsl_parser.cpp" -p "_mesa_glsl_" --defines=src/glsl/glsl_parser.h src/glsl/glsl_parser.yy
48 changes: 24 additions & 24 deletions src/glsl/glcpp/glcpp-lex.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -344,7 +345,7 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*/
#define YY_DO_BEFORE_ACTION \
yyg->yytext_ptr = yy_bp; \
yyleng = (size_t) (yy_cp - yy_bp); \
yyleng = (yy_size_t) (yy_cp - yy_bp); \
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
Expand Down Expand Up @@ -645,7 +646,7 @@ 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 649 "src/glsl/glcpp/glcpp-lex.c"
#line 650 "src/glsl/glcpp/glcpp-lex.c"

#define INITIAL 0
#define DONE 1
Expand All @@ -668,8 +669,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;
Expand Down Expand Up @@ -737,7 +738,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 );

Expand Down Expand Up @@ -915,7 +916,7 @@ YY_DECL
}

/* Single-line comments */
#line 919 "src/glsl/glcpp/glcpp-lex.c"
#line 920 "src/glsl/glcpp/glcpp-lex.c"

yylval = yylval_param;

Expand Down Expand Up @@ -1372,7 +1373,7 @@ YY_RULE_SETUP
#line 305 "src/glsl/glcpp/glcpp-lex.l"
ECHO;
YY_BREAK
#line 1376 "src/glsl/glcpp/glcpp-lex.c"
#line 1377 "src/glsl/glcpp/glcpp-lex.c"
case YY_STATE_EOF(DONE):
case YY_STATE_EOF(COMMENT):
case YY_STATE_EOF(UNREACHABLE):
Expand Down Expand Up @@ -1562,7 +1563,7 @@ 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 )
Expand All @@ -1578,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;
}
Expand Down Expand Up @@ -1687,7 +1688,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 =
Expand Down Expand Up @@ -1737,7 +1738,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 ) )
Expand All @@ -1761,7 +1762,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
case EOB_ACT_END_OF_FILE:
{
if ( glcpp_wrap(yyscanner ) )
return EOF;
return 0;

if ( ! yyg->yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
Expand Down Expand Up @@ -2019,7 +2020,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) {
Expand Down Expand Up @@ -2117,12 +2118,11 @@ YY_BUFFER_STATE glcpp__scan_string (yyconst char * yystr , yyscan_t yyscanner)
* @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;
yy_size_t n;
int i;
yy_size_t n, i;

/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
Expand Down Expand Up @@ -2272,7 +2272,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;
Expand Down
Loading

0 comments on commit a7666b2

Please sign in to comment.