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 42dcae7 was
51b7345,
checked in by Peter A. Buhr <pabuhr@…>, 10 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 | |
---|
18 | namespace 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.