Changes in src/SynTree/Visitor.h [135b431:aa72198]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Visitor.h
r135b431 raa72198 95 95 virtual void visit( PointerType *pointerType ); 96 96 virtual void visit( ArrayType *arrayType ); 97 virtual void visit( ReferenceType *refType ); 97 98 virtual void visit( FunctionType *functionType ); 98 99 virtual void visit( StructInstType *aggregateUseType ); … … 147 148 } 148 149 149 template< typename Container, typename VisitorType >150 void acceptAllFold( Container &container, VisitorType &visitor, VisitorType &around ) {151 SemanticError errors;152 for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {153 try {154 if ( *i ) {155 VisitorType *v = new VisitorType;156 (*i)->accept( *v );157 158 typename Container::iterator nxt = i; nxt++; // forward_iterator159 if ( nxt == container.end() )160 visitor += *v;161 else162 visitor += *v + around;163 164 delete v;165 } // if166 } catch( SemanticError &e ) {167 e.set_location( (*i)->location );168 errors.append( e );169 } // try170 } // for171 if ( ! errors.isEmpty() ) {172 throw errors;173 } // if174 }175 176 150 // Local Variables: // 177 151 // tab-width: 4 //
Note: See TracChangeset
for help on using the changeset viewer.