source: src/Tuples/NameMatcher.h @ 76f2e97f

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since 76f2e97f was 843054c2, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

licencing: seventh groups of files

  • Property mode set to 100644
File size: 1.4 KB
Line 
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           : Rodolfo G. Esteves
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_
18
19#include <map>
20#include <vector>
21#include <string>
22
23#include "SynTree/SynTree.h"
24#include "SynTree/Mutator.h"
25
26#include "SynTree/Type.h"
27#include "SynTree/Declaration.h"
28#include "SynTree/Expression.h"
29#include "SynTree/Statement.h"
30
31#include "ResolvExpr/Alternative.h"
32
33namespace Tuples {
34        struct NoMoreElements {};
35        struct NoMatch {
36                NoMatch( std::string msg ) : message( msg ) {}
37                std::string message;
38        };
39
40        class NameMatcher {
41          public:
42                NameMatcher( std::list< DeclarationWithType* >& );
43                ~NameMatcher();
44
45                void match( ResolvExpr::AltList &alternatives ) throw (NoMatch) ;
46                ResolvExpr::Alternative &get_next() throw (NoMoreElements);
47
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        };
54} // namespace Tuples
55
56#endif // _NAMEMATCHER_H_
57
58// Local Variables: //
59// tab-width: 4 //
60// mode: c++ //
61// compile-command: "make install" //
62// End: //
Note: See TracBrowser for help on using the repository browser.