Changeset 2871210 for src/SynTree/Statement.cc
- Timestamp:
- Jul 3, 2015, 6:08:20 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- f6d7e0f
- Parents:
- 0df292b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Statement.cc
r0df292b r2871210 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jun 23 11:42:09201513 // Update Count : 2 112 // Last Modified On : Mon Jun 29 17:37:10 2015 13 // Update Count : 22 14 14 // 15 15 … … 28 28 using std::endl; 29 29 30 Statement::Statement( std::list<Label> _labels ) : labels( _labels ) {}30 Statement::Statement( std::list<Label> _labels ) : labels( _labels ) {} 31 31 32 32 void Statement::print( std::ostream &, int indent ) const {} … … 34 34 Statement::~Statement() {} 35 35 36 ExprStmt::ExprStmt( std::list<Label> _labels, Expression *_expr ) : Statement( _labels ), expr(_expr ) {}36 ExprStmt::ExprStmt( std::list<Label> _labels, Expression *_expr ) : Statement( _labels ), expr( _expr ) {} 37 37 38 38 ExprStmt::~ExprStmt() {} … … 46 46 47 47 BranchStmt::BranchStmt( std::list<Label> labels, Label _target, Type _type ) throw ( SemanticError ) : 48 Statement( labels ), originalTarget( _target ), target(_target ), type(_type ) {48 Statement( labels ), originalTarget( _target ), target( _target ), computedTarget( NULL ), type( _type ) { 49 49 //actually this is a syntactic error signaled by the parser 50 50 if ( type == BranchStmt::Goto && target.size() == 0 ) … … 53 53 54 54 BranchStmt::BranchStmt( std::list<Label> labels, Expression *_computedTarget, Type _type ) throw ( SemanticError ) : 55 Statement( labels ), computedTarget( _computedTarget ), type(_type ) {55 Statement( labels ), computedTarget( _computedTarget ), type( _type ) { 56 56 if ( type != BranchStmt::Goto || computedTarget == 0 ) 57 57 throw SemanticError("Computed target not valid in branch statement"); … … 75 75 76 76 IfStmt::IfStmt( std::list<Label> _labels, Expression *_condition, Statement *_thenPart, Statement *_elsePart ): 77 Statement( _labels ), condition(_condition ), thenPart(_thenPart ), elsePart(_elsePart ) {}77 Statement( _labels ), condition( _condition ), thenPart( _thenPart ), elsePart( _elsePart ) {} 78 78 79 79 IfStmt::~IfStmt() {} … … 93 93 94 94 SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_branches ): 95 Statement( _labels ), condition(_condition ), branches(_branches ) {95 Statement( _labels ), condition( _condition ), branches( _branches ) { 96 96 } 97 97 … … 117 117 118 118 CaseStmt::CaseStmt( std::list<Label> _labels, Expression *_condition, std::list<Statement *> &_statements, bool deflt ) throw ( SemanticError ) : 119 Statement( _labels ), condition(_condition ), stmts(_statements ), _isDefault( deflt ) {119 Statement( _labels ), condition( _condition ), stmts( _statements ), _isDefault( deflt ) { 120 120 if ( isDefault() && condition != 0 ) 121 121 throw SemanticError("default with conditions"); … … 149 149 //ChooseStmt::ChooseStmt( std::list<Label> labels, Expression *condition, Statement *body ) {} 150 150 ChooseStmt::ChooseStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_branches ): 151 Statement( _labels ), condition(_condition ), branches(_branches ) {151 Statement( _labels ), condition( _condition ), branches( _branches ) { 152 152 } 153 153
Note: See TracChangeset
for help on using the changeset viewer.