root/tlate/tlate.hh

Revision 868b365c127bbf4f0b52f22da03e32a94a4f6653, 2.3 KB (checked in by Antti-Juhani Kaijanaho <antti-juhani@…>, 3 years ago)

Update the project blurb

Signed-off-by: Antti-Juhani Kaijanaho <antti-juhani@…>

  • Property mode set to 100644
Line 
1/*  This file is part of Alue, the multiprotocol Internet discussion daemon
2
3    Copyright © 2009 Antti-Juhani Kaijanaho
4
5    Alue is free software: you can redistribute it and/or modify it
6    under the terms of the GNU General Public License as published by
7    the Free Software Foundation, either version 3 of the License, or
8    (at your option) any later version.
9
10    Alue is distributed in the hope that it will be useful, but
11    WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with Alue.  If not, see <http://www.gnu.org/licenses/>.
17
18 */
19
20#ifndef GUARD_TLATE_TLATE_HH
21#define GUARD_TLATE_TLATE_HH
22
23#include "scanner.hh"
24#include "string_value.hh"
25#include "overriding_structured_value.hh"
26
27#include <boost/shared_ptr.hpp>
28#include <iostream>
29#include <set>
30
31namespace tlate
32{
33        class tlate
34        {
35        protected:
36                const std::string fname;
37                const int line;
38
39                tlate(std::string fname, int line)
40                        : fname(fname)
41                        , line(line)
42                        {}
43
44                std::string pos() {
45                        std::ostringstream os;
46                        os << fname << ":" << line;
47                        return os.str();
48                }
49
50        public:
51                typedef boost::shared_ptr<tlate> ptr;
52               
53                virtual ~tlate() {}
54
55                static ptr parse(scanner);
56                static ptr parse(boost::shared_ptr<std::istream> is,
57                                 std::string fname);
58                static ptr parse(std::string fname);
59                static ptr parse_string(std::string);
60
61                virtual value::const_ptr eval_(overriding_structured_value::ptr) = 0;
62                value::const_ptr eval(structured_value::ptr env_) {
63                        overriding_structured_value::ptr env
64                                (new overriding_structured_value(env_));
65                        return eval_(env);
66                }
67                virtual std::set<std::string> fvs() const = 0;
68       };
69};
70
71#endif /* GUARD_TLATE_TLATE_HH */
Note: See TracBrowser for help on using the browser.