Ignore:
Timestamp:
Apr 19, 2018, 5:54:41 PM (7 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, with_gc
Children:
8633f060
Parents:
e16294d (diff), da9d79b (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

    re16294d rb03eed6  
    188188  public:
    189189        Expression * arg;
    190 
    191         CastExpr( Expression * arg );
    192         CastExpr( Expression * arg, Type * toType );
     190        bool isGenerated = true; // whether this cast appeared in the source program
     191
     192        CastExpr( Expression * arg, bool isGenerated = true );
     193        CastExpr( Expression * arg, Type * toType, bool isGenerated = true );
     194        CastExpr( Expression * arg, void * ) = delete; // prevent accidentally passing pointers for isGenerated in the first constructor
    193195        CastExpr( const CastExpr & other );
    194196        virtual ~CastExpr();
     
    198200
    199201        virtual CastExpr * clone() const { return new CastExpr( * this ); }
     202        virtual void accept( Visitor & v ) { v.visit( this ); }
     203        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     204        virtual void print( std::ostream & os, Indenter indent = {} ) const;
     205};
     206
     207/// KeywordCastExpr represents a cast to 'keyword types', e.g. (thread &)t
     208class KeywordCastExpr : public Expression {
     209public:
     210        Expression * arg;
     211        enum Target {
     212                Coroutine, Thread, Monitor, NUMBER_OF_TARGETS
     213        } target;
     214
     215        KeywordCastExpr( Expression * arg, Target target );
     216        KeywordCastExpr( const KeywordCastExpr & other );
     217        virtual ~KeywordCastExpr();
     218
     219        const std::string & targetString() const;
     220
     221        virtual KeywordCastExpr * clone() const { return new KeywordCastExpr( * this ); }
    200222        virtual void accept( Visitor & v ) { v.visit( this ); }
    201223        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
Note: See TracChangeset for help on using the changeset viewer.