Back to index

texmacs  1.0.7.15
evaluate_main.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : evaluate_main.cpp
00004 * DESCRIPTION: standard style evaluation
00005 * COPYRIGHT  : (C) 2006  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef EVALUATE_MAIN_H
00013 #define EVALUATE_MAIN_H
00014 #include "../Environment/environment.hpp"
00015 #include "../Memorizer/memorizer.hpp"
00016 
00017 extern environment std_env;
00018 
00019 tree evaluate (tree t);
00020 tree evaluate_error (string message);
00021 tree evaluate_error (string message, tree a1);
00022 tree evaluate_error (string message, array<tree> args);
00023 string evaluate_string (tree t);
00024 memorizer evaluate (environment env, tree t);
00025 tree expand (tree t, bool flag);
00026 
00027 /* Tree rewriting */
00028 #define INACTIVE_INLINE_RECURSE  0
00029 #define INACTIVE_INLINE_ONCE     1
00030 #define INACTIVE_INLINE_ERROR    2
00031 #define INACTIVE_BLOCK_RECURSE   3
00032 #define INACTIVE_BLOCK_ONCE      4
00033 #define INACTIVE_BLOCK_ERROR     5
00034 
00035 tree rewrite (tree t);
00036 tree evaluate_rewrite (tree t);
00037 tree rewrite_inactive (tree t, int inactive_mode);
00038 
00039 /* Length arithmetic */
00040 bool is_length (string s);
00041 bool is_length (tree t);
00042 SI as_length (string s);
00043 SI as_length (tree t);
00044 bool is_anylen (tree t);
00045 tree as_tmlen (tree t);
00046 tree tmlen_plus (tree t1, tree t2);
00047 tree tmlen_times (double sc, tree t);
00048 tree tmlen_over (tree t1, tree t2);
00049 
00050 /* Macro expansion */
00051 tree evaluate_assign (tree t);
00052 tree evaluate_with (tree t);
00053 tree evaluate_provides (tree t);
00054 tree evaluate_value (tree t);
00055 tree evaluate_quote_value (tree t);
00056 tree evaluate_drd_props (tree t);
00057 tree evaluate_compound (tree t);
00058 tree evaluate_arg (tree t);
00059 tree evaluate_quote_arg (tree t);
00060 tree evaluate_get_label (tree t);
00061 tree evaluate_get_arity (tree t);
00062 
00063 /* Quoting and evaluation */
00064 tree evaluate_eval_args (tree t);
00065 tree evaluate_quasiquote (tree t);
00066 
00067 /* Control structures */
00068 tree evaluate_if (tree t);
00069 tree evaluate_case (tree t);
00070 tree evaluate_while (tree t);
00071 tree evaluate_for_each (tree t);
00072 tree evaluate_include (tree t);
00073 tree evaluate_use_package (tree t);
00074 tree evaluate_use_module (tree t);
00075 
00076 /* Computational markup */
00077 tree evaluate_or (tree t);
00078 tree evaluate_xor (tree t);
00079 tree evaluate_and (tree t);
00080 tree evaluate_not (tree t);
00081 tree evaluate_plus_minus (tree t);
00082 tree evaluate_times_over (tree t);
00083 tree evaluate_divide (tree t);
00084 tree evaluate_modulo (tree t);
00085 tree evaluate_math_sqrt (tree t);
00086 tree evaluate_exp (tree t);
00087 tree evaluate_log (tree t);
00088 tree evaluate_pow (tree t);
00089 tree evaluate_cos (tree t);
00090 tree evaluate_sin (tree t);
00091 tree evaluate_tan (tree t);
00092 tree evaluate_merge (tree t);
00093 tree evaluate_length (tree t);
00094 tree evaluate_range (tree t);
00095 tree evaluate_number (tree t);
00096 tree evaluate_date (tree t);
00097 tree evaluate_translate (tree t);
00098 tree evaluate_change_case (tree t);
00099 tree evaluate_find_file (tree t);
00100 tree evaluate_is_tuple (tree t);
00101 tree evaluate_lookup (tree t);
00102 tree evaluate_equal (tree t);
00103 tree evaluate_unequal (tree t);
00104 tree evaluate_less (tree t);
00105 tree evaluate_lesseq (tree t);
00106 tree evaluate_greater (tree t);
00107 tree evaluate_greatereq (tree t);
00108 
00109 /* Length units */
00110 tree evaluate_cm_length ();
00111 tree evaluate_mm_length ();
00112 tree evaluate_in_length ();
00113 tree evaluate_pt_length ();
00114 tree evaluate_bp_length ();
00115 tree evaluate_dd_length ();
00116 tree evaluate_pc_length ();
00117 tree evaluate_cc_length ();
00118 tree evaluate_fs_length ();
00119 tree evaluate_fbs_length ();
00120 tree evaluate_em_length ();
00121 tree evaluate_ln_length ();
00122 tree evaluate_sep_length ();
00123 tree evaluate_yfrac_length ();
00124 tree evaluate_ex_length ();
00125 tree evaluate_fn_length ();
00126 tree evaluate_fns_length ();
00127 tree evaluate_bls_length ();
00128 tree evaluate_fnbot_length ();
00129 tree evaluate_fntop_length ();
00130 tree evaluate_spc_length ();
00131 tree evaluate_xspc_length ();
00132 tree evaluate_par_length ();
00133 tree evaluate_pag_length ();
00134 tree evaluate_gw_length ();
00135 tree evaluate_gh_length ();
00136 tree evaluate_tmpt_length ();
00137 tree evaluate_px_length ();
00138 tree evaluate_msec_length ();
00139 tree evaluate_sec_length ();
00140 tree evaluate_min_length ();
00141 tree evaluate_hr_length ();
00142 
00143 /* Miscellaneous primitives */
00144 tree evaluate_formatting (tree t, string v);
00145 tree evaluate_table (tree t);
00146 tree evaluate_hard_id (tree t);
00147 tree evaluate_script (tree t);
00148 tree evaluate_set_binding (tree t);
00149 tree evaluate_get_binding (tree t);
00150 tree evaluate_pattern (tree t);
00151 tree evaluate_point (tree t);
00152 //tree evaluate_box_info (tree t);
00153 //tree evaluate_frame_direct (tree t);
00154 //tree evaluate_frame_inverse (tree t);
00155 
00156 /* Other routines */
00157 class url;
00158 tree load_inclusion (url u);
00159 bool is_percentage (tree t, string s);
00160 bool is_percentage (tree t);
00161 double as_percentage (tree t);
00162 bool is_magnification (string s);
00163 double get_magnification (string s);
00164 void transfer_ip (tree src, tree dest);
00165 void decorate_ip (tree src, tree dest);
00166 
00167 #endif // defined EVLUATE_MAIN_H