- Timestamp:
- Jul 10, 2018, 3:53:38 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:
- 777ed2b
- Parents:
- d804830
- git-author:
- Rob Schluntz <rschlunt@…> (07/10/18 15:11:53)
- git-committer:
- Rob Schluntz <rschlunt@…> (07/10/18 15:53:38)
- Location:
- src/Parser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/TypeData.cc
rd804830 r7de22b28 423 423 } // switch 424 424 } // TypeData::print 425 426 const std::string * TypeData::leafName() const { 427 switch ( kind ) { 428 case Unknown: 429 case Pointer: 430 case Reference: 431 case EnumConstant: 432 case GlobalScope: 433 case Array: 434 case Basic: 435 case Function: 436 case AggregateInst: 437 case Tuple: 438 case Typeof: 439 case Builtin: 440 assertf(false, "Tried to get leaf name from kind without a name: %d", kind); 441 break; 442 case Aggregate: 443 return aggregate.name; 444 case Enum: 445 return enumeration.name; 446 case Symbolic: 447 case SymbolicInst: 448 return symbolic.name; 449 case Qualified: 450 return qualified.child->leafName(); 451 } // switch 452 assert(false); 453 } 425 454 426 455 -
src/Parser/TypeData.h
rd804830 r7de22b28 109 109 void print( std::ostream &, int indent = 0 ) const; 110 110 TypeData * clone() const; 111 112 const std::string * leafName() const; 111 113 }; 112 114 -
src/Parser/parser.yy
rd804830 r7de22b28 1867 1867 | aggregate_key attribute_list_opt type_name fred 1868 1868 { 1869 typedefTable.makeTypedef( *$3->type->symbolic.name, forall ? TYPEGENname : TYPEDEFname ); // create typedef 1869 // for type_name can be a qualified type name S.T, in which case only the last name in the chain needs a typedef (other names in the chain should already have one) 1870 typedefTable.makeTypedef( *$3->type->leafName(), forall ? TYPEGENname : TYPEDEFname ); // create typedef 1870 1871 forall = false; // reset 1871 1872 }
Note: See TracChangeset
for help on using the changeset viewer.