Changeset af5c204a for src/SynTree


Ignore:
Timestamp:
Jun 21, 2017, 11:47:32 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
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, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
06edda0
Parents:
4551a6e
Message:

remove UntypedValOfExpr? and hook in build for StmtExpr?

Location:
src/SynTree
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    r4551a6e raf5c204a  
    588588}
    589589
    590 UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {}
    591 
    592 UntypedValofExpr::~UntypedValofExpr() { delete body; }
    593 
    594 void UntypedValofExpr::print( std::ostream &os, int indent ) const {
    595         os << std::string( indent, ' ' ) << "Valof Expression: " << std::endl;
    596         if ( get_body() != 0 )
    597                 get_body()->print( os, indent + 2 );
    598 }
    599 
    600590RangeExpr::RangeExpr( Expression *low, Expression *high ) : low( low ), high( high ) {}
    601591RangeExpr::RangeExpr( const RangeExpr &other ) : Expression( other ), low( other.low->clone() ), high( other.high->clone() ) {}
  • src/SynTree/Expression.h

    r4551a6e raf5c204a  
    600600};
    601601
    602 /// ValofExpr represents a GCC 'lambda expression'
    603 class UntypedValofExpr : public Expression {
    604   public:
    605         UntypedValofExpr( Statement *_body, Expression *_aname = nullptr ) : Expression( _aname ), body ( _body ) {}
    606         UntypedValofExpr( const UntypedValofExpr & other );
    607         virtual ~UntypedValofExpr();
    608 
    609         Expression * get_value();
    610         Statement * get_body() const { return body; }
    611 
    612         virtual UntypedValofExpr * clone() const { return new UntypedValofExpr( * this ); }
    613         virtual void accept( Visitor & v ) { v.visit( this ); }
    614         virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    615         virtual void print( std::ostream & os, int indent = 0 ) const;
    616   private:
    617         Statement * body;
    618 };
    619 
    620602/// RangeExpr represents a range e.g. '3 ... 5' or '1~10'
    621603class RangeExpr : public Expression {
  • src/SynTree/Mutator.cc

    r4551a6e raf5c204a  
    380380}
    381381
    382 Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) {
    383         valofExpr->set_env( maybeMutate( valofExpr->get_env(), *this ) );
    384         valofExpr->set_result( maybeMutate( valofExpr->get_result(), *this ) );
    385         return valofExpr;
    386 }
    387 
    388382Expression *Mutator::mutate( RangeExpr *rangeExpr ) {
    389383        rangeExpr->set_env( maybeMutate( rangeExpr->get_env(), *this ) );
  • src/SynTree/Mutator.h

    r4551a6e raf5c204a  
    7878        virtual Expression* mutate( ConstructorExpr *ctorExpr );
    7979        virtual Expression* mutate( CompoundLiteralExpr *compLitExpr );
    80         virtual Expression* mutate( UntypedValofExpr *valofExpr );
    8180        virtual Expression* mutate( RangeExpr *rangeExpr );
    8281        virtual Expression* mutate( UntypedTupleExpr *tupleExpr );
  • src/SynTree/Visitor.cc

    r4551a6e raf5c204a  
    301301}
    302302
    303 void Visitor::visit( UntypedValofExpr *valofExpr ) {
    304         maybeAccept( valofExpr->get_result(), *this );
    305         maybeAccept( valofExpr->get_body(), *this );
    306 }
    307 
    308303void Visitor::visit( RangeExpr *rangeExpr ) {
    309304        maybeAccept( rangeExpr->get_low(), *this );
  • src/SynTree/Visitor.h

    r4551a6e raf5c204a  
    8181        virtual void visit( ConstructorExpr * ctorExpr );
    8282        virtual void visit( CompoundLiteralExpr *compLitExpr );
    83         virtual void visit( UntypedValofExpr *valofExpr );
    8483        virtual void visit( RangeExpr *rangeExpr );
    8584        virtual void visit( UntypedTupleExpr *tupleExpr );
     
    163162                        } // if
    164163                } catch( SemanticError &e ) {
    165                         e.set_location( (*i)->location );                       
     164                        e.set_location( (*i)->location );
    166165                        errors.append( e );
    167166                } // try
Note: See TracChangeset for help on using the changeset viewer.