00001 00002 /****************************************************************************** 00003 * MODULE : mmx_syntax.hpp 00004 * DESCRIPTION: Parser and pretty printer for Mathemagix 00005 * COPYRIGHT : (C) 2000 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 #ifndef __MMX_SYNTAX_HPP 00014 #define __MMX_SYNTAX_HPP 00015 #include <basix/string.hpp> 00016 #include <basix/list.hpp> 00017 #include <basix/identifiers.hpp> 00018 #include <basix/parse_tools.hpp> 00019 00021 00022 namespace mmx { 00023 00024 extern bool new_lambda_style; 00025 extern bool mmx_abbreviate_coerce; 00026 extern bool new_convert_style; 00027 00028 int mmx_lex (generic* lval, parse_instance* obj); 00029 // lexicographic analyzer 00030 00031 generic mmx_parse (const string &file_name, nat input_number, 00032 const string& s, list<generic>& errors); 00033 // Parse s. 00034 // input_number is relevant in the interactive mode only. 00035 // file_name == "" means stdin. 00036 00037 generic mmx_parse (const string &file_name, const string& s); 00038 // Simplified parse routine of the file 'file_name' with contents 's'. 00039 // Returns an exception in case of errors. 00040 00041 string as_mmx (const generic& g); 00042 string flatten_as_mmx (const generic& g); 00043 string output_as_mmx (const generic& g); 00044 string string_as_mmx (const string& s); 00045 00046 generic texmacs_expand (const generic& g); 00047 // Crude expansion of documents with TeXmacs macros 00048 00049 } 00050 #endif // __MMX_SYNTAX_HPP