source: translator/Tuples/NameMatcher.h@ fe3b61b

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors ctor deferred_resn demangler enum forall-pointer-decay gc_noraii jacob/cs343-translation jenkins-sandbox memory new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new string with_gc
Last change on this file since fe3b61b was 51b73452, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago

initial commit

  • Property mode set to 100644
File size: 1005 bytes
Line 
1#ifndef _TUPLE_NAMEMATCH_H_
2#define _TUPLE_NAMEMATCH_H_
3
4#include <map>
5#include <vector>
6#include <string>
7
8#include "SynTree/SynTree.h"
9#include "SynTree/Mutator.h"
10
11#include "SynTree/Type.h"
12#include "SynTree/Declaration.h"
13#include "SynTree/Expression.h"
14#include "SynTree/Statement.h"
15
16#include "ResolvExpr/Alternative.h"
17
18namespace Tuples {
19 struct NoMoreElements {};
20 struct NoMatch {
21 NoMatch( std::string msg ) : message( msg ) {}
22 std::string message;
23 };
24
25 class NameMatcher
26 {
27 public:
28 NameMatcher( std::list< DeclarationWithType* >& );
29 ~NameMatcher();
30
31 void match( ResolvExpr::AltList &alternatives ) throw (NoMatch) ;
32 ResolvExpr::Alternative &get_next() throw (NoMoreElements);
33
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
41} // namespace Tuples
42
43#endif // #ifndef _TUPLE_NAMEMATCH_H_
44
45/*
46 Local Variables:
47 mode: c++
48 End:
49*/
Note: See TracBrowser for help on using the repository browser.