Changeset 4b60b28 for src/Parser
- Timestamp:
- Feb 16, 2023, 12:52:23 PM (20 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 1c80f20
- Parents:
- 26e6d88
- Location:
- src/Parser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
r26e6d88 r4b60b28 27 27 #include "Common/SemanticError.h" // for SemanticError 28 28 #include "Common/UniqueName.h" // for UniqueName 29 #include "Common/utility.h" // for maybeClone, maybeBuild 29 #include "Common/utility.h" // for maybeClone 30 #include "Parser/parserutility.h" // for maybeBuild 30 31 #include "SynTree/LinkageSpec.h" // for Spec 31 32 #include "SynTree/Declaration.h" // for Aggregate -
src/Parser/parserutility.h
r26e6d88 r4b60b28 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // parserutility.h -- 7 // parserutility.h -- Collected utilities for the parser. 8 8 // 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 15:31:46 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Jul 22 09:32:58 201713 // Update Count : 411 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Feb 16 12:34:00 2023 13 // Update Count : 5 14 14 // 15 15 … … 20 20 Expression *notZeroExpr( Expression *orig ); 21 21 22 template< typename T, typename U > 23 struct maybeBuild_t { 24 static T * doit( const U *orig ) { 25 if ( orig ) { 26 return orig->build(); 27 } else { 28 return 0; 29 } 30 } 31 }; 32 33 template< typename T, typename U > 34 static inline T * maybeBuild( const U *orig ) { 35 return maybeBuild_t<T,U>::doit(orig); 36 } 37 38 template< typename T, typename U > 39 static inline T * maybeMoveBuild( const U *orig ) { 40 T* ret = maybeBuild<T>(orig); 41 delete orig; 42 return ret; 43 } 44 22 45 // Local Variables: // 23 46 // tab-width: 4 //
Note: See TracChangeset
for help on using the changeset viewer.