Changeset 4ef08f7 for src/AST


Ignore:
Timestamp:
Aug 31, 2020, 1:54:40 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
eb67b47
Parents:
207c7330
Message:

Implemented KeywordCast? in CandidateFinder? of new AST.

Location:
src/AST
Files:
2 edited

Legend:

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

    r207c7330 r4ef08f7  
    705705                        new KeywordCastExpr(
    706706                                get<Expression>().accept1(node->arg),
    707                                 castTarget
     707                                castTarget,
     708                                {node->concrete_target.field, node->concrete_target.getter}
    708709                        )
    709710                );
     
    20872088                                old->location,
    20882089                                GET_ACCEPT_1(arg, Expr),
    2089                                 castTarget
     2090                                castTarget,
     2091                                {old->concrete_target.field, old->concrete_target.getter}
    20902092                        )
    20912093                );
  • TabularUnified src/AST/Expr.hpp

    r207c7330 r4ef08f7  
    312312public:
    313313        ptr<Expr> arg;
     314        struct Concrete {
     315                std::string field;
     316                std::string getter;
     317
     318                Concrete() = default;
     319                Concrete(const Concrete &) = default;
     320        };
    314321        ast::AggregateDecl::Aggregate target;
     322        Concrete concrete_target;
     323
    315324
    316325        KeywordCastExpr( const CodeLocation & loc, const Expr * a, ast::AggregateDecl::Aggregate t )
    317326        : Expr( loc ), arg( a ), target( t ) {}
     327
     328        KeywordCastExpr( const CodeLocation & loc, const Expr * a, ast::AggregateDecl::Aggregate t, const Concrete & ct )
     329        : Expr( loc ), arg( a ), target( t ), concrete_target( ct ) {}
    318330
    319331        /// Get a name for the target type
Note: See TracChangeset for help on using the changeset viewer.