Changeset 2d019af for src/SynTree
- Timestamp:
- Mar 12, 2021, 11:14:29 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 41ca6fa, e867b44d
- Parents:
- 6083392
- Location:
- src/SynTree
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.cc
r6083392 r2d019af 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 11 16:39:56 201913 // Update Count : 3 612 // Last Modified On : Fri Mar 12 18:35:39 2021 13 // Update Count : 37 14 14 // 15 15 … … 66 66 67 67 68 DirectiveDecl::DirectiveDecl( DirectiveStmt *stmt ) : Declaration( "", Type::StorageClasses(), LinkageSpec::C ), stmt( stmt ) { 69 } 70 71 DirectiveDecl::DirectiveDecl( const DirectiveDecl &other ) : Declaration( other ), stmt( maybeClone( other.stmt ) ) { 72 } 73 74 DirectiveDecl::~DirectiveDecl() { 75 delete stmt; 76 } 77 78 void DirectiveDecl::print( std::ostream &os, Indenter indent ) const { 79 stmt->print( os, indent ); 80 } 81 82 void DirectiveDecl::printShort( std::ostream &os, Indenter indent ) const { 83 stmt->print( os, indent ); 84 } 85 86 68 87 StaticAssertDecl::StaticAssertDecl( Expression * condition, ConstantExpr * message ) : Declaration( "", Type::StorageClasses(), LinkageSpec::C ), condition( condition ), message( message ) { 69 88 } -
src/SynTree/Declaration.h
r6083392 r2d019af 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jan 11 20:48:39202113 // Update Count : 15 812 // Last Modified On : Fri Mar 12 18:35:36 2021 13 // Update Count : 159 14 14 // 15 15 … … 400 400 }; 401 401 402 class DirectiveDecl : public Declaration { 403 public: 404 DirectiveStmt * stmt; 405 406 DirectiveDecl( DirectiveStmt * stmt ); 407 DirectiveDecl( const DirectiveDecl & other ); 408 virtual ~DirectiveDecl(); 409 410 DirectiveStmt * get_stmt() { return stmt; } 411 void set_stmt( DirectiveStmt * newValue ) { stmt = newValue; } 412 413 virtual DirectiveDecl * clone() const override { return new DirectiveDecl( *this ); } 414 virtual void accept( Visitor & v ) override { v.visit( this ); } 415 virtual void accept( Visitor & v ) const override { v.visit( this ); } 416 virtual DirectiveDecl * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 417 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 418 virtual void printShort( std::ostream & os, Indenter indent = {} ) const override; 419 }; 420 402 421 class StaticAssertDecl : public Declaration { 403 422 public: -
src/SynTree/Mutator.h
r6083392 r2d019af 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 25 22:37:46 201913 // Update Count : 1 712 // Last Modified On : Fri Mar 12 18:35:36 2021 13 // Update Count : 18 14 14 // 15 15 #pragma once … … 34 34 virtual Declaration * mutate( TypedefDecl * typeDecl ) = 0; 35 35 virtual AsmDecl * mutate( AsmDecl * asmDecl ) = 0; 36 virtual DirectiveDecl * mutate( DirectiveDecl * directiveDecl ) = 0; 36 37 virtual StaticAssertDecl * mutate( StaticAssertDecl * assertDecl ) = 0; 37 38 -
src/SynTree/SynTree.h
r6083392 r2d019af 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 25 22:37:45 201913 // Update Count : 1 212 // Last Modified On : Fri Mar 12 18:56:44 2021 13 // Update Count : 13 14 14 // 15 15 … … 36 36 class TypedefDecl; 37 37 class AsmDecl; 38 class DirectiveDecl; 38 39 class StaticAssertDecl; 39 40 -
src/SynTree/Visitor.h
r6083392 r2d019af 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 25 22:21:49 201913 // Update Count : 1 412 // Last Modified On : Fri Mar 12 18:35:35 2021 13 // Update Count : 15 14 14 // 15 15 … … 45 45 virtual void visit( AsmDecl * node ) { visit( const_cast<const AsmDecl *>(node) ); } 46 46 virtual void visit( const AsmDecl * asmDecl ) = 0; 47 virtual void visit( DirectiveDecl * node ) { visit( const_cast<const DirectiveDecl *>(node) ); } 48 virtual void visit( const DirectiveDecl * directiveDecl ) = 0; 47 49 virtual void visit( StaticAssertDecl * node ) { visit( const_cast<const StaticAssertDecl *>(node) ); } 48 50 virtual void visit( const StaticAssertDecl * assertDecl ) = 0;
Note:
See TracChangeset
for help on using the changeset viewer.