Changeset 71806e0 for src/SynTree


Ignore:
Timestamp:
Nov 10, 2022, 8:21:54 PM (20 months ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, master
Children:
7491f97, e4d7c1c
Parents:
639e4fc
Message:

Rename InlineValueDecl? to InlineMemberDecl?

Location:
src/SynTree
Files:
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r639e4fc r71806e0  
    450450
    451451
    452 class InlineValueDecl : public DeclarationWithType {
     452class InlineMemberDecl : public DeclarationWithType {
    453453        typedef DeclarationWithType Parent;
    454454  public:
    455455        Type * type;
    456456
    457         InlineValueDecl( const std::string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage, Type * type,
     457        InlineMemberDecl( const std::string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage, Type * type,
    458458                                const std::list< Attribute * > attributes = std::list< Attribute * >(), Type::FuncSpecifiers fs = Type::FuncSpecifiers() );
    459         InlineValueDecl( const InlineValueDecl & other );
    460         virtual ~InlineValueDecl();
     459        InlineMemberDecl( const InlineMemberDecl & other );
     460        virtual ~InlineMemberDecl();
    461461
    462462        virtual Type * get_type() const override { return type; }
    463463        virtual void set_type(Type * newType) override { type = newType; }
    464464
    465         static InlineValueDecl * newInlineValueDecl( const std::string & name, Type * type );
    466 
    467         virtual InlineValueDecl * clone() const override { return new InlineValueDecl( *this ); }
     465        static InlineMemberDecl * newInlineMemberDecl( const std::string & name, Type * type );
     466
     467        virtual InlineMemberDecl * clone() const override { return new InlineMemberDecl( *this ); }
    468468        virtual void accept( Visitor & v ) override { v.visit( this ); }
    469469        virtual void accept( Visitor & v ) const override { v.visit( this ); }
  • src/SynTree/InlineMemberDecl.cc

    r639e4fc r71806e0  
    99#include "Type.h"                // for Type, Type::StorageClasses, Type::Fu...
    1010
    11 InlineValueDecl::InlineValueDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage,
     11InlineMemberDecl::InlineMemberDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage,
    1212Type * type, const std::list< Attribute * >attributes, Type::FuncSpecifiers fs)
    1313    : Parent( name, scs, linkage, attributes, fs ), type( type ) {}
    1414
    15 InlineValueDecl::InlineValueDecl( const InlineValueDecl &other)
     15InlineMemberDecl::InlineMemberDecl( const InlineMemberDecl &other)
    1616    : Parent( other), type( maybeClone( other.type ) ) {}
    1717
    18 InlineValueDecl::~InlineValueDecl() { delete type; }
     18InlineMemberDecl::~InlineMemberDecl() { delete type; }
    1919
    20 InlineValueDecl * InlineValueDecl::newInlineValueDecl( const std::string &name, Type * type ) {
    21     return new InlineValueDecl( name, Type::StorageClasses(), LinkageSpec::C, type );
     20InlineMemberDecl * InlineMemberDecl::newInlineMemberDecl( const std::string &name, Type * type ) {
     21    return new InlineMemberDecl( name, Type::StorageClasses(), LinkageSpec::C, type );
    2222}
    2323
    24 void InlineValueDecl::print( std::ostream &os, Indenter indent ) const {
     24void InlineMemberDecl::print( std::ostream &os, Indenter indent ) const {
    2525    if ( name != "" ) os << name << ": ";
    2626
     
    4444}
    4545
    46 void InlineValueDecl::printShort( std::ostream &os, Indenter indent ) const {
     46void InlineMemberDecl::printShort( std::ostream &os, Indenter indent ) const {
    4747    if ( name != "" ) os << name << ": ";
    4848
  • src/SynTree/Mutator.h

    r639e4fc r71806e0  
    3636        virtual DirectiveDecl * mutate( DirectiveDecl * directiveDecl ) = 0;
    3737        virtual StaticAssertDecl * mutate( StaticAssertDecl * assertDecl ) = 0;
    38         virtual DeclarationWithType * mutate( InlineValueDecl * inlineValueDecl ) = 0;
     38        virtual DeclarationWithType * mutate( InlineMemberDecl * InlineMemberDecl ) = 0;
    3939
    4040        virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) = 0;
  • src/SynTree/SynTree.h

    r639e4fc r71806e0  
    3838class DirectiveDecl;
    3939class StaticAssertDecl;
    40 class InlineValueDecl;
     40class InlineMemberDecl;
    4141
    4242class Statement;
  • src/SynTree/Visitor.h

    r639e4fc r71806e0  
    4949        virtual void visit( StaticAssertDecl * node ) { visit( const_cast<const StaticAssertDecl *>(node) ); }
    5050        virtual void visit( const StaticAssertDecl * assertDecl ) = 0;
    51         virtual void visit( InlineValueDecl * node ) { visit( const_cast<const InlineValueDecl *>(node) ); }
    52         virtual void visit( const InlineValueDecl * valueDecl ) = 0;
     51        virtual void visit( InlineMemberDecl * node ) { visit( const_cast<const InlineMemberDecl *>(node) ); }
     52        virtual void visit( const InlineMemberDecl * valueDecl ) = 0;
    5353
    5454        virtual void visit( CompoundStmt * node ) { visit( const_cast<const CompoundStmt *>(node) ); }
  • src/SynTree/module.mk

    r639e4fc r71806e0  
    4242      SynTree/Initializer.cc \
    4343      SynTree/Initializer.h \
    44       SynTree/InlineValueDecl.cc \
     44      SynTree/InlineMemberDecl.cc \
    4545      SynTree/Label.h \
    4646      SynTree/LinkageSpec.cc \
Note: See TracChangeset for help on using the changeset viewer.