Changeset 94e0864d for src/SynTree/Statement.h
- Timestamp:
- Jun 24, 2015, 4:12:31 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:
- 1869adf
- Parents:
- 94b4364 (diff), de62360d (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Statement.h
r94b4364 r94e0864d 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Jun 4 14:03:31201513 // Update Count : 1412 // Last Modified On : Tue Jun 23 11:44:27 2015 13 // Update Count : 20 14 14 // 15 15 … … 28 28 29 29 std::list<Label> & get_labels() { return labels; } 30 const std::list<Label> & get_labels() const { return labels; } 30 31 31 32 virtual Statement *clone() const = 0; 32 33 virtual void accept( Visitor &v ) = 0; 33 34 virtual Statement *acceptMutator( Mutator &m ) = 0; 34 virtual void print( std::ostream &os, int indent = 0 ) ;35 virtual void print( std::ostream &os, int indent = 0 ) const; 35 36 protected: 36 37 std::list<Label> labels; … … 48 49 virtual void accept( Visitor &v ) { v.visit( this ); } 49 50 virtual CompoundStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); } 50 virtual void print( std::ostream &os, int indent = 0 ) ;51 virtual void print( std::ostream &os, int indent = 0 ) const; 51 52 private: 52 53 std::list<Statement*> kids; … … 64 65 virtual void accept( Visitor &v ) { v.visit( this ); } 65 66 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 66 virtual void print( std::ostream &os, int indent = 0 ) ;67 virtual void print( std::ostream &os, int indent = 0 ) const; 67 68 private: 68 69 Expression *expr; … … 84 85 virtual void accept( Visitor &v ) { v.visit( this ); } 85 86 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 86 virtual void print( std::ostream &os, int indent = 0 ) ;87 virtual void print( std::ostream &os, int indent = 0 ) const; 87 88 private: 88 89 Expression *condition; … … 106 107 107 108 virtual SwitchStmt *clone() const { return new SwitchStmt( *this ); } 108 virtual void print( std::ostream &os, int indent = 0 ) ;109 virtual void print( std::ostream &os, int indent = 0 ) const; 109 110 private: 110 111 Expression * condition; … … 127 128 128 129 virtual ChooseStmt *clone() const { return new ChooseStmt( *this ); } 129 virtual void print( std::ostream &os, int indent = 0 ) ;130 virtual void print( std::ostream &os, int indent = 0 ) const; 130 131 private: 131 132 Expression *condition; … … 141 142 142 143 virtual FallthruStmt *clone() const { return new FallthruStmt( *this ); } 143 virtual void print( std::ostream &os, int indent = 0 ) ;144 virtual void print( std::ostream &os, int indent = 0 ) const; 144 145 }; 145 146 … … 153 154 std::list<Statement *> stmts = std::list<Statement *>() ); 154 155 155 bool isDefault() { return _isDefault; }156 bool isDefault() const { return _isDefault; } 156 157 void set_default(bool b) { _isDefault = b; } 157 158 … … 166 167 167 168 virtual CaseStmt *clone() const { return new CaseStmt( *this ); } 168 virtual void print( std::ostream &os, int indent = 0 ) ;169 virtual void print( std::ostream &os, int indent = 0 ) const; 169 170 private: 170 171 Expression * condition; … … 189 190 virtual void accept( Visitor &v ) { v.visit( this ); } 190 191 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 191 virtual void print( std::ostream &os, int indent = 0 ) ;192 virtual void print( std::ostream &os, int indent = 0 ) const; 192 193 private: 193 194 Expression *condition; … … 214 215 virtual void accept( Visitor &v ) { v.visit( this ); } 215 216 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 216 virtual void print( std::ostream &os, int indent = 0 ) ;217 virtual void print( std::ostream &os, int indent = 0 ) const; 217 218 private: 218 219 Statement *initialization; … … 224 225 class BranchStmt : public Statement { 225 226 public: 226 enum Type { Goto = 0 227 enum Type { Goto = 0, Break, Continue }; 227 228 228 229 BranchStmt( std::list<Label> labels, Label target, Type ) throw (SemanticError); … … 243 244 virtual void accept( Visitor &v ) { v.visit( this ); } 244 245 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 245 virtual void print( std::ostream &os, int indent = 0 ) ;246 virtual void print( std::ostream &os, int indent = 0 ) const; 246 247 private: 247 248 static const char *brType[]; … … 263 264 virtual void accept( Visitor &v ) { v.visit( this ); } 264 265 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 265 virtual void print( std::ostream &os, int indent = 0 ) ;266 virtual void print( std::ostream &os, int indent = 0 ) const; 266 267 private: 267 268 Expression *expr; … … 279 280 virtual void accept( Visitor &v ) { v.visit( this ); } 280 281 virtual NullStmt *acceptMutator( Mutator &m ) { return m.mutate( this ); } 281 virtual void print( std::ostream &os, int indent = 0 ) ;282 virtual void print( std::ostream &os, int indent = 0 ) const; 282 283 283 284 private: … … 300 301 virtual void accept( Visitor &v ) { v.visit( this ); } 301 302 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 302 virtual void print( std::ostream &os, int indent = 0 ) ;303 virtual void print( std::ostream &os, int indent = 0 ) const; 303 304 304 305 private: … … 322 323 virtual void accept( Visitor &v ) { v.visit( this ); } 323 324 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 324 virtual void print( std::ostream &os, int indent = 0 ) ;325 virtual void print( std::ostream &os, int indent = 0 ) const; 325 326 326 327 private: … … 341 342 virtual void accept( Visitor &v ) { v.visit( this ); } 342 343 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 343 virtual void print( std::ostream &os, int indent = 0 ) ;344 virtual void print( std::ostream &os, int indent = 0 ) const; 344 345 private: 345 346 CompoundStmt *block; … … 360 361 virtual void accept( Visitor &v ) { v.visit( this ); } 361 362 virtual Statement *acceptMutator( Mutator &m ) { return m.mutate( this ); } 362 virtual void print( std::ostream &os, int indent = 0 ) ;363 virtual void print( std::ostream &os, int indent = 0 ) const; 363 364 private: 364 365 Declaration *decl;
Note: See TracChangeset
for help on using the changeset viewer.