Mesa (glsl2): glcpp: Refresh autogenerated lexer and parser.

2010-08-16 Thread Kenneth Graunke
Module: Mesa
Branch: glsl2
Commit: 2e2614586225b3fff3c21f37817064a90dd320ad
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e2614586225b3fff3c21f37817064a90dd320ad

Author: Kenneth Graunke kenn...@whitecape.org
Date:   Mon Aug 16 13:43:10 2010 -0700

glcpp: Refresh autogenerated lexer and parser.

---

 src/glsl/glcpp/glcpp-lex.c   |  102 ++
 src/glsl/glcpp/glcpp-parse.c |2 +-
 2 files changed, 44 insertions(+), 60 deletions(-)

diff --git a/src/glsl/glcpp/glcpp-lex.c b/src/glsl/glcpp/glcpp-lex.c
index 6b6aa12..de37c11 100644
--- a/src/glsl/glcpp/glcpp-lex.c
+++ b/src/glsl/glcpp/glcpp-lex.c
@@ -54,6 +54,7 @@ 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,8 +85,6 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX (4294967295U)
 #endif
 
-#endif /* ! C99 */
-
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -159,15 +158,7 @@ typedef void* yyscan_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.
@@ -691,7 +682,7 @@ void glcpp_set_column (int  column_no , yyscan_t yyscanner);
} while(0);
 #define YY_USER_INIT yylineno = 1; yycolumn = 1;
 
-#line 695 glcpp/glcpp-lex.c
+#line 686 glcpp/glcpp-lex.c
 
 #define INITIAL 0
 #define DONE 1
@@ -838,12 +829,7 @@ static int input (yyscan_t yyscanner );
 
 /* 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. */
@@ -851,7 +837,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 do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#define ECHO fwrite( yytext, yyleng, 1, yyout )
 #endif
 
 /* Gets input and stuffs it into buf.  number of characters read, or YY_NULL,
@@ -862,7 +848,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE-yy_is_interactive ) \
{ \
int c = '*'; \
-   size_t n; \
+   int n; \
for ( n = 0; n  max_size  \
 (c = getc( yyin )) != EOF  c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -954,7 +940,7 @@ YY_DECL
 
 
/* Single-line comments */
-#line 958 glcpp/glcpp-lex.c
+#line 944 glcpp/glcpp-lex.c
 
 yylval = yylval_param;
 
@@ -1126,8 +1112,6 @@ YY_RULE_SETUP
 #line 91 glcpp/glcpp-lex.l
 {
yylval-str = talloc_strdup (yyextra, yytext);
-   yylineno++;
-   yycolumn = 0;
yyextra-space_tokens = 0;
return HASH_VERSION;
 }
@@ -1136,7 +1120,7 @@ YY_RULE_SETUP
 * Simply pass them through to the main compiler's lexer/parser. */
 case 9:
 YY_RULE_SETUP
