Ignore:
Timestamp:
Sep 20, 2022, 8:37:05 PM (19 months ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
a065f1f
Parents:
d489da8 (diff), 12df6fe (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 to Master Sept 19

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    rd489da8 r4520b77e  
    163163};
    164164
     165// [Qualifier].name; Qualifier is the type_name from the parser
     166class QualifiedNameExpr : public Expression {
     167  public:
     168        Declaration * type_decl;
     169        std::string name;
     170        DeclarationWithType * var;
     171
     172        QualifiedNameExpr( Declaration * decl, std::string name): Expression(), type_decl(decl), name(name) {}
     173        QualifiedNameExpr( const QualifiedNameExpr & other): Expression(other), type_decl(other.type_decl), name(other.name), var(other.var) {}
     174        DeclarationWithType * get_var() const { return var; }
     175        void set_var( DeclarationWithType * newValue ) { var = newValue; }
     176
     177        virtual ~QualifiedNameExpr() {
     178                delete var;
     179                delete type_decl;
     180        }
     181
     182        virtual QualifiedNameExpr * clone() const override {
     183                return new QualifiedNameExpr( * this );
     184        }
     185        virtual void accept( Visitor & v ) override { v.visit(this); }
     186        virtual void accept( Visitor & v ) const override { v.visit(this); }
     187        virtual Expression * acceptMutator( Mutator & m ) override {
     188                return m.mutate( this );
     189        }
     190       
     191        virtual void print( std::ostream & os, Indenter indent = {} ) const override {
     192                type_decl->print( os, indent );
     193                os << name << std::endl;
     194        }
     195};
     196
    165197/// VariableExpr represents an expression that simply refers to the value of a named variable.
    166198/// Does not take ownership of var.
Note: See TracChangeset for help on using the changeset viewer.