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 13ca524 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.3 KB
|
Rev | Line | |
---|
[0dd3a2f] | 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 | // TypeTable.h -- |
---|
| 8 | // |
---|
| 9 | // Author : Richard C. Bilson |
---|
| 10 | // Created On : Sun May 17 21:48:32 2015 |
---|
| 11 | // Last Modified By : Peter A. Buhr |
---|
[a08ba92] | 12 | // Last Modified On : Tue May 19 16:50:25 2015 |
---|
| 13 | // Update Count : 3 |
---|
[0dd3a2f] | 14 | // |
---|
| 15 | |
---|
| 16 | #ifndef TYPETABLE_H |
---|
| 17 | #define TYPETABLE_H |
---|
[51b7345] | 18 | |
---|
| 19 | #include <cassert> |
---|
| 20 | #include <map> |
---|
| 21 | #include <stack> |
---|
| 22 | #include <string> |
---|
| 23 | #include <functional> |
---|
| 24 | |
---|
| 25 | #include "StackTable.h" |
---|
| 26 | #include "SynTree/Declaration.h" |
---|
| 27 | |
---|
| 28 | namespace SymTab { |
---|
[a08ba92] | 29 | class TypeTableConflictFunction : public std::binary_function< NamedTypeDecl *, NamedTypeDecl *, NamedTypeDecl * > { |
---|
| 30 | public: |
---|
[0dd3a2f] | 31 | NamedTypeDecl *operator()( NamedTypeDecl *existing, NamedTypeDecl *added ) { |
---|
| 32 | if ( existing->get_base() == 0 ) { |
---|
| 33 | return added; |
---|
| 34 | } else if ( added->get_base() == 0 ) { |
---|
| 35 | return existing; |
---|
| 36 | } else { |
---|
| 37 | throw SemanticError( "redeclaration of ", added ); |
---|
| 38 | } // if |
---|
| 39 | assert( false ); |
---|
| 40 | return 0; |
---|
| 41 | } |
---|
[a08ba92] | 42 | }; |
---|
[3c70d38] | 43 | |
---|
[a08ba92] | 44 | typedef StackTable< NamedTypeDecl, TypeTableConflictFunction > TypeTable; |
---|
[0dd3a2f] | 45 | } // namespace SymTab |
---|
| 46 | |
---|
| 47 | #endif // TYPETABLE_H |
---|
[3c70d38] | 48 | |
---|
[0dd3a2f] | 49 | // Local Variables: // |
---|
| 50 | // tab-width: 4 // |
---|
| 51 | // mode: c++ // |
---|
| 52 | // compile-command: "make install" // |
---|
| 53 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.