basix_doc 0.1
|
00001 00002 /****************************************************************************** 00003 * MODULE : literal.cpp 00004 * DESCRIPTION: Literal expressions (the leafs of a plain generic) 00005 * COPYRIGHT : (C) 2005 Joris van der Hoeven 00006 ******************************************************************************* 00007 * This software falls under the GNU general public license and comes WITHOUT 00008 * ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details. 00009 * If you don't have this file, write to the Free Software Foundation, Inc., 00010 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00011 ******************************************************************************/ 00012 00013 #include <basix/literal.hpp> 00014 namespace mmx { 00015 00016 syntactic 00017 flatten (const literal& s) { 00018 return as_syntactic (as<generic> (s)); 00019 } 00020 00021 string 00022 literal_to_string (const generic& g) { 00023 return as_string (as<literal> (g)); 00024 } 00025 00026 generic::generic (): 00027 rep (new generic_concrete_rep<literal> (literal (""))) {} 00028 generic::generic (const char* s): 00029 rep (new generic_concrete_rep<literal> (literal (s))) {} 00030 generic::generic (const string& s): 00031 rep (new generic_concrete_rep<literal> (literal (s))) {} 00032 00033 generic lit (const char* s) { 00034 return new generic_concrete_rep<literal> (literal (s)); } 00035 generic lit (const string& s) { 00036 return new generic_concrete_rep<literal> (literal (s)); } 00037 00038 } // namespace mmx