source: src/Parser/TypedefTable.h@ 3d7e53b

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr no_list persistent-indexer pthread-emulation qualifiedEnum
Last change on this file since 3d7e53b was 4612bb0, checked in by Aaron Moss <a3moss@…>, 7 years ago

Add push operations for ScopedMap notes

  • 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 : Fri Jun 22 05:29:58 2018
13// Update Count : 86
14//
15
16#pragma once
17
18#include <string> // for string
19
20#include "Common/ScopedMap.h" // for ScopedMap
21#include "ParserTypes.h"
22#include "parser.hh" // for IDENTIFIER, TYPEDEFname, TYPEGENname
23
24class TypedefTable {
25 typedef ScopedMap< std::string, int, int > KindTable;
26 KindTable kindTable;
27 unsigned int level;
28 public:
29 TypedefTable() : kindTable{0}, level{0} {}
30 ~TypedefTable();
31
32 bool exists( const std::string & identifier );
33 int isKind( const std::string & identifier ) const;
34 void makeTypedef( const std::string & name, int kind = TYPEDEFname );
35 void addToScope( const std::string & identifier, int kind, const char * );
36 void addToEnclosingScope( const std::string & identifier, int kind, const char * );
37
38 void enterScope();
39 void leaveScope();
40
41 void up() { level += 1; }
42 void down() { level -= 1; }
43
44 void print( void ) const;
45}; // TypedefTable
46
47// Local Variables: //
48// tab-width: 4 //
49// mode: c++ //
50// compile-command: "make install" //
51// End: //
Note: See TracBrowser for help on using the repository browser.