Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    rdf626eb rd29fa5f  
    3131
    3232
     33/// Expression is the root type for all expressions
     34class Expression : public BaseSyntaxNode{
     35  public:
     36        Type * result;
     37        TypeSubstitution * env;
     38        bool extension = false;
     39
     40        Expression();
     41        Expression( const Expression & other );
     42        virtual ~Expression();
     43
     44        Type *& get_result() { return result; }
     45        const Type * get_result() const { return result; }
     46        void set_result( Type * newValue ) { result = newValue; }
     47
     48        TypeSubstitution * get_env() const { return env; }
     49        void set_env( TypeSubstitution * newValue ) { env = newValue; }
     50        bool get_extension() const { return extension; }
     51        Expression * set_extension( bool exten ) { extension = exten; return this; }
     52
     53        virtual Expression * clone() const override = 0;
     54        virtual void accept( Visitor & v ) override = 0;
     55        virtual Expression * acceptMutator( Mutator & m ) override = 0;
     56        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     57};
     58
    3359struct ParamEntry;
    3460
     
    4773        Type * actualType;
    4874        Type * formalType;
    49         Expression * expr;
     75        Expression* expr;
    5076        std::unique_ptr< InferredParams > inferParams;
    51 };
    52 
    53 /// Expression is the root type for all expressions
    54 class Expression : public BaseSyntaxNode {
    55   public:
    56         Type * result;
    57         TypeSubstitution * env;
    58         bool extension = false;
    59         InferredParams inferParams;
    60 
    61         Expression();
    62         Expression( const Expression & other );
    63         virtual ~Expression();
    64 
    65         Type *& get_result() { return result; }
    66         const Type * get_result() const { return result; }
    67         void set_result( Type * newValue ) { result = newValue; }
    68 
    69         TypeSubstitution * get_env() const { return env; }
    70         void set_env( TypeSubstitution * newValue ) { env = newValue; }
    71         bool get_extension() const { return extension; }
    72         Expression * set_extension( bool exten ) { extension = exten; return this; }
    73 
    74         InferredParams & get_inferParams() { return inferParams; }
    75 
    76         virtual Expression * clone() const override = 0;
    77         virtual void accept( Visitor & v ) override = 0;
    78         virtual Expression * acceptMutator( Mutator & m ) override = 0;
    79         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
    8077};
    8178
     
    8683        Expression * function;
    8784        std::list<Expression *> args;
     85        InferredParams inferParams;
    8886
    8987        ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() );
     
    9492        void set_function( Expression * newValue ) { function = newValue; }
    9593        std::list<Expression *>& get_args() { return args; }
     94        InferredParams & get_inferParams() { return inferParams; }
    9695
    9796        virtual ApplicationExpr * clone() const { return new ApplicationExpr( * this ); }
Note: See TracChangeset for help on using the changeset viewer.