Don't track new type names during pass-1 parsing
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 19 Mar 2010 18:12:33 +0000 (11:12 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 19 Mar 2010 18:12:33 +0000 (11:12 -0700)
This implementation was wrong anyway because it did not respect
scoping rules.  This will need to be revisited soon.  The most likely
result is that the grammar is going to need some significant re-work
to be able to use a IDENTIFIER in all the places where a TYPE_NAME is
currently used.

glsl_lexer.lpp
glsl_parser.ypp

index 9c7e3064e4af97b70162e600e953bc0f8da8c459..8f3f1211d5dd59d4456d4de2e13602d341e73265 100644 (file)
@@ -24,7 +24,6 @@
 #include "ast.h"
 #include "glsl_parser_extras.h"
 #include "glsl_parser.h"
-#include "symbol_table.h"
 
 #define YY_USER_ACTION                                         \
    do {                                                                \
@@ -245,13 +244,7 @@ precision  return PRECISION;
 
 [_a-zA-Z][_a-zA-Z0-9]* {
                            yylval->identifier = strdup(yytext);
-
-                           if (_mesa_symbol_table_find_symbol(yyextra->symbols,
-                                                              0,
-                                                              yylval->identifier))
-                              return TYPE_NAME;
-                           else
-                              return IDENTIFIER;
+                           return IDENTIFIER;
                        }
 
 .                      { return yytext[0]; }
index 2bc5cb06e6ce9b266fb1eb3e50881040db6dfed1..7af93dd9447cb771c625b1d8322b2599b5c18113 100644 (file)
@@ -28,7 +28,6 @@
     
 #include "ast.h"
 #include "glsl_parser_extras.h"
-#include "symbol_table.h"
 #include "glsl_types.h"
 
 #define YYLEX_PARAM state->scanner
@@ -934,8 +933,6 @@ struct_specifier:
        STRUCT IDENTIFIER '{' struct_declaration_list '}'
        {
           $$ = new ast_struct_specifier($2, $4);
-
-          _mesa_symbol_table_add_symbol(state->symbols, 0, $2, $$);
        }
        | STRUCT '{' struct_declaration_list '}'
        {