ADT
aaron-thesis
arm-eh
ast-experimental
cleanup-dtors
ctor
deferred_resn
demangler
enum
forall-pointer-decay
gc_noraii
jacob/cs343-translation
jenkins-sandbox
memory
new-ast
new-ast-unique-expr
new-env
no_list
persistent-indexer
pthread-emulation
qualifiedEnum
resolv-new
string
with_gc
|
Last change
on this file since fe3b61b was 51b73452, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago |
|
initial commit
|
-
Property mode
set to
100644
|
|
File size:
881 bytes
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * This file is part of the Cforall project
|
|---|
| 3 | *
|
|---|
| 4 | * $Id: IdTable.h,v 1.4 2005/08/29 20:14:17 rcbilson Exp $
|
|---|
| 5 | *
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef SYMTAB_IDTABLE_H
|
|---|
| 9 | #define SYMTAB_IDTABLE_H
|
|---|
| 10 |
|
|---|
| 11 | #include <iostream>
|
|---|
| 12 | #include <map>
|
|---|
| 13 | #include <string>
|
|---|
| 14 | #include <stack>
|
|---|
| 15 |
|
|---|
| 16 | #include "SynTree/SynTree.h"
|
|---|
| 17 |
|
|---|
| 18 | namespace SymTab {
|
|---|
| 19 |
|
|---|
| 20 | class IdTable
|
|---|
| 21 | {
|
|---|
| 22 | public:
|
|---|
| 23 | IdTable();
|
|---|
| 24 |
|
|---|
| 25 | void enterScope();
|
|---|
| 26 | void leaveScope();
|
|---|
| 27 | void addDecl( DeclarationWithType *decl );
|
|---|
| 28 | void lookupId( const std::string &id, std::list< DeclarationWithType* >& decls ) const;
|
|---|
| 29 |
|
|---|
| 30 | void dump( std::ostream &os ) const; // debugging
|
|---|
| 31 |
|
|---|
| 32 | private:
|
|---|
| 33 | typedef std::pair< DeclarationWithType*, int > DeclEntry;
|
|---|
| 34 | typedef std::map< std::string, std::stack< DeclEntry > > InnerTableType;
|
|---|
| 35 | typedef std::map< std::string, InnerTableType > OuterTableType;
|
|---|
| 36 |
|
|---|
| 37 | OuterTableType table;
|
|---|
| 38 | int scopeLevel;
|
|---|
| 39 | };
|
|---|
| 40 |
|
|---|
| 41 | } // namespace SymTab
|
|---|
| 42 |
|
|---|
| 43 | #endif /* #ifndef SYMTAB_IDTABLE_H */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.