Changeset bbf17d5


Ignore:
Timestamp:
Jul 25, 2022, 12:37:10 PM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
50a8aa9
Parents:
b729c01
Message:

Basic Defining of QualifiedNameExpr?; save for debugging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

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