# LanguageTable.h

    00001 /*
    00002  *             Copyright (C) 2005 Maarten Keijzer
    00003  *
    00004  *          This program is free software; you can redistribute it and/or modify
    00005  *          it under the terms of version 2 of the GNU General Public License as
    00006  *          published by the Free Software Foundation.
    00007  *
    00008  *          This program is distributed in the hope that it will be useful,
    00009  *          but WITHOUT ANY WARRANTY; without even the implied warranty of
    00010  *          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00011  *          GNU General Public License for more details.
    00012  *
    00013  *          You should have received a copy of the GNU General Public License
    00014  *          along with this program; if not, write to the Free Software
    00015  *          Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00016  */
    00017
    00018 #ifndef LANGUAGE_TABLE_H
    00019 #define LANGUAGE_TABLE_H
    00020
    00021 #include "token.h"
    00022
    00023 class LanguageImpl;
    00024 class Sym;
    00025
    00026 class LanguageTable {
    00027
    00028     LanguageImpl* pimpl;
    00029
    00030     public:
    00031
    00032     LanguageTable();
    00033     ~LanguageTable();
    00034
    00035     LanguageTable(const LanguageTable& org);
    00036
    00037     LanguageTable& operator=(const LanguageTable& org);
    00038
    00039     /* setting it up */
    00040     typedef Sym (*erc_func)();
    00041
    00042     void add_function(token_t token, unsigned arity);
    00043     void add_function(functor_t functor);
    00044     void set_erc(erc_func func);
    00045
    00046     /* Getting info out */
    00047
    00048     Sym get_random_var() const;
    00049     Sym get_random_const() const;
    00050
    00051     functor_t get_random_function() const;
    00052     token_t  get_random_function(token_t org, unsigned arity) const;
    00053 };
    00054
    00055 #endif
    00056