Changeset 51587aa for translator/Tuples/NameMatcher.h
- Timestamp:
- May 18, 2015, 11:45:33 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:
- 01aeade
- Parents:
- 0dd3a2f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/Tuples/NameMatcher.h
r0dd3a2f r51587aa 1 #ifndef _TUPLE_NAMEMATCH_H_ 2 #define _TUPLE_NAMEMATCH_H_ 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo 3 // 4 // The contents of this file are covered under the licence agreement in the 5 // file "LICENCE" distributed with Cforall. 6 // 7 // NameMatcher.h -- 8 // 9 // Author : Richard C. Bilson 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 15:01:37 2015 13 // Update Count : 3 14 // 15 16 #ifndef _NAMEMATCHER_H_ 17 #define _NAMEMATCHER_H_ 3 18 4 19 #include <map> … … 17 32 18 33 namespace Tuples { 19 20 21 22 23 34 struct NoMoreElements {}; 35 struct NoMatch { 36 NoMatch( std::string msg ) : message( msg ) {} 37 std::string message; 38 }; 24 39 25 class NameMatcher 26 { 27 public: 28 NameMatcher( std::list< DeclarationWithType* >& ); 29 ~NameMatcher(); 40 class NameMatcher { 41 public: 42 NameMatcher( std::list< DeclarationWithType* >& ); 43 ~NameMatcher(); 30 44 31 32 45 void match( ResolvExpr::AltList &alternatives ) throw (NoMatch) ; 46 ResolvExpr::Alternative &get_next() throw (NoMoreElements); 33 47 34 private: 35 int current; 36 std::vector< DeclarationWithType* > index; 37 std::vector< const ResolvExpr::Alternative * > exprs; 38 std::map< std::string, int> table; 39 }; 40 48 private: 49 int current; 50 std::vector< DeclarationWithType* > index; 51 std::vector< const ResolvExpr::Alternative * > exprs; 52 std::map< std::string, int> table; 53 }; 41 54 } // namespace Tuples 42 55 43 #endif // #ifndef _TUPLE_NAMEMATCH_H_56 #endif // _NAMEMATCHER_H_ 44 57 45 / *46 Local Variables: 47 mode: c++ 48 End: 49 */58 // Local Variables: // 59 // tab-width: 4 // 60 // mode: c++ // 61 // compile-command: "make install" // 62 // End: //
Note: See TracChangeset
for help on using the changeset viewer.