Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r0da3e2c re82aa9df  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Aug 16 17:10:35 2016
    13 // Update Count     : 1898
     12// Last Modified On : Mon Aug 15 15:18:19 2016
     13// Update Count     : 1891
    1414//
    1515
     
    4343#define YYDEBUG_LEXER_TEXT (yylval)                                             // lexer loads this up each time
    4444#define YYDEBUG 1                                                                               // get the pretty debugging code to compile
     45extern char *yytext;
    4546
    4647#undef __GNUC_MINOR__
     
    5556#include "LinkageSpec.h"
    5657
    57 extern DeclarationNode *parseTree;
    58 extern LinkageSpec::Type linkage;
    59 extern TypedefTable typedefTable;
    60 
     58DeclarationNode *theTree = 0;                                                   // the resulting parse tree
     59LinkageSpec::Type linkage = LinkageSpec::Cforall;
    6160std::stack< LinkageSpec::Type > linkageStack;
     61TypedefTable typedefTable;
    6262
    6363void appendStr( std::string &to, std::string *from ) {
     
    223223%type<decl> paren_identifier paren_type
    224224
    225 %type<decl> storage_class storage_class_list
     225%type<decl> storage_class storage_class_name storage_class_list
    226226
    227227%type<decl> sue_declaration_specifier sue_type_specifier
     
    13241324
    13251325storage_class:
     1326        storage_class_name
     1327        ;
     1328
     1329storage_class_name:
    13261330        EXTERN
    13271331                { $$ = DeclarationNode::newStorageClass( DeclarationNode::Extern ); }
     
    19711975        | external_definition_list
    19721976                {
    1973                         if ( parseTree ) {
    1974                                 parseTree->appendList( $1 );
     1977                        if ( theTree ) {
     1978                                theTree->appendList( $1 );
    19751979                        } else {
    1976                                 parseTree = $1;
     1980                                theTree = $1;
    19771981                        }
    19781982                }
     
    21442148any_word:                                                                                               // GCC
    21452149        identifier_or_type_name {}
    2146         | storage_class {}
     2150        | storage_class_name {}
    21472151        | basic_type_name {}
    21482152        | type_qualifier {}
     
    28442848// ----end of grammar----
    28452849
    2846 extern char *yytext;
    2847 
    28482850void yyerror( const char * ) {
    28492851        std::cout << "Error ";
Note: See TracChangeset for help on using the changeset viewer.