Changeset 5408b59 for src/AST


Ignore:
Timestamp:
Oct 18, 2022, 9:12:19 PM (3 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, master
Children:
c2b3243
Parents:
1e30df7
Message:

Remove var in QualifiedNameExpr?

Location:
src/AST
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/AST/Convert.cpp

    r1e30df7 r5408b59  
    310310                        node->name,
    311311                        get<Attribute>().acceptL( node->attributes ),
    312                         false, // Temporary
     312                        node->isTyped,
    313313                        LinkageSpec::Spec( node->linkage.val ),
    314314                        get<Type>().accept1(node->base)
    315315                );
    316                 return aggregatePostamble( decl, node ); // Node info, including members, processed in aggregatePostamble
     316                return aggregatePostamble( decl, node );
    317317        }
    318318
     
    737737                                node->name
    738738                );
    739                 temp->var = get<DeclarationWithType>().accept1(node->var);
    740739                auto expr = visitBaseExpr( node,
    741740                        temp
     
    22822281        }
    22832282
    2284         /// xxx - type_decl should be DeclWithType in the final design
    2285         /// type_decl is set to EnumDecl as a temporary fix
    22862283        virtual void visit( const QualifiedNameExpr * old ) override final {
    22872284                this->node = visitBaseExpr( old,
     
    22892286                                old->location,
    22902287                                GET_ACCEPT_1(type_decl, Decl),
    2291                                 GET_ACCEPT_1(var, DeclWithType),
    22922288                                old->name
    22932289                        )
  • TabularUnified src/AST/Decl.hpp

    r1e30df7 r5408b59  
    315315class EnumDecl final : public AggregateDecl {
    316316public:
    317         bool isTyped;
    318         ptr<Type> base;
     317        bool isTyped; // isTyped indicated if the enum has a declaration like:
     318        // enum (type_optional) Name {...}
     319        ptr<Type> base; // if isTyped == true && base.get() == nullptr, it is a "void" type enum
    319320
    320321        EnumDecl( const CodeLocation& loc, const std::string& name, bool isTyped = false,
  • TabularUnified src/AST/Expr.hpp

    r1e30df7 r5408b59  
    257257public:
    258258        ptr<Decl> type_decl;
    259         ptr<DeclWithType> var;
    260259        std::string name;
    261260
    262         QualifiedNameExpr( const CodeLocation & loc, const Decl * d, const DeclWithType * r, const std::string & n )
    263         : Expr( loc ), type_decl( d ), var(r), name( n ) {}
     261        QualifiedNameExpr( const CodeLocation & loc, const Decl * d, const std::string & n )
     262        : Expr( loc ), type_decl( d ), name( n ) {}
    264263
    265264        const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
  • TabularUnified src/AST/Pass.impl.hpp

    r1e30df7 r5408b59  
    12051205        if ( __visit_children() ) {
    12061206                guard_symtab guard { *this };
    1207                 maybe_accept( node, &QualifiedNameExpr::var );
    12081207                maybe_accept( node, &QualifiedNameExpr::type_decl );
    12091208        }
Note: See TracChangeset for help on using the changeset viewer.