source: src/Parser/TypedefTable.h @ 0b0a285

Last change on this file since 0b0a285 was c468150, checked in by Andrew Beach <ajbeach@…>, 15 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
RevLine 
[b87a5ed]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//
[be9288a]7// TypedefTable.h --
[b87a5ed]8//
[7fdb94e]9// Author           : Peter A. Buhr
[b87a5ed]10// Created On       : Sat May 16 15:24:36 2015
11// Last Modified By : Peter A. Buhr
[60a8062]12// Last Modified On : Sat Feb 15 08:06:37 2020
13// Update Count     : 117
[b87a5ed]14//
15
[6b0b624]16#pragma once
[51b7345]17
[7fdb94e]18#include <string>                                                                               // for string
[51b7345]19
[7fdb94e]20#include "Common/ScopedMap.h"                                                   // for ScopedMap
[984dce6]21
[c8ffe20b]22class TypedefTable {
[fc20514]23        struct Note { size_t level; bool forall; };
24        typedef ScopedMap< std::string, int, Note > KindTable;
[c468150]25        KindTable kindTable;
[fc20514]26        unsigned int level = 0;
[51b7345]27  public:
[7fdb94e]28        ~TypedefTable();
[45161b4d]29
[60a8062]30        bool exists( const std::string & identifier ) const;
31        bool existsCurr( const std::string & identifier ) const;
[7fdb94e]32        int isKind( const std::string & identifier ) const;
[c468150]33        void makeTypedef( const std::string & name, int kind );
34        void makeTypedef( const std::string & name );
[ecae5860]35        void addToScope( const std::string & identifier, int kind, const char * );
36        void addToEnclosingScope( const std::string & identifier, int kind, const char * );
[fc20514]37        bool getEnclForall() { return kindTable.getNote( kindTable.currentScope() -  1 ).forall; }
[be9288a]38
[b87a5ed]39        void enterScope();
40        void leaveScope();
[3d26610]41
[fc20514]42        void up( bool );
43        void down();
[3d56d15b]44
[3d26610]45        void print( void ) const;
[7fdb94e]46}; // TypedefTable
[51b7345]47
[b87a5ed]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.