Changeset aa72198 for src/SynTree
- Timestamp:
- Sep 13, 2017, 2:09:14 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 9dcb653
- Parents:
- e0886db
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Visitor.h
re0886db raa72198 148 148 } 149 149 150 template< typename Container, typename VisitorType >151 void acceptAllFold( Container &container, VisitorType &visitor, VisitorType &around ) {152 SemanticError errors;153 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {154 try {155 if ( *i ) {156 VisitorType *v = new VisitorType;157 (*i)->accept( *v );158 159 typename Container::iterator nxt = i; nxt++; // forward_iterator160 if ( nxt == container.end() )161 visitor += *v;162 else163 visitor += *v + around;164 165 delete v;166 } // if167 } catch( SemanticError &e ) {168 e.set_location( (*i)->location );169 errors.append( e );170 } // try171 } // for172 if ( ! errors.isEmpty() ) {173 throw errors;174 } // if175 }176 177 150 // Local Variables: // 178 151 // tab-width: 4 //
Note: See TracChangeset
for help on using the changeset viewer.