Changeset 2c2242c
- Timestamp:
- Jan 24, 2015, 5:34:52 PM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 26a07a22
- Parents:
- fe3b61b
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/Parser/lex.l
rfe3b61b r2c2242c 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Sat Jan 17 09:15:03201513 * Update Count : 3 1812 * Last Modified On : Wed Jan 21 08:43:59 2015 13 * Update Count : 320 14 14 */ 15 15 … … 216 216 finally { KEYWORD_RETURN(FINALLY); } // CFA 217 217 float { KEYWORD_RETURN(FLOAT); } 218 __float128 { KEYWORD_RETURN(FLOAT); } // GCC 218 219 for { KEYWORD_RETURN(FOR); } 219 220 forall { KEYWORD_RETURN(FORALL); } // CFA … … 230 231 __inline__ { KEYWORD_RETURN(INLINE); } // GCC 231 232 int { KEYWORD_RETURN(INT); } 233 __int128 { KEYWORD_RETURN(INT); } // GCC 232 234 __label__ { KEYWORD_RETURN(LABEL); } // GCC 233 235 long { KEYWORD_RETURN(LONG); } -
translator/ResolvExpr/Resolver.cc
rfe3b61b r2c2242c 257 257 std::list<Declaration *>::iterator iter1( baseStruct->get_members().begin() ); 258 258 std::list<Initializer *>::iterator iter2( listInit->begin_initializers() ); 259 for ( ; iter1 != baseStruct->get_members().end() && iter2 != listInit->end_initializers() ; ++iter1, ++iter2 ) { 260 DeclarationWithType *dt = dynamic_cast<DeclarationWithType *>( *iter1 ); 261 initContext = dt->get_type(); 262 (*iter2)->accept( *this ); 263 } 259 for ( ; iter1 != baseStruct->get_members().end() && iter2 != listInit->end_initializers(); ++iter2 ) { 260 if ( (*iter2)->get_designators().empty() ) { 261 DeclarationWithType *dt = dynamic_cast<DeclarationWithType *>( *iter1 ); 262 initContext = dt->get_type(); 263 (*iter2)->accept( *this ); 264 ++iter1; 265 } else { 266 StructDecl *st = baseStruct; 267 iter1 = st->get_members().begin(); 268 std::list<Expression *>::iterator iter3( (*iter2)->get_designators().begin() ); 269 for ( ; iter3 != (*iter2)->get_designators().end(); ++iter3 ) { 270 NameExpr *key = dynamic_cast<NameExpr *>( *iter3 ); 271 assert( key ); 272 for ( ; iter1 != st->get_members().end(); ++iter1 ) { 273 if ( key->get_name() == (*iter1)->get_name() ) { 274 (*iter1)->print( cout ); 275 cout << key->get_name() << endl; 276 ObjectDecl *fred = dynamic_cast<ObjectDecl *>( *iter1 ); 277 assert( fred ); 278 StructInstType *mary = dynamic_cast<StructInstType*>( fred->get_type() ); 279 assert( mary ); 280 st = mary->get_baseStruct(); 281 iter1 = st->get_members().begin(); 282 break; 283 } // if 284 } // for 285 } // for 286 ObjectDecl *fred = dynamic_cast<ObjectDecl *>( *iter1 ); 287 assert( fred ); 288 initContext = fred->get_type(); 289 (*listInit->begin_initializers())->accept( *this ); 290 } // if 291 } // for 264 292 } else if ( UnionInstType *st = dynamic_cast<UnionInstType*>(initContext) ) { 265 293 DeclarationWithType *dt = dynamic_cast<DeclarationWithType *>( *st->get_baseUnion()->get_members().begin() );
Note: See TracChangeset
for help on using the changeset viewer.