Changeset 71806e0 for src/SynTree
- Timestamp:
- Nov 10, 2022, 8:21:54 PM (20 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 7491f97, e4d7c1c
- Parents:
- 639e4fc
- Location:
- src/SynTree
- Files:
-
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
r639e4fc r71806e0 450 450 451 451 452 class Inline ValueDecl : public DeclarationWithType {452 class InlineMemberDecl : public DeclarationWithType { 453 453 typedef DeclarationWithType Parent; 454 454 public: 455 455 Type * type; 456 456 457 Inline ValueDecl( 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, 458 458 const std::list< Attribute * > attributes = std::list< Attribute * >(), Type::FuncSpecifiers fs = Type::FuncSpecifiers() ); 459 Inline ValueDecl( const InlineValueDecl & other );460 virtual ~Inline ValueDecl();459 InlineMemberDecl( const InlineMemberDecl & other ); 460 virtual ~InlineMemberDecl(); 461 461 462 462 virtual Type * get_type() const override { return type; } 463 463 virtual void set_type(Type * newType) override { type = newType; } 464 464 465 static Inline ValueDecl * newInlineValueDecl( const std::string & name, Type * type );466 467 virtual Inline ValueDecl * 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 ); } 468 468 virtual void accept( Visitor & v ) override { v.visit( this ); } 469 469 virtual void accept( Visitor & v ) const override { v.visit( this ); } -
src/SynTree/InlineMemberDecl.cc
r639e4fc r71806e0 9 9 #include "Type.h" // for Type, Type::StorageClasses, Type::Fu... 10 10 11 Inline ValueDecl::InlineValueDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage,11 InlineMemberDecl::InlineMemberDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, 12 12 Type * type, const std::list< Attribute * >attributes, Type::FuncSpecifiers fs) 13 13 : Parent( name, scs, linkage, attributes, fs ), type( type ) {} 14 14 15 Inline ValueDecl::InlineValueDecl( const InlineValueDecl &other)15 InlineMemberDecl::InlineMemberDecl( const InlineMemberDecl &other) 16 16 : Parent( other), type( maybeClone( other.type ) ) {} 17 17 18 Inline ValueDecl::~InlineValueDecl() { delete type; }18 InlineMemberDecl::~InlineMemberDecl() { delete type; } 19 19 20 Inline ValueDecl * InlineValueDecl::newInlineValueDecl( const std::string &name, Type * type ) {21 return new Inline ValueDecl( name, Type::StorageClasses(), LinkageSpec::C, type );20 InlineMemberDecl * InlineMemberDecl::newInlineMemberDecl( const std::string &name, Type * type ) { 21 return new InlineMemberDecl( name, Type::StorageClasses(), LinkageSpec::C, type ); 22 22 } 23 23 24 void Inline ValueDecl::print( std::ostream &os, Indenter indent ) const {24 void InlineMemberDecl::print( std::ostream &os, Indenter indent ) const { 25 25 if ( name != "" ) os << name << ": "; 26 26 … … 44 44 } 45 45 46 void Inline ValueDecl::printShort( std::ostream &os, Indenter indent ) const {46 void InlineMemberDecl::printShort( std::ostream &os, Indenter indent ) const { 47 47 if ( name != "" ) os << name << ": "; 48 48 -
src/SynTree/Mutator.h
r639e4fc r71806e0 36 36 virtual DirectiveDecl * mutate( DirectiveDecl * directiveDecl ) = 0; 37 37 virtual StaticAssertDecl * mutate( StaticAssertDecl * assertDecl ) = 0; 38 virtual DeclarationWithType * mutate( Inline ValueDecl * inlineValueDecl ) = 0;38 virtual DeclarationWithType * mutate( InlineMemberDecl * InlineMemberDecl ) = 0; 39 39 40 40 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) = 0; -
src/SynTree/SynTree.h
r639e4fc r71806e0 38 38 class DirectiveDecl; 39 39 class StaticAssertDecl; 40 class Inline ValueDecl;40 class InlineMemberDecl; 41 41 42 42 class Statement; -
src/SynTree/Visitor.h
r639e4fc r71806e0 49 49 virtual void visit( StaticAssertDecl * node ) { visit( const_cast<const StaticAssertDecl *>(node) ); } 50 50 virtual void visit( const StaticAssertDecl * assertDecl ) = 0; 51 virtual void visit( Inline ValueDecl * node ) { visit( const_cast<const InlineValueDecl *>(node) ); }52 virtual void visit( const Inline ValueDecl * valueDecl ) = 0;51 virtual void visit( InlineMemberDecl * node ) { visit( const_cast<const InlineMemberDecl *>(node) ); } 52 virtual void visit( const InlineMemberDecl * valueDecl ) = 0; 53 53 54 54 virtual void visit( CompoundStmt * node ) { visit( const_cast<const CompoundStmt *>(node) ); } -
src/SynTree/module.mk
r639e4fc r71806e0 42 42 SynTree/Initializer.cc \ 43 43 SynTree/Initializer.h \ 44 SynTree/Inline ValueDecl.cc \44 SynTree/InlineMemberDecl.cc \ 45 45 SynTree/Label.h \ 46 46 SynTree/LinkageSpec.cc \
Note: See TracChangeset
for help on using the changeset viewer.