Changeset ff29f08 for src/SynTree
- Timestamp:
- May 18, 2018, 2:09:21 PM (6 years ago)
- Branches:
- new-env, with_gc
- Children:
- 2472a19
- Parents:
- f6f0cca3 (diff), c7d8100c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/SynTree
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Mutator.h
rf6f0cca3 rff29f08 39 39 virtual Statement * mutate( ExprStmt * exprStmt ) = 0; 40 40 virtual Statement * mutate( AsmStmt * asmStmt ) = 0; 41 virtual Statement * mutate( DirectiveStmt * dirStmt ) = 0; 41 42 virtual Statement * mutate( IfStmt * ifStmt ) = 0; 42 43 virtual Statement * mutate( WhileStmt * whileStmt ) = 0; -
src/SynTree/Statement.cc
rf6f0cca3 rff29f08 81 81 82 82 83 DirectiveStmt::DirectiveStmt( const std::string & directive ) : Statement(), directive( directive ) {} 84 85 void DirectiveStmt::print( std::ostream &os, Indenter ) const { 86 os << "GCC Directive:" << directive << endl; 87 } 88 89 83 90 const char *BranchStmt::brType[] = { "Goto", "Break", "Continue" }; 84 91 … … 370 377 void WaitForStmt::print( std::ostream &os, Indenter indent ) const { 371 378 os << "Waitfor Statement" << endl; 372 os << indent << "... with block:" << endl << indent+1; 373 // block->print( os, indent + 4 ); 379 indent += 1; 380 for( auto & clause : clauses ) { 381 os << indent << "target function :"; 382 if(clause.target.function) { clause.target.function->print(os, indent + 1); } 383 os << endl << indent << "with arguments :" << endl; 384 for( auto & thing : clause.target.arguments) { 385 if(thing) { thing->print(os, indent + 1); } 386 } 387 os << indent << " with statment :" << endl; 388 if(clause.statement) { clause.statement->print(os, indent + 1); } 389 390 os << indent << " with condition :" << endl; 391 if(clause.condition) { clause.condition->print(os, indent + 1); } 392 } 393 394 os << indent << " timeout of :" << endl; 395 if(timeout.time) { timeout.time->print(os, indent + 1); } 396 397 os << indent << " with statment :" << endl; 398 if(timeout.statement) { timeout.statement->print(os, indent + 1); } 399 400 os << indent << " with condition :" << endl; 401 if(timeout.condition) { timeout.condition->print(os, indent + 1); } 402 403 404 os << indent << " else :" << endl; 405 if(orelse.statement) { orelse.statement->print(os, indent + 1); } 406 407 os << indent << " with condition :" << endl; 408 if(orelse.condition) { orelse.condition->print(os, indent + 1); } 374 409 } 375 410 -
src/SynTree/Statement.h
rf6f0cca3 rff29f08 122 122 }; 123 123 124 class DirectiveStmt : public Statement { 125 public: 126 std::string directive; 127 128 DirectiveStmt( const std::string & ); 129 virtual ~DirectiveStmt(){} 130 131 virtual DirectiveStmt * clone() const { return new DirectiveStmt( *this ); } 132 virtual void accept( Visitor & v ) { v.visit( this ); } 133 virtual Statement * acceptMutator( Mutator & m ) { return m.mutate( this ); } 134 virtual void print( std::ostream & os, Indenter indent = {} ) const; 135 }; 136 124 137 class IfStmt : public Statement { 125 138 public: -
src/SynTree/SynTree.h
rf6f0cca3 rff29f08 44 44 class ExprStmt; 45 45 class AsmStmt; 46 class DirectiveStmt; 46 47 class IfStmt; 47 48 class WhileStmt; -
src/SynTree/Visitor.h
rf6f0cca3 rff29f08 41 41 virtual void visit( ExprStmt * exprStmt ) = 0; 42 42 virtual void visit( AsmStmt * asmStmt ) = 0; 43 virtual void visit( DirectiveStmt * directiveStmt ) = 0; 43 44 virtual void visit( IfStmt * ifStmt ) = 0; 44 45 virtual void visit( WhileStmt * whileStmt ) = 0;
Note: See TracChangeset
for help on using the changeset viewer.