Ignore:
Timestamp:
Jul 19, 2017, 11:49:33 AM (8 years ago)
Author:
Aaron Moss <a3moss@…>
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:
9cc0472
Parents:
fea3faa (diff), a57cb58 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    rfea3faa rb826e6b  
    744744};
    745745
     746struct InitAlternative {
     747public:
     748        Type * type = nullptr;
     749        Designation * designation = nullptr;
     750        InitAlternative( Type * type, Designation * designation );
     751        InitAlternative( const InitAlternative & other );
     752        InitAlternative & operator=( const Initializer & other ) = delete; // at the moment this isn't used, and I don't want to implement it
     753        ~InitAlternative();
     754};
     755
     756class UntypedInitExpr : public Expression {
     757public:
     758        UntypedInitExpr( Expression * expr, const std::list<InitAlternative> & initAlts );
     759        UntypedInitExpr( const UntypedInitExpr & other );
     760        ~UntypedInitExpr();
     761
     762        Expression * get_expr() const { return expr; }
     763        UntypedInitExpr * set_expr( Expression * newValue ) { expr = newValue; return this; }
     764
     765        std::list<InitAlternative> & get_initAlts() { return initAlts; }
     766
     767        virtual UntypedInitExpr * clone() const { return new UntypedInitExpr( * this ); }
     768        virtual void accept( Visitor & v ) { v.visit( this ); }
     769        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     770        virtual void print( std::ostream & os, int indent = 0 ) const;
     771private:
     772        Expression * expr;
     773        std::list<InitAlternative> initAlts;
     774};
     775
     776class InitExpr : public Expression {
     777public:
     778        InitExpr( Expression * expr, Designation * designation );
     779        InitExpr( const InitExpr & other );
     780        ~InitExpr();
     781
     782        Expression * get_expr() const { return expr; }
     783        InitExpr * set_expr( Expression * newValue ) { expr = newValue; return this; }
     784
     785        Designation * get_designation() const { return designation; }
     786        InitExpr * set_designation( Designation * newValue ) { designation = newValue; return this; }
     787
     788        virtual InitExpr * clone() const { return new InitExpr( * this ); }
     789        virtual void accept( Visitor & v ) { v.visit( this ); }
     790        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     791        virtual void print( std::ostream & os, int indent = 0 ) const;
     792private:
     793        Expression * expr;
     794        Designation * designation;
     795};
     796
     797
    746798std::ostream & operator<<( std::ostream & out, const Expression * expr );
    747799
Note: See TracChangeset for help on using the changeset viewer.