-#line 101 glcpp/glcpp-lex.l
+#line 99 glcpp/glcpp-lex.l
 {
yylval-str = talloc_strdup (yyextra, yytext);
yylineno++;
@@ -1147,7 +1131,7 @@ YY_RULE_SETUP
 case 10:
 /* rule 10 can match eol */
 YY_RULE_SETUP
-#line 108 glcpp/glcpp-lex.l
+#line 106 glcpp/glcpp-lex.l
 {
yyextra-lexing_if = 1;
yyextra-space_tokens = 0;
@@ -1157,7 +1141,7 @@ YY_RULE_SETUP
 case 11:
 /* rule 11 can match eol */
 YY_RULE_SETUP
-#line 114 glcpp/glcpp-lex.l
+#line 112 glcpp/glcpp-lex.l
 {
yyextra-lexing_if = 1;
yyextra-space_tokens = 0;
@@ -1167,7 +1151,7 @@ YY_RULE_SETUP
 case 12:
 /* rule 12 can match eol */
 YY_RULE_SETUP
-#line 120 glcpp/glcpp-lex.l
+#line 118 glcpp/glcpp-lex.l
 {
yyextra-lexing_if = 1;
yyextra-space_tokens = 0;
@@ -1177,7 +1161,7 @@ YY_RULE_SETUP
 case 13:
 /* rule 13 can match eol */
 YY_RULE_SETUP
-#line 126 glcpp/glcpp-lex.l
+#line 124 glcpp/glcpp-lex.l
 {
yyextra-lexing_if = 1;
yyextra-space_tokens = 0;
@@ -1187,7 +1171,7 @@ YY_RULE_SETUP
 case 14:
 /* rule 14 can match eol */
 YY_RULE_SETUP
-#line 132 glcpp/glcpp-lex.l
+#line 130 glcpp/glcpp-lex.l
 {
yyextra-space_tokens = 0;
return HASH_ELSE;
@@ -1196,7 +1180,7 @@ YY_RULE_SETUP
 case 15:
 /* rule 15 can match eol */
 YY_RULE_SETUP
-#line 137 glcpp/glcpp-lex.l
+#line 135 glcpp/glcpp-lex.l
 {
yyextra-space_tokens = 0;
return HASH_ENDIF;
@@ -1216,7 +1200,7 @@ case 16:
 yyg-yy_c_buf_p = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP

Mesa (glsl2): glcpp: Refresh autogenerated lexer and parser.

2010-08-04 Thread Kenneth Graunke
Module: Mesa
Branch: glsl2
Commit: 0ef79a5f115659b3719a330d01a365e8ca8144c4
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0ef79a5f115659b3719a330d01a365e8ca8144c4

Author: Kenneth Graunke kenn...@whitecape.org
Date:   Tue Aug  3 20:25:13 2010 -0700

glcpp: Refresh autogenerated lexer and parser.

---

 src/glsl/glcpp/glcpp-lex.c   |   44 +++-
 src/glsl/glcpp/glcpp-parse.c |  252 ++
 src/glsl/glcpp/glcpp-parse.h |7 +-
 3 files changed, 148 insertions(+), 155 deletions(-)

diff --git a/src/glsl/glcpp/glcpp-lex.c b/src/glsl/glcpp/glcpp-lex.c
index 40db2c2..d976904 100644
--- a/src/glsl/glcpp/glcpp-lex.c
+++ b/src/glsl/glcpp/glcpp-lex.c
@@ -54,6 +54,7 @@ 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,8 +85,6 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX (4294967295U)
 #endif
 
-#endif /* ! C99 */
-
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -159,15 +158,7 @@ typedef void* yyscan_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.
@@ -691,7 +682,7 @@ void glcpp_set_column (int  column_no , yyscan_t yyscanner);
} while(0);
 #define YY_USER_INIT yylineno = 0; yycolumn = 0;
 
-#line 695 glcpp/glcpp-lex.c
+#line 686 glcpp/glcpp-lex.c
 
 #define INITIAL 0
 #define DONE 1
@@ -846,12 +837,7 @@ static int input (yyscan_t yyscanner );
 
 /* 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. */
@@ -859,7 +845,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 do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#define ECHO fwrite( yytext, yyleng, 1, yyout )
 #endif
 
 /* Gets input and stuffs it into buf.  number of characters read, or YY_NULL,
@@ -870,7 +856,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE-yy_is_interactive ) \
{ \
int c = '*'; \
-   size_t n; \
+   int n; \
for ( n = 0; n  max_size  \
 (c = getc( yyin )) != EOF  c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -962,7 +948,7 @@ YY_DECL
 
 
/* Single-line comments */
-#line 966 glcpp/glcpp-lex.c
+#line 952 glcpp/glcpp-lex.c
 
 yylval = yylval_param;
 
@@ -1133,7 +1119,7 @@ case 8:
 YY_RULE_SETUP
 #line 90 glcpp/glcpp-lex.l
 {
-   yylval-str = xtalloc_strdup (yyextra, yytext);
+   yylval-str = talloc_strdup (yyextra, yytext);
yylineno++;
yycolumn = 0;
yyextra-space_tokens = 0;
@@ -1146,7 +1132,7 @@ case 9:
 YY_RULE_SETUP
 #line 100 glcpp/glcpp-lex.l
 {
-   yylval-str = xtalloc_strdup (yyextra, yytext);
+   yylval-str = talloc_strdup (yyextra, yytext);
yylineno++;
yycolumn = 0;
return OTHER;
@@ -1283,7 +1269,7 @@ case 22:
 YY_RULE_SETUP
 #line 188 glcpp/glcpp-lex.l
 {
-   yylval-str = xtalloc_strdup (yyextra, yytext);
+   yylval-str = talloc_strdup (yyextra, yytext);
return INTEGER_STRING;
 }
YY_BREAK
@@ -1291,7 +1277,7 @@ case 23:
 YY_RULE_SETUP
 #line 193 glcpp/glcpp-lex.l
 {
-   yylval-str = xtalloc_strdup (yyextra, yytext);
+   yylval-str = talloc_strdup (yyextra, yytext);
return INTEGER_STRING;
 }
YY_BREAK
@@ -1299,7 +1285,7 @@ case 24:
 YY_RULE_SETUP
 #line 198 glcpp/glcpp-lex.l
 {
-   yylval-str = xtalloc_strdup (yyextra, yytext);
+   yylval-str = talloc_strdup (yyextra, yytext);
return INTEGER_STRING;
 }
YY_BREAK
@@ -1377,7 +1363,7 @@ case 35:
 YY_RULE_SETUP
 #line 243 glcpp/glcpp-lex.l
 {
-   yylval-str = xtalloc_strdup (yyextra, yytext);
+   yylval-str = talloc_strdup (yyextra, yytext);
return IDENTIFIER;
 }
YY_BREAK
@@ -1392,7 +1378,7 @@ case 37:
 YY_RULE_SETUP
 #line 252 glcpp/glcpp-lex.l
 {
-   yylval-str = xtalloc_strdup (yyextra, yytext);
+   yylval-str = talloc_strdup (yyextra, yytext);
return OTHER;
 }
YY_BREAK
@@ -1442,7 +1428,7 @@ YY_RULE_SETUP
 #line 286 glcpp/glcpp-lex.l
 ECHO;
YY_BREAK
-#line 1446 glcpp/glcpp-lex.c
+#line 1432 glcpp/glcpp-lex.c
case