Dictionary of named declarations with lookup. This class maintains a dictionary of names, which index types, supposedly declared in the scope that has this dictionary. There may be only one declaration per name, except in the case of function names.
| Public Typedefs Summary: | |
| std::vector<Types::Named*> | Type_vector The type of multiple entries. [Source] |
| Public Structs Summary: | |
| MultipleError Exception thrown when multiple declarations are found when one is expected. [Source] | |
| KeyError Exception thrown when a name is not found in lookup*() [Source] | |
| Public Member functions Summary: | |
| constructor | Dictionary() Constructor [Source] |
| destructor | ~Dictionary() Destructor [Source] |
| bool | has_key(const std::string& name) Returns true if name is in dict [Source] |
| Types::Named* | lookup(const std::string& name) Lookup a name in the dictionary. [Source] |
| Type_vector | lookupMultiple(const std::string& name) Lookup a name in the dictionary expecting multiple decls. [Source] |
| void | insert(AST::Declaration* decl) Add a declaration to the dictionary. [Source] |
| void | insert(Types::Named* named) Add a named type to the dictionary. [Source] |
| void | dump() Dump the contents for debugging [Source] |
| Private Data members Summary: | |
| Data* | m The private data. [Source] |
| Structs Summary: | |
| Data Define nested class [Source] | |
| Public Data members Inherited from FakeGC::cleanup | |
| cleanup_next | |
| Public Typedef Details: |
The type of multiple entries. We don't want to include type.hh just for this, so this is a workaround
| Public Member function Details: |
Lookup a name in the dictionary. If more than one declaration has this name then an exception is thrown.
Lookup a name in the dictionary expecting multiple decls. Use this method if you expect to find more than one declaration, eg importing names via a using statement.
Add a declaration to the dictionary. The name() is extracted from the declaration and its last string used as the key. The declaration is stored as a Type::Declared which is created inside this method.
Add a named type to the dictionary. The name() is extracted from the type and its last string used as they key.
| Private Data member Details: |
The private data. This is a forward declared * to speed compilation since std::map is a large template.