Changeset 3945abe for src


Ignore:
Timestamp:
Jul 14, 2021, 4:07:43 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
ccb6fd8
Parents:
b238618
Message:

New-AST boilerplate for vtable

Location:
src/AST
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Fwd.hpp

    rb238618 r3945abe  
    117117class TupleType;
    118118class TypeofType;
     119class VTableType;
    119120class VarArgsType;
    120121class ZeroType;
  • src/AST/Pass.hpp

    rb238618 r3945abe  
    213213        const ast::Type *             visit( const ast::TupleType            * ) override final;
    214214        const ast::Type *             visit( const ast::TypeofType           * ) override final;
     215        const ast::Type *             visit( const ast::VTableType           * ) override final;
    215216        const ast::Type *             visit( const ast::VarArgsType          * ) override final;
    216217        const ast::Type *             visit( const ast::ZeroType             * ) override final;
  • src/AST/Pass.impl.hpp

    rb238618 r3945abe  
    18731873
    18741874//--------------------------------------------------------------------------
     1875// VTableType
     1876template< typename core_t >
     1877const ast::Type * ast::Pass< core_t >::visit( const ast::VTableType * node ) {
     1878        VISIT_START( node );
     1879
     1880        VISIT(
     1881                maybe_accept( node, &VTableType::base );
     1882        )
     1883
     1884        VISIT_END( Type, node );
     1885}
     1886
     1887//--------------------------------------------------------------------------
    18751888// VarArgsType
    18761889template< typename core_t >
  • src/AST/Print.cpp

    rb238618 r3945abe  
    14161416        }
    14171417
     1418        virtual const ast::Type * visit( const ast::VTableType * node ) override final {
     1419                preprint( node );
     1420                os << "vtable for ";
     1421                safe_print( node->base );
     1422
     1423                return node;
     1424        }
     1425
    14181426        virtual const ast::Type * visit( const ast::VarArgsType * node ) override final {
    14191427                preprint( node );
  • src/AST/Visitor.hpp

    rb238618 r3945abe  
    105105    virtual const ast::Type *             visit( const ast::TupleType            * ) = 0;
    106106    virtual const ast::Type *             visit( const ast::TypeofType           * ) = 0;
     107    virtual const ast::Type *             visit( const ast::VTableType           * ) = 0;
    107108    virtual const ast::Type *             visit( const ast::VarArgsType          * ) = 0;
    108109    virtual const ast::Type *             visit( const ast::ZeroType             * ) = 0;
Note: See TracChangeset for help on using the changeset viewer.