symbol_table.h
Go to the documentation of this file.
/********************* */
#include "cvc4_public.h"
#ifndef __CVC4__SYMBOL_TABLE_H
#define __CVC4__SYMBOL_TABLE_H
#include <vector>
#include <utility>
#include <ext/hash_map>
#include "expr/expr.h"
#include "util/hash.h"
#include "context/cdhashset_forward.h"
#include "context/cdhashmap_forward.h"
namespace CVC4 {
class Type;
namespace context {
class Context;
}/* CVC4::context namespace */
class CVC4_PUBLIC ScopeException : public Exception {
};/* class ScopeException */
class CVC4_PUBLIC SymbolTable {
context::Context* d_context;
context::CDHashMap<std::string, Expr, StringHashFunction> *d_exprMap;
context::CDHashMap<std::string, std::pair<std::vector<Type>, Type>, StringHashFunction> *d_typeMap;
context::CDHashSet<Expr, ExprHashFunction> *d_functions;
public:
SymbolTable();
~SymbolTable();
void bind(const std::string& name, Expr obj, bool levelZero = false) throw();
void bindDefinedFunction(const std::string& name, Expr obj, bool levelZero = false) throw();
void bindType(const std::string& name, Type t, bool levelZero = false) throw();
void bindType(const std::string& name,
const std::vector<Type>& params,
Type t, bool levelZero = false) throw();
bool isBound(const std::string& name) const throw();
bool isBoundDefinedFunction(const std::string& name) const throw();
bool isBoundDefinedFunction(Expr func) const throw();
bool isBoundType(const std::string& name) const throw();
Expr lookup(const std::string& name) const throw();
Type lookupType(const std::string& name) const throw();
Type lookupType(const std::string& name,
const std::vector<Type>& params) const throw();
size_t lookupArity(const std::string& name);
void popScope() throw(ScopeException);
void pushScope() throw();
size_t getLevel() const throw();
};/* class SymbolTable */
}/* CVC4 namespace */
#endif /* __CVC4__SYMBOL_TABLE_H */
Context
void * Context
Definition c_interface_defs.h:42
Type
void * Type
Definition c_interface_defs.h:48
cdhashmap_forward.h
This is a forward declaration header to declare the CDHashMap<> template.
cdhashset_forward.h
This is a forward declaration header to declare the CDSet<> template.
CVC4::Exception
Definition exception.h:32
CVC4::Expr
Class encapsulating CVC4 expressions and methods for constructing new expressions.
Definition expr.h:227
CVC4::ScopeException
Definition symbol_table.h:40
CVC4::SymbolTable
A convenience class for handling scoped declarations.
Definition symbol_table.h:48
CVC4::SymbolTable::bind
void bind(const std::string &name, Expr obj, bool levelZero=false)
Bind an expression to a name in the current scope level.
CVC4::SymbolTable::SymbolTable
SymbolTable()
Create a symbol table.
CVC4::SymbolTable::~SymbolTable
~SymbolTable()
Destroy a symbol table.
CVC4::Type
Class encapsulating CVC4 expression types.
Definition type.h:89
cvc4_public.h
Macros that should be defined everywhere during the building of the libraries and driver binary,...
CVC4_PUBLIC
#define CVC4_PUBLIC
Definition cvc4_public.h:30
expr.h
hash.h
[[ Add one-line brief description here ]]
CVC4
Definition expr.h:106
std
STL namespace.
CVC4::StringHashFunction
Definition hash.h:49