Changeset 033ff37 for src/SynTree


Ignore:
Timestamp:
Jul 26, 2019, 6:39:42 AM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
be53b87
Parents:
f673c13c
Message:

remove attribute expression '@'name mechanism

Location:
src/SynTree
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    rf673c13c r033ff37  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb 19 18:10:55 2019
    13 // Update Count     : 60
     12// Last Modified On : Thu Jul 25 22:21:48 2019
     13// Update Count     : 61
    1414//
    1515
     
    249249        os << "Offset pack expression on ";
    250250        type->print(os, indent+1);
    251         Expression::print( os, indent );
    252 }
    253 
    254 AttrExpr::AttrExpr( Expression * attr, Expression * expr_ ) :
    255                 Expression(), attr( attr ), expr(expr_), type(0), isType(false) {
    256 }
    257 
    258 AttrExpr::AttrExpr( Expression * attr, Type * type_ ) :
    259                 Expression(), attr( attr ), expr(0), type(type_), isType(true) {
    260 }
    261 
    262 AttrExpr::AttrExpr( const AttrExpr & other ) :
    263                 Expression( other ), attr( maybeClone( other.attr ) ), expr( maybeClone( other.expr ) ), type( maybeClone( other.type ) ), isType( other.isType ) {
    264 }
    265 
    266 AttrExpr::~AttrExpr() {
    267         delete attr;
    268         delete expr;
    269         delete type;
    270 }
    271 
    272 void AttrExpr::print( std::ostream & os, Indenter indent) const {
    273         os << "Attr ";
    274         attr->print( os, indent+1);
    275         if ( isType || expr ) {
    276                 os << "applied to: ";
    277                 if (isType) type->print(os, indent+1);
    278                 else expr->print(os, indent+1);
    279         } // if
    280251        Expression::print( os, indent );
    281252}
  • src/SynTree/Expression.h

    rf673c13c r033ff37  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Feb 18 18:29:51 2019
    13 // Update Count     : 49
     12// Last Modified On : Thu Jul 25 22:21:44 2019
     13// Update Count     : 50
    1414//
    1515
     
    463463};
    464464
    465 /// AttrExpr represents an @attribute expression (like sizeof, but user-defined)
    466 class AttrExpr : public Expression {
    467   public:
    468         Expression * attr;
    469         Expression * expr;
    470         Type * type;
    471         bool isType;
    472 
    473         AttrExpr(Expression * attr, Expression * expr );
    474         AttrExpr( const AttrExpr & other );
    475         AttrExpr( Expression * attr, Type * type );
    476         virtual ~AttrExpr();
    477 
    478         Expression * get_attr() const { return attr; }
    479         void set_attr( Expression * newValue ) { attr = newValue; }
    480         Expression * get_expr() const { return expr; }
    481         void set_expr( Expression * newValue ) { expr = newValue; }
    482         Type * get_type() const { return type; }
    483         void set_type( Type * newValue ) { type = newValue; }
    484         bool get_isType() const { return isType; }
    485         void set_isType( bool newValue ) { isType = newValue; }
    486 
    487         virtual AttrExpr * clone() const override { return new AttrExpr( * this ); }
    488         virtual void accept( Visitor & v ) override { v.visit( this ); }
    489         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    490         virtual Expression * acceptMutator( Mutator & m ) override { return m.mutate( this ); }
    491         virtual void print( std::ostream & os, Indenter indent = {} ) const override;
    492 };
    493 
    494465/// LogicalExpr represents a short-circuit boolean expression (&& or ||)
    495466class LogicalExpr : public Expression {
  • src/SynTree/Mutator.h

    rf673c13c r033ff37  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Jul 24 16:31:00 2017
    13 // Update Count     : 16
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jul 25 22:37:46 2019
     13// Update Count     : 17
    1414//
    1515#pragma once
     
    7474        virtual Expression * mutate( OffsetofExpr * offsetofExpr ) = 0;
    7575        virtual Expression * mutate( OffsetPackExpr * offsetPackExpr ) = 0;
    76         virtual Expression * mutate( AttrExpr * attrExpr ) = 0;
    7776        virtual Expression * mutate( LogicalExpr * logicalExpr ) = 0;
    7877        virtual Expression * mutate( ConditionalExpr * conditionalExpr ) = 0;
  • src/SynTree/SynTree.h

    rf673c13c r033ff37  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Jul 24 16:54:00 2017
    13 // Update Count     : 11
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jul 25 22:37:45 2019
     13// Update Count     : 12
    1414//
    1515
     
    7979class OffsetofExpr;
    8080class OffsetPackExpr;
    81 class AttrExpr;
    8281class LogicalExpr;
    8382class ConditionalExpr;
  • src/SynTree/Visitor.h

    rf673c13c r033ff37  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Jul 24 16:28:00 2017
    13 // Update Count     : 13
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jul 25 22:21:49 2019
     13// Update Count     : 14
    1414//
    1515
     
    123123        virtual void visit( OffsetPackExpr * node ) { visit( const_cast<const OffsetPackExpr *>(node) ); }
    124124        virtual void visit( const OffsetPackExpr * offsetPackExpr ) = 0;
    125         virtual void visit( AttrExpr * node ) { visit( const_cast<const AttrExpr *>(node) ); }
    126         virtual void visit( const AttrExpr * attrExpr ) = 0;
    127125        virtual void visit( LogicalExpr * node ) { visit( const_cast<const LogicalExpr *>(node) ); }
    128126        virtual void visit( const LogicalExpr * logicalExpr ) = 0;
Note: See TracChangeset for help on using the changeset viewer.