Changes in src/AST/Node.hpp [1346914:dafe9e1]
- File:
-
- 1 edited
-
src/AST/Node.hpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Node.hpp
r1346914 rdafe9e1 18 18 #include <cassert> 19 19 #include <iosfwd> 20 21 #include "Common/ErrorObjects.h" // for SemanticErrorException22 20 23 21 namespace ast { … … 102 100 } 103 101 104 /// Call a visitor on a collection of nodes, throwing any exceptions when completed105 template< typename Container >106 void accept_each( const Container & c, Visitor & v ) {107 SemanticErrorException errors;108 for ( const auto & i : c ) {109 try {110 if ( i ) {111 i->accept( v );112 }113 } catch ( SemanticErrorException & e ) {114 errors.append( e );115 }116 }117 if ( ! errors.isEmpty() ) {118 throw errors;119 }120 }121 122 102 /// Base class for the smart pointer types 123 103 /// should never really be used. … … 186 166 const o_node_t * as() const { return dynamic_cast<const o_node_t *>(node); } 187 167 188 /// wrapper for convenient access to strict_dynamic_cast189 template<typename o_node_t>190 const o_node_t * strict_as() const { return strict_dynamic_cast<const o_node_t *>(node); }191 192 168 /// Returns a mutable version of the pointer in this node. 193 169 node_t * get_and_mutate();
Note:
See TracChangeset
for help on using the changeset viewer.