Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.hpp

    rbb87dd0 r490fb92e  
    250250};
    251251
    252 /// A reference to a named variable.
    253 class VariableExpr final : public Expr {
    254 public:
    255         readonly<DeclWithType> var;
    256 
    257         VariableExpr( const CodeLocation & loc );
    258         VariableExpr( const CodeLocation & loc, const DeclWithType * v );
    259 
    260         bool get_lvalue() const final;
    261 
    262         /// generates a function pointer for a given function
    263         static VariableExpr * functionPointer( const CodeLocation & loc, const FunctionDecl * decl );
    264 
    265         const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
    266 private:
    267         VariableExpr * clone() const override { return new VariableExpr{ *this }; }
    268         MUTATE_FRIEND
    269 };
    270 
    271252/// Address-of expression `&e`
    272253class AddressExpr final : public Expr {
     
    299280};
    300281
    301 /// Inidicates whether the cast is introduced by the CFA type system.
    302 /// GeneratedCast for casts that the resolver introduces to force a return type
    303 /// ExplicitCast for casts from user code
    304 /// ExplicitCast for casts from desugaring advanced CFA features into simpler CFA
    305 /// example
    306 ///   int * p;     // declaration
    307 ///   (float *) p; // use, with subject cast
    308 /// subject cast being GeneratedCast means we are considering an interpretation with a type mismatch
    309 /// subject cast being ExplicitCast means someone in charge wants it that way
     282/// Whether a cast existed in the program source or not
    310283enum GeneratedFlag { ExplicitCast, GeneratedCast };
    311284
     
    417390        friend class ::ConverterOldToNew;
    418391        friend class ::ConverterNewToOld;
     392};
     393
     394/// A reference to a named variable.
     395class VariableExpr final : public Expr {
     396public:
     397        readonly<DeclWithType> var;
     398
     399        VariableExpr( const CodeLocation & loc );
     400        VariableExpr( const CodeLocation & loc, const DeclWithType * v );
     401
     402        bool get_lvalue() const final;
     403
     404        /// generates a function pointer for a given function
     405        static VariableExpr * functionPointer( const CodeLocation & loc, const FunctionDecl * decl );
     406
     407        const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
     408private:
     409        VariableExpr * clone() const override { return new VariableExpr{ *this }; }
     410        MUTATE_FRIEND
    419411};
    420412
Note: See TracChangeset for help on using the changeset viewer.