Ignore:
Timestamp:
Apr 25, 2018, 4:55:53 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
42107b4
Parents:
2efe4b8 (diff), 9d5fb67 (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 remote-tracking branch 'origin/master' into with_gc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    r2efe4b8 r1cdfa82  
    184184  public:
    185185        Expression * arg;
    186 
    187         CastExpr( Expression * arg );
    188         CastExpr( Expression * arg, Type * toType );
     186        bool isGenerated = true; // whether this cast appeared in the source program
     187
     188        CastExpr( Expression * arg, bool isGenerated = true );
     189        CastExpr( Expression * arg, Type * toType, bool isGenerated = true );
     190        CastExpr( Expression * arg, void * ) = delete; // prevent accidentally passing pointers for isGenerated in the first constructor
    189191        CastExpr( const CastExpr & other );
    190192
     
    193195
    194196        virtual CastExpr * clone() const { return new CastExpr( * this ); }
     197        virtual void accept( Visitor & v ) { v.visit( this ); }
     198        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     199        virtual void print( std::ostream & os, Indenter indent = {} ) const;
     200};
     201
     202/// KeywordCastExpr represents a cast to 'keyword types', e.g. (thread &)t
     203class KeywordCastExpr : public Expression {
     204public:
     205        Expression * arg;
     206        enum Target {
     207                Coroutine, Thread, Monitor, NUMBER_OF_TARGETS
     208        } target;
     209
     210        KeywordCastExpr( Expression * arg, Target target );
     211        KeywordCastExpr( const KeywordCastExpr & other );
     212        virtual ~KeywordCastExpr();
     213
     214        const std::string & targetString() const;
     215
     216        virtual KeywordCastExpr * clone() const { return new KeywordCastExpr( * this ); }
    195217        virtual void accept( Visitor & v ) { v.visit( this ); }
    196218        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
Note: See TracChangeset for help on using the changeset viewer.