source: src/Parser/TypedefTable.h @ 52f9804

ADTast-experimental
Last change on this file since 52f9804 was c468150, checked in by Andrew Beach <ajbeach@…>, 19 months ago

Split up ParseNode?.h so that headers match implementation. May have a bit less to include total because of it.

  • 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// TypedefTable.h --
8//
9// Author           : Peter A. Buhr
10// Created On       : Sat May 16 15:24:36 2015
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Sat Feb 15 08:06:37 2020
13// Update Count     : 117
14//
15
16#pragma once
17
18#include <string>                                                                               // for string
19
20#include "Common/ScopedMap.h"                                                   // for ScopedMap
21
22class TypedefTable {
23        struct Note { size_t level; bool forall; };
24        typedef ScopedMap< std::string, int, Note > KindTable;
25        KindTable kindTable;
26        unsigned int level = 0;
27  public:
28        ~TypedefTable();
29
30        bool exists( const std::string & identifier ) const;
31        bool existsCurr( const std::string & identifier ) const;
32        int isKind( const std::string & identifier ) const;
33        void makeTypedef( const std::string & name, int kind );
34        void makeTypedef( const std::string & name );
35        void addToScope( const std::string & identifier, int kind, const char * );
36        void addToEnclosingScope( const std::string & identifier, int kind, const char * );
37        bool getEnclForall() { return kindTable.getNote( kindTable.currentScope() -  1 ).forall; }
38
39        void enterScope();
40        void leaveScope();
41
42        void up( bool );
43        void down();
44
45        void print( void ) const;
46}; // TypedefTable
47
48// Local Variables: //
49// tab-width: 4 //
50// mode: c++ //
51// compile-command: "make install" //
52// End: //
Note: See TracBrowser for help on using the repository browser.