Changeset 4559b34 for src/AST


Ignore:
Timestamp:
Apr 3, 2022, 8:49:42 PM (4 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
92538ab
Parents:
3eb1653
Message:

Update the String Enum implementation. The declaration now can handles creating the enum decl. But the compilation fails when trying to create reference to the Enum. Need a way to resolve InstTypes

Location:
src/AST
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r3eb1653 r4559b34  
    14681468                return strict_dynamic_cast< ast::Decl * >( node );
    14691469        }
    1470 
     1470       
    14711471        ConverterOldToNew() = default;
    14721472        ConverterOldToNew(const ConverterOldToNew &) = delete;
     
    27712771                ast::EnumInstType * ty;
    27722772                if ( old->baseEnum ) {
    2773                         ty = new ast::EnumInstType{
     2773                        ty = new ast::EnumInstType{ // Probably here: missing the specification of the base
    27742774                                GET_ACCEPT_1( baseEnum, EnumDecl ),
    27752775                                cv( old ),
  • src/AST/Decl.hpp

    r3eb1653 r4559b34  
    317317        const char * typeString() const override { return aggrString( Enum ); }
    318318
     319        bool isTyped() {return base && base.get();}
     320
    319321private:
    320322        EnumDecl * clone() const override { return new EnumDecl{ *this }; }
  • src/AST/Print.cpp

    r3eb1653 r4559b34  
    210210                }
    211211
     212                auto ptrToEnum = dynamic_cast<const ast::EnumDecl *>(node);
     213                if ( ! short_mode && ptrToEnum && ptrToEnum->base ) {
     214                        os << endl << indent << ".. with (enum) base" << endl;
     215                        ++indent;
     216                        ptrToEnum->base->accept( *this );
     217                        --indent; 
     218                }
     219
    212220                os << endl;
    213221        }
Note: See TracChangeset for help on using the changeset viewer.