Changeset c4f68dc for src/Parser
- Timestamp:
- Jul 25, 2018, 6:13:42 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- 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)
- Location:
- src/Parser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/TypedefTable.cc
rbd21af5 rc4f68dc 10 10 // Created On : Sat May 16 15:20:13 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 13 18:35:54201813 // Update Count : 25 712 // Last Modified On : Wed Jul 25 15:32:35 2018 13 // Update Count : 258 14 14 // 15 15 … … 49 49 bool TypedefTable::exists( const string & identifier ) { 50 50 return kindTable.find( identifier ) != kindTable.end(); 51 } // TypedefTable::exists 52 53 bool TypedefTable::existsCurr( const string & identifier ) { 54 return kindTable.findAt( kindTable.currentScope() - 1, identifier ) != kindTable.end(); 51 55 } // TypedefTable::exists 52 56 -
src/Parser/TypedefTable.h
rbd21af5 rc4f68dc 10 10 // Created On : Sat May 16 15:24:36 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jul 10 18:32:23201813 // Update Count : 11 212 // Last Modified On : Wed Jul 25 15:33:55 2018 13 // Update Count : 114 14 14 // 15 15 … … 31 31 32 32 bool exists( const std::string & identifier ); 33 bool existsCurr( const std::string & identifier ); 33 34 int isKind( const std::string & identifier ) const; 34 35 void makeTypedef( const std::string & name, int kind = TYPEDEFname ); -
src/Parser/parser.yy
rbd21af5 rc4f68dc 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 20 11:46:46201813 // Update Count : 38 3712 // Last Modified On : Wed Jul 25 15:54:35 2018 13 // Update Count : 3841 14 14 // 15 15 … … 2804 2804 typedef 2805 2805 // 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 } 2807 2813 | '(' paren_type ')' 2808 2814 { $$ = $2; } … … 2815 2821 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2816 2822 | '(' type_ptr ')' attribute_list_opt 2817 { $$ = $2->addQualifiers( $4 ); } 2823 { $$ = $2->addQualifiers( $4 ); } // redundant parenthesis 2818 2824 ; 2819 2825
Note: See TracChangeset
for help on using the changeset viewer.