Changeset c4f68dc


Ignore:
Timestamp:
Jul 25, 2018, 6:13:42 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
891790ef
Parents:
bd21af5
git-author:
Peter A. Buhr <pabuhr@…> (07/25/18 18:12:54)
git-committer:
Peter A. Buhr <pabuhr@…> (07/25/18 18:13:42)
Message:

potential changes for ID/TD/TG problem

Location:
src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypedefTable.cc

    rbd21af5 rc4f68dc  
    1010// Created On       : Sat May 16 15:20:13 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 13 18:35:54 2018
    13 // Update Count     : 257
     12// Last Modified On : Wed Jul 25 15:32:35 2018
     13// Update Count     : 258
    1414//
    1515
     
    4949bool TypedefTable::exists( const string & identifier ) {
    5050        return kindTable.find( identifier ) != kindTable.end();
     51} // TypedefTable::exists
     52
     53bool TypedefTable::existsCurr( const string & identifier ) {
     54        return kindTable.findAt( kindTable.currentScope() - 1, identifier ) != kindTable.end();
    5155} // TypedefTable::exists
    5256
  • src/Parser/TypedefTable.h

    rbd21af5 rc4f68dc  
    1010// Created On       : Sat May 16 15:24:36 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 10 18:32:23 2018
    13 // Update Count     : 112
     12// Last Modified On : Wed Jul 25 15:33:55 2018
     13// Update Count     : 114
    1414//
    1515
     
    3131
    3232        bool exists( const std::string & identifier );
     33        bool existsCurr( const std::string & identifier );
    3334        int isKind( const std::string & identifier ) const;
    3435        void makeTypedef( const std::string & name, int kind = TYPEDEFname );
  • src/Parser/parser.yy

    rbd21af5 rc4f68dc  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 20 11:46:46 2018
    13 // Update Count     : 3837
     12// Last Modified On : Wed Jul 25 15:54:35 2018
     13// Update Count     : 3841
    1414//
    1515
     
    28042804        typedef
    28052805                // hide type name in enclosing scope by variable name
    2806                 { typedefTable.addToEnclosingScope( *$1->name, IDENTIFIER, "ID" ); }
     2806                {
     2807                        // if ( ! typedefTable.existsCurr( *$1->name ) ) {
     2808                                typedefTable.addToEnclosingScope( *$1->name, IDENTIFIER, "ID" );
     2809                        // } else {
     2810                        //      SemanticError( yylloc, string("'") + *$1->name + "' redeclared as different kind of symbol." ); $$ = nullptr;
     2811                        // } // if
     2812                }
    28072813        | '(' paren_type ')'
    28082814                { $$ = $2; }
     
    28152821                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    28162822        | '(' type_ptr ')' attribute_list_opt
    2817                 { $$ = $2->addQualifiers( $4 ); }
     2823                { $$ = $2->addQualifiers( $4 ); }                               // redundant parenthesis
    28182824        ;
    28192825
Note: See TracChangeset for help on using the changeset viewer.