root/tlate/lit.hh
| Revision 868b365c127bbf4f0b52f22da03e32a94a4f6653, 1.6 KB (checked in by Antti-Juhani Kaijanaho <antti-juhani@…>, 3 years ago) | |
|---|---|
|
|
| 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_LIT_HH |
| 21 | #define GUARD_TLATE_LIT_HH |
| 22 | |
| 23 | #include "expr.hh" |
| 24 | #include "scanner.hh" |
| 25 | |
| 26 | namespace tlate |
| 27 | { |
| 28 | class lit : public expr |
| 29 | { |
| 30 | std::string val; |
| 31 | public: |
| 32 | typedef boost::shared_ptr<lit> ptr; |
| 33 | |
| 34 | explicit lit(std::string val, |
| 35 | std::string fname, int line) |
| 36 | : expr(fname, line) |
| 37 | , val(val) |
| 38 | {} |
| 39 | |
| 40 | value::const_ptr eval_(overriding_structured_value::ptr) { |
| 41 | value::ptr rv(new string_value(val)); |
| 42 | return rv; |
| 43 | } |
| 44 | std::set<std::string> fvs() const { |
| 45 | return std::set<std::string>(); |
| 46 | } |
| 47 | }; |
| 48 | } |
| 49 | |
| 50 | #endif /* GUARD_TLATE_LIT_HH */ |
Note: See TracBrowser
for help on using the browser.
