source: src/SymTab/TypeTable.h @ 843054c2

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 843054c2 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
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// 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
12// Last Modified On : Tue May 19 16:50:25 2015
13// Update Count     : 3
14//
15
16#ifndef TYPETABLE_H
17#define TYPETABLE_H
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
28namespace SymTab {
29        class TypeTableConflictFunction : public std::binary_function< NamedTypeDecl *, NamedTypeDecl *, NamedTypeDecl * > {
30          public:
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                }
42        };
43
44        typedef StackTable< NamedTypeDecl, TypeTableConflictFunction > TypeTable;
45} // namespace SymTab
46
47#endif // TYPETABLE_H
48
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.