Ignore:
Timestamp:
Sep 17, 2016, 8:27:51 AM (8 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:
8c49c0e
Parents:
12bc63a
Message:

expand TupleExpr? and TupleIndexExpr?, add UniqueExpr?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    r12bc63a r3c13c03  
    639639class TupleExpr : public Expression {
    640640  public:
    641         TupleExpr( Expression *_aname = nullptr );
     641        TupleExpr( const std::list< Expression * > & exprs = std::list< Expression * >(), Expression *_aname = nullptr );
    642642        TupleExpr( const TupleExpr &other );
    643643        virtual ~TupleExpr();
     
    733733};
    734734
     735class UniqueExpr : public Expression {
     736public:
     737        UniqueExpr( Expression * expr );
     738        UniqueExpr( const UniqueExpr & other );
     739        ~UniqueExpr();
     740
     741        Expression * get_expr() const { return *expr; }
     742        UniqueExpr * set_expr( Expression * newValue ) { *expr = newValue; return this; }
     743
     744        virtual UniqueExpr *clone() const { return new UniqueExpr( *this ); }
     745        virtual void accept( Visitor &v ) { v.visit( this ); }
     746        virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     747        virtual void print( std::ostream &os, int indent = 0 ) const;
     748private:
     749        std::shared_ptr< Expression * > expr;
     750};
     751
    735752std::ostream & operator<<( std::ostream & out, const Expression * expr );
    736753
Note: See TracChangeset for help on using the changeset viewer.