Changeset c5d7701
- Timestamp:
- Jun 14, 2018, 5:34:39 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:
- 704d11e
- Parents:
- 29f9e20
- Location:
- src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.h
r29f9e20 rc5d7701 133 133 virtual void visit( ArrayType * arrayType ) override final; 134 134 virtual void visit( ReferenceType * referenceType ) override final; 135 virtual void visit( QualifiedType * qualType ) override final; 135 136 virtual void visit( FunctionType * functionType ) override final; 136 137 virtual void visit( StructInstType * aggregateUseType ) override final; … … 233 234 virtual Type * mutate( ArrayType * arrayType ) override final; 234 235 virtual Type * mutate( ReferenceType * referenceType ) override final; 236 virtual Type * mutate( QualifiedType * qualType ) override final; 235 237 virtual Type * mutate( FunctionType * functionType ) override final; 236 238 virtual Type * mutate( StructInstType * aggregateUseType ) override final; -
src/Common/PassVisitor.impl.h
r29f9e20 rc5d7701 2262 2262 2263 2263 //-------------------------------------------------------------------------- 2264 // QualifiedType 2265 template< typename pass_type > 2266 void PassVisitor< pass_type >::visit( QualifiedType * node ) { 2267 VISIT_START( node ); 2268 2269 maybeAccept_impl( node->forall, *this ); 2270 maybeAccept_impl( node->types, *this ); 2271 2272 VISIT_END( node ); 2273 } 2274 2275 template< typename pass_type > 2276 Type * PassVisitor< pass_type >::mutate( QualifiedType * node ) { 2277 MUTATE_START( node ); 2278 2279 maybeMutate_impl( node->forall, *this ); 2280 maybeMutate_impl( node->types, *this ); 2281 2282 MUTATE_END( Type, node ); 2283 } 2284 2285 //-------------------------------------------------------------------------- 2264 2286 // FunctionType 2265 2287 template< typename pass_type > -
src/Parser/DeclarationNode.cc
r29f9e20 rc5d7701 253 253 return newnode; 254 254 } // DeclarationNode::newFromTypedef 255 256 DeclarationNode * DeclarationNode::newQualifiedType( DeclarationNode * parent, DeclarationNode * child) { 257 return child; 258 // return parent->add_last( child ); 259 } 255 260 256 261 DeclarationNode * DeclarationNode::newAggregate( Aggregate kind, const string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ) { -
src/Parser/ParseNode.h
r29f9e20 rc5d7701 231 231 static DeclarationNode * newForall( DeclarationNode * ); 232 232 static DeclarationNode * newFromTypedef( const std::string * ); 233 static DeclarationNode * newQualifiedType( DeclarationNode *, DeclarationNode * ); 233 234 static DeclarationNode * newFunction( const std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ); 234 235 static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ); -
src/Parser/parser.yy
r29f9e20 rc5d7701 1794 1794 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 1795 1795 | type_name '.' TYPEDEFname 1796 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }1796 { $$ = DeclarationNode::newQualifiedType( $1, DeclarationNode::newFromTypedef( $3 ) ); } 1797 1797 | typegen_name 1798 1798 | '.' typegen_name 1799 1799 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } 1800 1800 | type_name '.' typegen_name 1801 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }1801 { $$ = DeclarationNode::newQualifiedType( $1, $3 ); } 1802 1802 ; 1803 1803 -
src/SynTree/Mutator.h
r29f9e20 rc5d7701 101 101 virtual Type * mutate( ArrayType * arrayType ) = 0; 102 102 virtual Type * mutate( ReferenceType * refType ) = 0; 103 virtual Type * mutate( QualifiedType * qualType ) = 0; 103 104 virtual Type * mutate( FunctionType * functionType ) = 0; 104 105 virtual Type * mutate( StructInstType * aggregateUseType ) = 0; -
src/SynTree/SynTree.h
r29f9e20 rc5d7701 110 110 class ArrayType; 111 111 class ReferenceType; 112 class QualifiedType; 112 113 class FunctionType; 113 114 class ReferenceToType; -
src/SynTree/Type.cc
r29f9e20 rc5d7701 105 105 } 106 106 107 108 QualifiedType::QualifiedType( const Type::Qualifiers & tq, const std::list< Type * > & types ) : Type( tq, {} ), types( types ) { 109 } 110 111 QualifiedType::QualifiedType( const QualifiedType & other ) : Type( other ) { 112 cloneAll( other.types, types ); 113 } 114 115 QualifiedType::~QualifiedType() { 116 deleteAll( types ); 117 } 118 119 void QualifiedType::print( std::ostream & os, Indenter indent ) const { 120 os << "Qualified Type: "; 121 printAll( types, os, indent+1 ); 122 Type::print( os, indent+1 ); 123 } 124 125 107 126 // Empty Variable declarations: 108 127 const Type::FuncSpecifiers noFuncSpecifiers; -
src/SynTree/Type.h
r29f9e20 rc5d7701 315 315 }; 316 316 317 class QualifiedType : public Type { 318 public: 319 std::list<Type *> types; 320 321 QualifiedType( const Type::Qualifiers & tq, const std::list< Type * > & types ); 322 QualifiedType( const QualifiedType & tq ); 323 virtual ~QualifiedType(); 324 325 virtual QualifiedType *clone() const override { return new QualifiedType( *this ); } 326 virtual void accept( Visitor & v ) override { v.visit( this ); } 327 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 328 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 329 }; 330 317 331 class ReferenceType : public Type { 318 332 public: -
src/SynTree/Visitor.h
r29f9e20 rc5d7701 103 103 virtual void visit( ArrayType * arrayType ) = 0; 104 104 virtual void visit( ReferenceType * refType ) = 0; 105 virtual void visit( QualifiedType * qualType ) = 0; 105 106 virtual void visit( FunctionType * functionType ) = 0; 106 107 virtual void visit( StructInstType * aggregateUseType ) = 0;
Note: See TracChangeset
for help on using the changeset viewer.