ghci/Linker.hs: Fix a typo in error message
[ghc.git] / testsuite / tests / programs / joao-circular / Visfun_Lazy.hs
1 module Visfun_Lazy where
2 import Data_Lazy
3 import LrcPrelude
4 --
5 -- Lazy Circular Evaluator Functions
6 --
7 lrcEval = visit_P
8 visit_P (C_RootProd_1 t_Defs ) x_pw = (x_code , x_errlst , x_typeerrors , x_uu_pp )
9 where
10 x_uu_pp = x_fmts_2
11 x_typeerrors = x_typeerrors_1
12 x_errlst = x_errlst_1
13 x_code = ((((:) C_Data_1 (gen_data_mem x_declsout_1))++x_declscode_1)++(((:) C_Cod_1 (genCodeMainFun ))++x_code_1))
14 x_infun_1 = 0
15 x_env_1 = x_declsout_1
16 x_declsin_1 = (lrc_empty_map (C_EmptyEntry_1 ))
17 x_pw_2 = x_pw
18 t_uu_pp = (C_Best_1 x_uu_pp_1)
19 (x_code_1 , x_declscode_1 , x_declsout_1 , x_errlst_1 , x_outfun_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Defs t_Defs x_declsin_1 x_env_1 x_infun_1
20 (x_fmts_2 ) = visit_PPRoot t_uu_pp x_pw_2
21 visit_Defs (C_Defs2_1 t_Def t_Defs_2 ) x_declsin x_env x_infun = (x_code , x_declscode , x_declsout , x_errlst , x_outfun , x_typeerrors , x_uu_pp )
22 where
23 x_infun_2 = x_outfun_1
24 x_env_2 = x_env
25 x_declsin_2 = x_declsout_1
26 x_uu_pp = (C_Above_1 x_uu_pp_1 x_uu_pp_2)
27 x_typeerrors = (x_typeerrors_1++x_typeerrors_2)
28 x_outfun = x_outfun_2
29 x_errlst = (x_errlst_1++x_errlst_2)
30 x_declsout = x_declsout_2
31 x_declscode = (x_declscode_1++x_declscode_2)
32 x_code = (x_code_1++x_code_2)
33 x_infun_1 = x_infun
34 x_env_1 = x_env
35 x_declsin_1 = x_declsin
36 (x_code_1 , x_declscode_1 , x_declsout_1 , x_errlst_1 , x_outfun_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Def t_Def x_declsin_1 x_env_1 x_infun_1
37 (x_code_2 , x_declscode_2 , x_declsout_2 , x_errlst_2 , x_outfun_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Defs t_Defs_2 x_declsin_2 x_env_2 x_infun_2
38 visit_Defs (C_NoDefs_1 ) x_declsin x_env x_infun = (x_code , x_declscode , x_declsout , x_errlst , x_outfun , x_typeerrors , x_uu_pp )
39 where
40 x_uu_pp = (C_Empty_1 )
41 x_typeerrors = ([] )
42 x_outfun = x_infun
43 x_errlst = ([] )
44 x_declsout = x_declsin
45 x_declscode = ([] )
46 x_code = ([] )
47 visit_Def (C_Arraydecl_1 t_Type t_Name t_INT ) x_declsin x_env x_infun = (x_code , x_declscode , x_declsout , x_errlst , x_outfun , x_typeerrors , x_uu_pp )
48 where
49 x_uu_pp = (C_Beside_1 (ppType t_Type) (C_Beside_1 (C_Text_1 " = ") (C_Beside_1 (ppName t_Name) (C_Text_1 (("["++(lrc_INTtoSTR t_INT))++"]")))))
50 x_typeerrors = ([] )
51 x_outfun = x_infun
52 x_errlst = (if (lrc_map_in t_Name x_declsin) then ((:) (C_E_Name_AD_1 t_Name) ([] )) else ([] ))
53 x_declsout = (if (lrc_map_in t_Name x_declsin) then x_declsin else (lrc_map_single_update t_Name (C_Consarray_1 t_Type t_INT x_infun) x_declsin))
54 x_declscode = ((:) (C_Var_1 (C_Ident_1 ((nametoSTR t_Name)++(lrc_INTtoSTR x_infun))) t_INT t_Type) ([] ))
55 x_code = ([] )
56 visit_Def (C_Declfunc_1 t_Type t_Name t_FormPars t_Stats ) x_declsin x_env x_infun = (x_code , x_declscode , x_declsout , x_errlst , x_outfun , x_typeerrors , x_uu_pp )
57 where
58 x_nlabeli_4 = 1
59 x_infun_4 = (x_infun+1)
60 x_fid_4 = t_Name
61 x_envi_4 = x_env
62 x_uu_pp = (func_def_a_la_c (ppType t_Type) (ppName t_Name) x_uu_pp_3 x_uu_pp_4)
63 x_typeerrors = x_typeerrors_4
64 x_outfun = (x_infun+1)
65 x_errlst = (x_err_aux++x_errlst_4)
66 x_declsout = (if (lrc_map_in t_Name x_declsin) then x_declsin else (lrc_map_single_update t_Name (C_Consfunc_1 t_Type x_infun x_lst_params_3) x_declsin))
67 x_declscode = (((:) (C_Var_1 (C_Ident_1 ((nametoSTR t_Name)++(lrc_INTtoSTR x_infun))) 1 t_Type) (gen_code_func x_infun_4 x_lst_params_3))++x_declscode_4)
68 x_code = (((:) (C_ALabel_1 t_Name) x_code_4)++((:) (C_Ret_1 ) []))
69 x_error = (if (lrc_map_in t_Name x_declsin) then "" else " <- id already defined!")
70 x_err_aux = (if (lrc_map_in t_Name x_declsin) then ((:) (C_E_Name_AD_1 t_Name) x_errlst_3) else x_errlst_3)
71 (x_errlst_3 , x_lst_params_3 , x_uu_pp_3 ) = visit_FormPars t_FormPars
72 (x_code_4 , x_declscode_4 , x_envo_4 , x_errlst_4 , x_nlabelo_4 , x_typeerrors_4 , x_uu_pp_4 ) = visit_Stats t_Stats x_envi_4 x_fid_4 x_infun_4 x_nlabeli_4
73 visit_Def (C_Declfunc_header_1 t_Type t_Name t_FormPars t_Stats ) x_declsin x_env x_infun = (x_code , x_declscode , x_declsout , x_errlst , x_outfun , x_typeerrors , x_uu_pp )
74 where
75 x_nlabeli_4 = 1
76 x_infun_4 = (x_infun+1)
77 x_fid_4 = t_Name
78 x_envi_4 = x_env
79 x_uu_pp = (C_Empty_1 )
80 x_typeerrors = x_typeerrors_4
81 x_outfun = (x_infun+1)
82 x_errlst = (x_err_aux++x_errlst_4)
83 x_declsout = (if (lrc_map_in t_Name x_declsin) then x_declsin else (lrc_map_single_update t_Name (C_Consfunc_1 t_Type x_infun x_lst_params_3) x_declsin))
84 x_declscode = (((:) (C_Var_1 (C_Ident_1 ((nametoSTR t_Name)++(lrc_INTtoSTR x_infun))) 1 t_Type) (gen_code_func x_infun_4 x_lst_params_3))++x_declscode_4)
85 x_code = (((:) (C_ALabel_1 t_Name) x_code_4)++((:) (C_Ret_1 ) []))
86 x_error = (if (lrc_map_in t_Name x_declsin) then "" else " <- id already defined!")
87 x_err_aux = (if (lrc_map_in t_Name x_declsin) then ((:) (C_E_Name_AD_1 t_Name) x_errlst_3) else x_errlst_3)
88 (x_errlst_3 , x_lst_params_3 , x_uu_pp_3 ) = visit_FormPars t_FormPars
89 (x_code_4 , x_declscode_4 , x_envo_4 , x_errlst_4 , x_nlabelo_4 , x_typeerrors_4 , x_uu_pp_4 ) = visit_Stats t_Stats x_envi_4 x_fid_4 x_infun_4 x_nlabeli_4
90 visit_Def (C_Declfunc_header_novar_1 t_Type t_Name t_FormPars t_Stats ) x_declsin x_env x_infun = (x_code , x_declscode , x_declsout , x_errlst , x_outfun , x_typeerrors , x_uu_pp )
91 where
92 x_nlabeli_4 = 1
93 x_infun_4 = (x_infun+1)
94 x_fid_4 = t_Name
95 x_envi_4 = x_env
96 x_uu_pp = (C_Empty_1 )
97 x_typeerrors = x_typeerrors_4
98 x_outfun = (x_infun+1)
99 x_errlst = (x_err_aux++x_errlst_4)
100 x_declsout = (if (lrc_map_in t_Name x_declsin) then x_declsin else (lrc_map_single_update t_Name (C_Consfunc_1 t_Type x_infun x_lst_params_3) x_declsin))
101 x_declscode = (((:) (C_Var_1 (C_Ident_1 ((nametoSTR t_Name)++(lrc_INTtoSTR x_infun))) 1 t_Type) (gen_code_func x_infun_4 x_lst_params_3))++x_declscode_4)
102 x_code = (((:) (C_ALabel_1 t_Name) x_code_4)++((:) (C_Ret_1 ) []))
103 x_error = (if (lrc_map_in t_Name x_declsin) then "" else " <- id already defined!")
104 x_err_aux = (if (lrc_map_in t_Name x_declsin) then ((:) (C_E_Name_AD_1 t_Name) x_errlst_3) else x_errlst_3)
105 (x_errlst_3 , x_lst_params_3 , x_uu_pp_3 ) = visit_FormPars t_FormPars
106 (x_code_4 , x_declscode_4 , x_envo_4 , x_errlst_4 , x_nlabelo_4 , x_typeerrors_4 , x_uu_pp_4 ) = visit_Stats t_Stats x_envi_4 x_fid_4 x_infun_4 x_nlabeli_4
107 visit_Def (C_Vardecl_1 t_Type t_Name ) x_declsin x_env x_infun = (x_code , x_declscode , x_declsout , x_errlst , x_outfun , x_typeerrors , x_uu_pp )
108 where
109 x_uu_pp = (C_Beside_1 (ppType t_Type) (C_Beside_1 (C_Text_1 " = ") (ppName t_Name)))
110 x_typeerrors = ([] )
111 x_outfun = x_infun
112 x_errlst = (if (lrc_map_in t_Name x_declsin) then ((:) (C_E_Name_AD_1 t_Name) ([] )) else ([] ))
113 x_declsout = (if (lrc_map_in t_Name x_declsin) then x_declsin else (lrc_map_single_update t_Name (C_Consvar_1 t_Type x_infun) x_declsin))
114 x_declscode = ((:) (C_Var_1 (C_Ident_1 ((nametoSTR t_Name)++(lrc_INTtoSTR x_infun))) 1 t_Type) ([] ))
115 x_code = ([] )
116 visit_Type (C_Booltype_1 ) = ()
117 visit_Type (C_Chartype_1 ) = ()
118 visit_Type (C_Errortype_1 ) = ()
119 visit_Type (C_Inttype_1 ) = ()
120 visit_Type (C_Realtype_1 ) = ()
121 visit_Name (C_Ident_1 t_STR ) = ()
122 visit_FormPars (C_Emptyformpars_1 ) = (x_errlst , x_lst_params , x_uu_pp )
123 where
124 x_uu_pp = (C_Text_1 "")
125 x_lst_params = ([] )
126 x_errlst = ([] )
127 visit_FormPars (C_Lstformpars_1 t_FormPar t_FormPars_2 ) = (x_errlst , x_lst_params , x_uu_pp )
128 where
129 x_uu_pp = (hv x_uu_pp_1 (C_Beside_1 (C_Text_1 ",") x_uu_pp_2))
130 x_lst_params = (x_one_param_1++x_lst_params_2)
131 x_errlst = (if (isinlst x_parname_1 x_lst_params_2) then ((:) (C_E_FormParam_AD_1 x_parname_1) x_errlst_2) else x_errlst_2)
132 (x_one_param_1 , x_parname_1 , x_uu_pp_1 ) = visit_FormPar t_FormPar
133 (x_errlst_2 , x_lst_params_2 , x_uu_pp_2 ) = visit_FormPars t_FormPars_2
134 visit_FormPar (C_Declformpar_1 t_Type t_Name ) = (x_one_param , x_parname , x_uu_pp )
135 where
136 x_uu_pp = (C_Beside_1 (ppType t_Type) (C_Beside_1 (C_Text_1 " ") (ppName t_Name)))
137 x_parname = t_Name
138 x_one_param = ((:) (C_AParam_1 t_Type t_Name) ([] ))
139 visit_Stats (C_Emptystat_1 ) x_envi x_fid x_infun x_nlabeli = (x_code , x_declscode , x_envo , x_errlst , x_nlabelo , x_typeerrors , x_uu_pp )
140 where
141 x_uu_pp = (C_Empty_1 )
142 x_typeerrors = ([] )
143 x_nlabelo = x_nlabeli
144 x_errlst = ([] )
145 x_envo = x_envi
146 x_declscode = ([] )
147 x_code = []
148 visit_Stats (C_Lststats_1 t_Stat t_Stats_2 ) x_envi x_fid x_infun x_nlabeli = (x_code , x_declscode , x_envo , x_errlst , x_nlabelo , x_typeerrors , x_uu_pp )
149 where
150 x_nlabeli_2 = x_nlabelo_1
151 x_infun_2 = x_infun
152 x_fid_2 = x_fid
153 x_envi_2 = x_envo_1
154 x_uu_pp = (C_Above_1 (C_Beside_1 x_uu_pp_1 (C_Text_1 ";")) x_uu_pp_2)
155 x_typeerrors = (x_typeerrors_1++x_typeerrors_2)
156 x_nlabelo = x_nlabelo_2
157 x_errlst = (x_errlst_1++x_errlst_2)
158 x_envo = x_envo_2
159 x_declscode = (x_declscode_1++x_declscode_2)
160 x_code = (x_code_1++x_code_2)
161 x_upw_Stats_infun_1 = x_infun
162 x_nlabeli_1 = x_nlabeli
163 x_infun_1 = x_infun
164 x_fid_1 = x_fid
165 x_envi_1 = x_envi
166 (x_code_1 , x_declscode_1 , x_envo_1 , x_errlst_1 , x_nlabelo_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Stat t_Stat x_envi_1 x_fid_1 x_infun_1 x_nlabeli_1 x_upw_Stats_infun_1
167 (x_code_2 , x_declscode_2 , x_envo_2 , x_errlst_2 , x_nlabelo_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Stats t_Stats_2 x_envi_2 x_fid_2 x_infun_2 x_nlabeli_2
168 visit_Stat (C_ArrAssign_1 t_ArrayUse t_Exp ) x_envi x_fid x_infun x_nlabeli x_upw_Stats_infun = (x_code , x_declscode , x_envo , x_errlst , x_nlabelo , x_typeerrors , x_uu_pp )
169 where
170 x_uu_pp = (C_Beside_1 x_uu_pp_1 (C_Beside_1 (C_Text_1 "[") (C_Beside_1 x_uu_pp_2 (C_Beside_1 (C_Text_1 "] = ") x_uu_pp_2))))
171 x_typeerrors = (if (typecheck x_an_1 x_type_2 x_fid x_envi) then x_typeerrors_2 else ((:) (C_E_T_DT_1 x_an_1) x_typeerrors_2))
172 x_nlabelo = x_nlabeli
173 x_errlst = (x_errlst_1++x_errlst_2)
174 x_envo = x_envi
175 x_declscode = ([] )
176 x_code = (x_code_1++x_code_2)
177 x_upw_Stats_infun_2 = x_upw_Stats_infun
178 x_fid_2 = x_fid
179 x_env_2 = x_envi
180 x_upw_Stats_infun_1 = x_upw_Stats_infun
181 x_fid_1 = x_fid
182 x_env_1 = x_envi
183 (x_an_1 , x_code_1 , x_errlst_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_ArrayUse t_ArrayUse x_env_1 x_fid_1 x_upw_Stats_infun_1
184 (x_code_2 , x_errlst_2 , x_type_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Exp t_Exp x_env_2 x_fid_2 x_upw_Stats_infun_2
185 visit_Stat (C_Assign_1 t_Name t_Exp ) x_envi x_fid x_infun x_nlabeli x_upw_Stats_infun = (x_code , x_declscode , x_envo , x_errlst , x_nlabelo , x_typeerrors , x_uu_pp )
186 where
187 x_uu_pp = (C_Beside_1 (ppName t_Name) (C_Beside_1 (C_Text_1 " = ") x_uu_pp_2))
188 x_typeerrors = (if (x_typerr==(C_NoTypeError_1 )) then x_typeerrors_2 else ((:) x_typerr x_typeerrors_2))
189 x_nlabelo = x_nlabeli
190 x_errlst = (if (isinenv t_Name x_fid x_envi) then x_errlst_2 else ((:) (C_E_Name_ND_1 t_Name) x_errlst_2))
191 x_envo = x_envi
192 x_declscode = ([] )
193 x_code = (((:) (C_Pusha_1 t_Name x_infun) x_code_2)++((:) (C_Store_1 ) ([] )))
194 x_upw_Stats_infun_2 = x_upw_Stats_infun
195 x_fid_2 = x_fid
196 x_env_2 = x_envi
197 x_typerr = (assign_InfType t_Name x_type_2 x_fid x_envi)
198 x_error = (if (isinenv t_Name x_fid x_envi) then ([] ) else ((:) (C_E_Name_ND_1 t_Name) ([] )))
199 (x_code_2 , x_errlst_2 , x_type_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Exp t_Exp x_env_2 x_fid_2 x_upw_Stats_infun_2
200 visit_Stat (C_Funccall_1 t_Name t_ActPars ) x_envi x_fid x_infun x_nlabeli x_upw_Stats_infun = (x_code , x_declscode , x_envo , x_errlst , x_nlabelo , x_typeerrors , x_uu_pp )
201 where
202 x_uu_pp = (funccall (ppName t_Name) x_uu_pp_2)
203 x_typeerrors = (checkactparams t_Name x_act_params_2 x_envi)
204 x_nlabelo = x_nlabeli
205 x_errlst = (if (lrc_map_in t_Name x_envi) then x_errlst_2 else ((:) (C_E_Fun_ND_1 t_Name) x_errlst_2))
206 x_envo = x_envi
207 x_declscode = ([] )
208 x_code = (gen_code_func_inv t_Name x_envi x_code_2)
209 x_upw_Stats_infun_2 = x_upw_Stats_infun
210 x_fid_2 = x_fid
211 x_env_2 = x_envi
212 x_error = (if (lrc_map_in t_Name x_envi) then ([] ) else ((:) (C_E_Fun_ND_1 t_Name) ([] )))
213 (x_act_params_2 , x_code_2 , x_errlst_2 , x_uu_pp_2 ) = visit_ActPars t_ActPars x_env_2 x_fid_2 x_upw_Stats_infun_2
214 visit_Stat (C_If_t_e_1 t_Exp t_Stats t_Stats_2 ) x_envi x_fid x_infun x_nlabeli x_upw_Stats_infun = (x_code , x_declscode , x_envo , x_errlst , x_nlabelo , x_typeerrors , x_uu_pp )
215 where
216 x_nlabeli_3 = (x_nlabeli+1)
217 x_infun_3 = x_infun
218 x_fid_3 = x_fid
219 x_envi_3 = x_envi
220 x_nlabeli_2 = x_nlabelo_3
221 x_infun_2 = x_infun
222 x_fid_2 = x_fid
223 x_envi_2 = x_envi
224 x_uu_pp = (if_t_ePP x_uu_pp_1 x_uu_pp_2 x_uu_pp_3)
225 x_typeerrors = (if (x_typerr==(C_NoTypeError_1 )) then ((x_typeerrors_1++x_typeerrors_2)++x_typeerrors_3) else ((:) x_typerr ((x_typeerrors_1++x_typeerrors_2)++x_typeerrors_3)))
226 x_nlabelo = x_nlabelo_2
227 x_errlst = ((x_errlst_1++x_errlst_2)++x_errlst_3)
228 x_envo = x_envi
229 x_declscode = (x_declscode_2++x_declscode_3)
230 x_code = (gen_code_ite x_nlabeli x_code_1 x_code_2 x_code_3)
231 x_upw_Stats_infun_1 = x_upw_Stats_infun
232 x_fid_1 = x_fid
233 x_env_1 = x_envi
234 x_typerr = (if (isboolexp x_type_1) then (C_NoTypeError_1 ) else (C_E_T_if_t_e_1 ))
235 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp x_env_1 x_fid_1 x_upw_Stats_infun_1
236 (x_code_2 , x_declscode_2 , x_envo_2 , x_errlst_2 , x_nlabelo_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Stats t_Stats x_envi_2 x_fid_2 x_infun_2 x_nlabeli_2
237 (x_code_3 , x_declscode_3 , x_envo_3 , x_errlst_3 , x_nlabelo_3 , x_typeerrors_3 , x_uu_pp_3 ) = visit_Stats t_Stats_2 x_envi_3 x_fid_3 x_infun_3 x_nlabeli_3
238 visit_Stat (C_Input_1 t_Name ) x_envi x_fid x_infun x_nlabeli x_upw_Stats_infun = (x_code , x_declscode , x_envo , x_errlst , x_nlabelo , x_typeerrors , x_uu_pp )
239 where
240 x_uu_pp = (C_Beside_1 (C_Text_1 "input ") (ppName t_Name))
241 x_typeerrors = ([] )
242 x_nlabelo = x_nlabeli
243 x_errlst = (if (isinenv t_Name x_fid x_envi) then ([] ) else ((:) (C_E_Name_ND_1 t_Name) ([] )))
244 x_envo = x_envi
245 x_declscode = ([] )
246 x_code = ((:) (C_Pusha_1 t_Name x_upw_Stats_infun) ((:) (C_IIn_1 ) ((:) (C_Store_1 ) ([] ))))
247 visit_Stat (C_LocalDecl_1 t_Type t_Name ) x_envi x_fid x_infun x_nlabeli x_upw_Stats_infun = (x_code , x_declscode , x_envo , x_errlst , x_nlabelo , x_typeerrors , x_uu_pp )
248 where
249 x_uu_pp = (C_Beside_1 (ppType t_Type) (C_Beside_1 (C_Text_1 " ") (ppName t_Name)))
250 x_typeerrors = ([] )
251 x_nlabelo = x_nlabeli
252 x_errlst = (if (lrc_map_in t_Name x_envi) then ((:) (C_E_Loc_Name_AD_1 t_Name) ([] )) else ([] ))
253 x_envo = (if (lrc_map_in t_Name x_envi) then x_envi else (lrc_map_single_update t_Name (C_Consvar_1 t_Type x_infun) x_envi))
254 x_declscode = ((:) (C_Var_1 t_Name x_infun t_Type) ([] ))
255 x_code = ([] )
256 visit_Stat (C_Print_1 t_Exp ) x_envi x_fid x_infun x_nlabeli x_upw_Stats_infun = (x_code , x_declscode , x_envo , x_errlst , x_nlabelo , x_typeerrors , x_uu_pp )
257 where
258 x_uu_pp = (C_Beside_1 (C_Text_1 "print ") x_uu_pp_1)
259 x_typeerrors = x_typeerrors_1
260 x_nlabelo = x_nlabeli
261 x_errlst = x_errlst_1
262 x_envo = x_envi
263 x_declscode = ([] )
264 x_code = (x_code_1++((:) (C_IOut_1 ) ([] )))
265 x_upw_Stats_infun_1 = x_upw_Stats_infun
266 x_fid_1 = x_fid
267 x_env_1 = x_envi
268 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp x_env_1 x_fid_1 x_upw_Stats_infun_1
269 visit_Stat (C_While_1 t_Exp t_Stats ) x_envi x_fid x_infun x_nlabeli x_upw_Stats_infun = (x_code , x_declscode , x_envo , x_errlst , x_nlabelo , x_typeerrors , x_uu_pp )
270 where
271 x_nlabeli_2 = (x_nlabeli+1)
272 x_infun_2 = x_infun
273 x_fid_2 = x_fid
274 x_envi_2 = x_envi
275 x_uu_pp = (whilePP (C_Text_1 "while ") x_uu_pp_1 x_uu_pp_2)
276 x_typeerrors = (if (x_typerr==(C_NoTypeError_1 )) then (x_typeerrors_1++x_typeerrors_2) else ((:) x_typerr (x_typeerrors_1++x_typeerrors_2)))
277 x_nlabelo = x_nlabelo_2
278 x_errlst = (x_errlst_1++x_errlst_2)
279 x_envo = x_envi
280 x_declscode = x_declscode_2
281 x_code = (gen_code_while x_nlabeli x_code_1 x_code_2)
282 x_upw_Stats_infun_1 = x_upw_Stats_infun
283 x_fid_1 = x_fid
284 x_env_1 = x_envi
285 x_typerr = (if (isboolexp x_type_1) then (C_NoTypeError_1 ) else (C_E_T_while_1 ))
286 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp x_env_1 x_fid_1 x_upw_Stats_infun_1
287 (x_code_2 , x_declscode_2 , x_envo_2 , x_errlst_2 , x_nlabelo_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Stats t_Stats x_envi_2 x_fid_2 x_infun_2 x_nlabeli_2
288 visit_ArrayUse (C_ArrayInd_1 t_Name t_Exp ) x_env x_fid x_upw_Stats_infun = (x_an , x_code , x_errlst , x_typeerrors , x_uu_pp )
289 where
290 x_upw_Stats_infun_2 = x_upw_Stats_infun
291 x_fid_2 = x_fid
292 x_env_2 = x_env
293 x_uu_pp = (C_Beside_1 (ppName t_Name) (C_Beside_1 (C_Text_1 "[") (C_Beside_1 x_uu_pp_2 (C_Text_1 "]"))))
294 x_typeerrors = (if (isinttype x_type_2) then x_typeerrors_2 else ((:) (C_E_T_IndArrNotInt_1 ) x_typeerrors_2))
295 x_errlst = (if x_noerror then x_errlst_2 else ((:) (C_E_Name_ND_1 t_Name) x_errlst_2))
296 x_code = x_code_2
297 x_an = t_Name
298 x_noerror = (isinenv t_Name x_fid x_env)
299 x_error = (if x_noerror then ([] ) else ((:) (C_E_Name_ND_1 t_Name) ([] )))
300 (x_code_2 , x_errlst_2 , x_type_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Exp t_Exp x_env_2 x_fid_2 x_upw_Stats_infun_2
301 visit_Exp (C_AddExp_1 t_Exp_2 t_Exp_3 ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
302 where
303 x_upw_Stats_infun_2 = x_upw_Stats_infun
304 x_fid_2 = x_fid
305 x_env_2 = x_env
306 x_upw_Stats_infun_1 = x_upw_Stats_infun
307 x_fid_1 = x_fid
308 x_env_1 = x_env
309 x_uu_pp = (hv x_uu_pp_1 (C_Beside_1 (C_Text_1 " + ") x_uu_pp_2))
310 x_typeerrors = (if (x_type==(C_Errortype_1 )) then ((:) (C_E_T_BOP_1 ) (x_typeerrors_1++x_typeerrors_2)) else (x_typeerrors_1++x_typeerrors_2))
311 x_type = (infType 1 x_type_1 x_type_2)
312 x_errlst = (x_errlst_1++x_errlst_2)
313 x_code = ((x_code_1++x_code_2)++((:) (C_Add_1 ) ([] )))
314 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp_2 x_env_1 x_fid_1 x_upw_Stats_infun_1
315 (x_code_2 , x_errlst_2 , x_type_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Exp t_Exp_3 x_env_2 x_fid_2 x_upw_Stats_infun_2
316 visit_Exp (C_AndExp_1 t_Exp_2 t_Exp_3 ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
317 where
318 x_upw_Stats_infun_2 = x_upw_Stats_infun
319 x_fid_2 = x_fid
320 x_env_2 = x_env
321 x_upw_Stats_infun_1 = x_upw_Stats_infun
322 x_fid_1 = x_fid
323 x_env_1 = x_env
324 x_uu_pp = (hv x_uu_pp_1 (C_Beside_1 (C_Text_1 " && ") x_uu_pp_2))
325 x_typeerrors = (if (x_type==(C_Errortype_1 )) then ((:) (C_E_T_BOP_1 ) (x_typeerrors_1++x_typeerrors_2)) else (x_typeerrors_1++x_typeerrors_2))
326 x_type = (infType 2 x_type_1 x_type_2)
327 x_errlst = (x_errlst_1++x_errlst_2)
328 x_code = ((x_code_1++x_code_2)++((:) (C_And_1 ) ([] )))
329 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp_2 x_env_1 x_fid_1 x_upw_Stats_infun_1
330 (x_code_2 , x_errlst_2 , x_type_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Exp t_Exp_3 x_env_2 x_fid_2 x_upw_Stats_infun_2
331 visit_Exp (C_DivExp_1 t_Exp_2 t_Exp_3 ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
332 where
333 x_upw_Stats_infun_2 = x_upw_Stats_infun
334 x_fid_2 = x_fid
335 x_env_2 = x_env
336 x_upw_Stats_infun_1 = x_upw_Stats_infun
337 x_fid_1 = x_fid
338 x_env_1 = x_env
339 x_uu_pp = (hv x_uu_pp_1 (C_Beside_1 (C_Text_1 " / ") x_uu_pp_2))
340 x_typeerrors = (if (x_type==(C_Errortype_1 )) then ((:) (C_E_T_BOP_1 ) (x_typeerrors_1++x_typeerrors_2)) else (x_typeerrors_1++x_typeerrors_2))
341 x_type = (infType 1 x_type_1 x_type_2)
342 x_errlst = (x_errlst_1++x_errlst_2)
343 x_code = ((x_code_1++x_code_2)++((:) (C_Div_1 ) ([] )))
344 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp_2 x_env_1 x_fid_1 x_upw_Stats_infun_1
345 (x_code_2 , x_errlst_2 , x_type_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Exp t_Exp_3 x_env_2 x_fid_2 x_upw_Stats_infun_2
346 visit_Exp (C_EqExp_1 t_Exp_2 t_Exp_3 ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
347 where
348 x_upw_Stats_infun_2 = x_upw_Stats_infun
349 x_fid_2 = x_fid
350 x_env_2 = x_env
351 x_upw_Stats_infun_1 = x_upw_Stats_infun
352 x_fid_1 = x_fid
353 x_env_1 = x_env
354 x_uu_pp = (hv x_uu_pp_1 (C_Beside_1 (C_Text_1 " == ") x_uu_pp_2))
355 x_typeerrors = (if (x_type==(C_Errortype_1 )) then ((:) (C_E_T_BOP_1 ) (x_typeerrors_1++x_typeerrors_2)) else (x_typeerrors_1++x_typeerrors_2))
356 x_type = (infType 2 x_type_1 x_type_2)
357 x_errlst = (x_errlst_1++x_errlst_2)
358 x_code = ((x_code_1++x_code_2)++((:) (C_Eq_1 ) ([] )))
359 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp_2 x_env_1 x_fid_1 x_upw_Stats_infun_1
360 (x_code_2 , x_errlst_2 , x_type_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Exp t_Exp_3 x_env_2 x_fid_2 x_upw_Stats_infun_2
361 visit_Exp (C_Factor_1 t_Fac ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
362 where
363 x_upw_Stats_infun_1 = x_upw_Stats_infun
364 x_fid_1 = x_fid
365 x_env_1 = x_env
366 x_uu_pp = x_uu_pp_1
367 x_typeerrors = x_typeerrors_1
368 x_type = x_type_1
369 x_errlst = x_errlst_1
370 x_code = x_code_1
371 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Fac t_Fac x_env_1 x_fid_1 x_upw_Stats_infun_1
372 visit_Exp (C_GTExp_1 t_Exp_2 t_Exp_3 ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
373 where
374 x_upw_Stats_infun_2 = x_upw_Stats_infun
375 x_fid_2 = x_fid
376 x_env_2 = x_env
377 x_upw_Stats_infun_1 = x_upw_Stats_infun
378 x_fid_1 = x_fid
379 x_env_1 = x_env
380 x_uu_pp = (hv x_uu_pp_1 (C_Beside_1 (C_Text_1 " > ") x_uu_pp_2))
381 x_typeerrors = (if (x_type==(C_Errortype_1 )) then ((:) (C_E_T_BOP_1 ) (x_typeerrors_1++x_typeerrors_2)) else (x_typeerrors_1++x_typeerrors_2))
382 x_type = (infType 2 x_type_1 x_type_2)
383 x_errlst = (x_errlst_1++x_errlst_2)
384 x_code = ((x_code_1++x_code_2)++((:) (C_Gt_1 ) ([] )))
385 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp_2 x_env_1 x_fid_1 x_upw_Stats_infun_1
386 (x_code_2 , x_errlst_2 , x_type_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Exp t_Exp_3 x_env_2 x_fid_2 x_upw_Stats_infun_2
387 visit_Exp (C_LTExp_1 t_Exp_2 t_Exp_3 ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
388 where
389 x_upw_Stats_infun_2 = x_upw_Stats_infun
390 x_fid_2 = x_fid
391 x_env_2 = x_env
392 x_upw_Stats_infun_1 = x_upw_Stats_infun
393 x_fid_1 = x_fid
394 x_env_1 = x_env
395 x_uu_pp = (hv x_uu_pp_1 (C_Beside_1 (C_Text_1 " < ") x_uu_pp_2))
396 x_typeerrors = (if (x_type==(C_Errortype_1 )) then ((:) (C_E_T_BOP_1 ) (x_typeerrors_1++x_typeerrors_2)) else (x_typeerrors_1++x_typeerrors_2))
397 x_type = (infType 2 x_type_1 x_type_2)
398 x_errlst = (x_errlst_1++x_errlst_2)
399 x_code = ((x_code_1++x_code_2)++((:) (C_Lt_1 ) ([] )))
400 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp_2 x_env_1 x_fid_1 x_upw_Stats_infun_1
401 (x_code_2 , x_errlst_2 , x_type_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Exp t_Exp_3 x_env_2 x_fid_2 x_upw_Stats_infun_2
402 visit_Exp (C_MinExp_1 t_Exp_2 ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
403 where
404 x_upw_Stats_infun_1 = x_upw_Stats_infun
405 x_fid_1 = x_fid
406 x_env_1 = x_env
407 x_uu_pp = (C_Beside_1 (C_Text_1 " - ") x_uu_pp_1)
408 x_typeerrors = (if (x_type==(C_Errortype_1 )) then ((:) (C_E_T_NotArithExp_1 ) x_typeerrors_1) else x_typeerrors_1)
409 x_type = (if (isaritmexp x_type_1) then x_type_1 else (C_Errortype_1 ))
410 x_errlst = x_errlst_1
411 x_code = (x_code_1++((:) (C_Minus_1 ) ([] )))
412 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp_2 x_env_1 x_fid_1 x_upw_Stats_infun_1
413 visit_Exp (C_MulExp_1 t_Exp_2 t_Exp_3 ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
414 where
415 x_upw_Stats_infun_2 = x_upw_Stats_infun
416 x_fid_2 = x_fid
417 x_env_2 = x_env
418 x_upw_Stats_infun_1 = x_upw_Stats_infun
419 x_fid_1 = x_fid
420 x_env_1 = x_env
421 x_uu_pp = (hv x_uu_pp_1 (C_Beside_1 (C_Text_1 " * ") x_uu_pp_2))
422 x_typeerrors = (if (x_type==(C_Errortype_1 )) then ((:) (C_E_T_BOP_1 ) (x_typeerrors_1++x_typeerrors_2)) else (x_typeerrors_1++x_typeerrors_2))
423 x_type = (infType 1 x_type_1 x_type_2)
424 x_errlst = (x_errlst_1++x_errlst_2)
425 x_code = ((x_code_1++x_code_2)++((:) (C_Mul_1 ) ([] )))
426 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp_2 x_env_1 x_fid_1 x_upw_Stats_infun_1
427 (x_code_2 , x_errlst_2 , x_type_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Exp t_Exp_3 x_env_2 x_fid_2 x_upw_Stats_infun_2
428 visit_Exp (C_NotExp_1 t_Exp_2 ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
429 where
430 x_upw_Stats_infun_1 = x_upw_Stats_infun
431 x_fid_1 = x_fid
432 x_env_1 = x_env
433 x_uu_pp = (C_Beside_1 (C_Text_1 " ! ") x_uu_pp_1)
434 x_typeerrors = (if (x_type==(C_Errortype_1 )) then ((:) (C_E_T_NotBooleanExp_1 ) x_typeerrors_1) else x_typeerrors_1)
435 x_type = (if (isboolexp x_type_1) then x_type_1 else (C_Errortype_1 ))
436 x_errlst = x_errlst_1
437 x_code = (x_code_1++((:) (C_Not_1 ) ([] )))
438 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp_2 x_env_1 x_fid_1 x_upw_Stats_infun_1
439 visit_Exp (C_OrExp_1 t_Exp_2 t_Exp_3 ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
440 where
441 x_upw_Stats_infun_2 = x_upw_Stats_infun
442 x_fid_2 = x_fid
443 x_env_2 = x_env
444 x_upw_Stats_infun_1 = x_upw_Stats_infun
445 x_fid_1 = x_fid
446 x_env_1 = x_env
447 x_uu_pp = (hv x_uu_pp_1 (C_Beside_1 (C_Text_1 " || ") x_uu_pp_2))
448 x_typeerrors = (if (x_type==(C_Errortype_1 )) then ((:) (C_E_T_BOP_1 ) (x_typeerrors_1++x_typeerrors_2)) else (x_typeerrors_1++x_typeerrors_2))
449 x_type = (infType 2 x_type_1 x_type_2)
450 x_errlst = (x_errlst_1++x_errlst_2)
451 x_code = ((x_code_1++x_code_2)++((:) (C_Or_1 ) ([] )))
452 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp_2 x_env_1 x_fid_1 x_upw_Stats_infun_1
453 (x_code_2 , x_errlst_2 , x_type_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Exp t_Exp_3 x_env_2 x_fid_2 x_upw_Stats_infun_2
454 visit_Exp (C_SubExp_1 t_Exp_2 t_Exp_3 ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
455 where
456 x_upw_Stats_infun_2 = x_upw_Stats_infun
457 x_fid_2 = x_fid
458 x_env_2 = x_env
459 x_upw_Stats_infun_1 = x_upw_Stats_infun
460 x_fid_1 = x_fid
461 x_env_1 = x_env
462 x_uu_pp = (hv x_uu_pp_1 (C_Beside_1 (C_Text_1 " - ") x_uu_pp_2))
463 x_typeerrors = (if (x_type==(C_Errortype_1 )) then ((:) (C_E_T_BOP_1 ) (x_typeerrors_1++x_typeerrors_2)) else (x_typeerrors_1++x_typeerrors_2))
464 x_type = (infType 1 x_type_1 x_type_2)
465 x_errlst = (x_errlst_1++x_errlst_2)
466 x_code = ((x_code_1++x_code_2)++((:) (C_Sub_1 ) ([] )))
467 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp_2 x_env_1 x_fid_1 x_upw_Stats_infun_1
468 (x_code_2 , x_errlst_2 , x_type_2 , x_typeerrors_2 , x_uu_pp_2 ) = visit_Exp t_Exp_3 x_env_2 x_fid_2 x_upw_Stats_infun_2
469 visit_Fac (C_ArrayConst_1 t_ArrayUse ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
470 where
471 x_uu_pp = x_uu_pp_1
472 x_typeerrors = x_typeerrors_1
473 x_type = (gettype x_an_1 x_fid x_env)
474 x_errlst = x_errlst_1
475 x_code = x_code_1
476 x_upw_Stats_infun_1 = x_upw_Stats_infun
477 x_fid_1 = x_fid
478 x_env_1 = x_env
479 (x_an_1 , x_code_1 , x_errlst_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_ArrayUse t_ArrayUse x_env_1 x_fid_1 x_upw_Stats_infun_1
480 visit_Fac (C_BoolConst_1 t_BOOL ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
481 where
482 x_uu_pp = (C_Text_1 (if t_BOOL then "true" else "false") )
483 x_typeerrors = ([] )
484 x_type = (C_Booltype_1 )
485 x_errlst = ([] )
486 x_code = ((:) (C_Pushb_1 t_BOOL) ([] ))
487 visit_Fac (C_CNIdent_1 t_Name ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
488 where
489 x_uu_pp = (ppName t_Name)
490 x_typeerrors = ([] )
491 x_type = (gettype t_Name x_fid x_env)
492 x_errlst = (if (isinenv t_Name x_fid x_env) then ([] ) else ((:) (C_E_Name_ND_1 t_Name) ([] )))
493 x_code = ((:) (C_Pusha_1 t_Name x_upw_Stats_infun) ((:) (C_Load_1 ) ([] )))
494 visit_Fac (C_Expr_1 t_Exp ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
495 where
496 x_uu_pp = x_uu_pp_1
497 x_typeerrors = x_typeerrors_1
498 x_type = x_type_1
499 x_errlst = x_errlst_1
500 x_code = x_code_1
501 x_upw_Stats_infun_1 = x_upw_Stats_infun
502 x_fid_1 = x_fid
503 x_env_1 = x_env
504 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp x_env_1 x_fid_1 x_upw_Stats_infun_1
505 visit_Fac (C_Funcinv_1 t_Name t_ActPars ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
506 where
507 x_uu_pp = (funccall (ppName t_Name) x_uu_pp_2)
508 x_typeerrors = (checkactparams t_Name x_act_params_2 x_env)
509 x_type = (gettype t_Name x_fid x_env)
510 x_errlst = (x_error++x_errlst_2)
511 x_code = (gen_code_func_inv t_Name x_env x_code_2)
512 x_upw_Stats_infun_2 = x_upw_Stats_infun
513 x_fid_2 = x_fid
514 x_env_2 = x_env
515 x_noerror = (lrc_map_in t_Name x_env)
516 x_error = (if x_noerror then ([] ) else ((:) (C_E_Fun_ND_1 t_Name) ([] )))
517 (x_act_params_2 , x_code_2 , x_errlst_2 , x_uu_pp_2 ) = visit_ActPars t_ActPars x_env_2 x_fid_2 x_upw_Stats_infun_2
518 visit_Fac (C_IntConst_1 t_INT ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
519 where
520 x_uu_pp = (C_Text_1 (lrc_INTtoSTR t_INT))
521 x_typeerrors = ([] )
522 x_type = (C_Inttype_1 )
523 x_errlst = ([] )
524 x_code = ((:) (C_Pushi_1 t_INT) ([] ))
525 visit_Fac (C_RealConst_1 t_REAL ) x_env x_fid x_upw_Stats_infun = (x_code , x_errlst , x_type , x_typeerrors , x_uu_pp )
526 where
527 x_uu_pp = (C_Text_1 (lrc_REALtoSTR t_REAL))
528 x_typeerrors = ([] )
529 x_type = (C_Realtype_1 )
530 x_errlst = ([] )
531 x_code = ((:) (C_Pushr_1 t_REAL) ([] ))
532 visit_ActPars (C_Emptyactpars_1 ) x_env x_fid x_upw_Stats_infun = (x_act_params , x_code , x_errlst , x_uu_pp )
533 where
534 x_uu_pp = (C_Empty_1 )
535 x_errlst = ([] )
536 x_code = ([] )
537 x_act_params = ([] )
538 visit_ActPars (C_Lstactpars_1 t_Exp t_ActPars_2 ) x_env x_fid x_upw_Stats_infun = (x_act_params , x_code , x_errlst , x_uu_pp )
539 where
540 x_upw_Stats_infun_1 = x_upw_Stats_infun
541 x_fid_1 = x_fid
542 x_env_1 = x_env
543 x_upw_Stats_infun_2 = x_upw_Stats_infun
544 x_fid_2 = x_fid
545 x_env_2 = x_env
546 x_uu_pp = (hv x_uu_pp_1 x_uu_pp_2)
547 x_errlst = (x_errlst_1++x_errlst_2)
548 x_code = ((:) x_code_1 x_code_2)
549 x_act_params = ((:) x_type_1 x_act_params_2)
550 (x_code_1 , x_errlst_1 , x_type_1 , x_typeerrors_1 , x_uu_pp_1 ) = visit_Exp t_Exp x_env_1 x_fid_1 x_upw_Stats_infun_1
551 (x_act_params_2 , x_code_2 , x_errlst_2 , x_uu_pp_2 ) = visit_ActPars t_ActPars_2 x_env_2 x_fid_2 x_upw_Stats_infun_2
552 visit_PPRoot (C_All_1 t_PPS ) x_pw = (x_fmts )
553 where
554 x_frame_1 = (C_F_1 x_pw x_pw)
555 x_fmts = (eq_all_fmts x_pw x_fmts_1)
556 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 ) = visit_PPS t_PPS x_frame_1
557 visit_PPRoot (C_Best_1 t_PPS ) x_pw = (x_fmts )
558 where
559 x_frame_1 = (C_F_1 x_pw x_pw)
560 x_fmts = (eq_best_fmts x_pw x_fmts_1)
561 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 ) = visit_PPS t_PPS x_frame_1
562 visit_PPS :: PPS -> T_Frame -> (Bool, T_Formats, INT, Integer, Integer)
563 visit_PPS (C_Above_1 t_PPS_2 t_PPS_3 ) x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw )
564 where
565 x_frame_2 = x_frame
566 x_frame_1 = x_frame
567 x_minw = (max x_minw_1 x_minw_2)
568 x_minll = x_minll_2
569 x_maxh = (x_maxh_1+x_maxh_2)
570 x_fmts = (fst_Pair_T_Formats x_fe)
571 x_error = ((x_error_1||x_error_2)||x_aerror)
572 x_fe = (set_fmts_above x_fmts_1 x_fmts_2 x_maxh_1 x_maxh_2)
573 x_aerror = (snd_Pair_T_Formats x_fe)
574 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 ) = visit_PPS t_PPS_2 x_frame_1
575 (x_error_2 , x_fmts_2 , x_maxh_2 , x_minll_2 , x_minw_2 ) = visit_PPS t_PPS_3 x_frame_2
576 visit_PPS (C_Apply_1 t_PPC t_PPSArgs ) x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw )
577 where
578 x_reqs_2 = x_reqs_1
579 x_minw = (set_var_apply x_error_cond x_lem x_minw_1)
580 x_minll = (set_var_apply x_error_cond x_lem x_minll_1)
581 x_maxh = (set_var_apply x_error_cond 1 x_maxh_1)
582 x_fmts = (eq_set_fmts_apply x_error_cond x_error_msg x_fmts_1)
583 x_error = x_l_error
584 x_frame_1 = x_frame
585 x_fillmins_1 = x_mins_2
586 x_fillfmts_1 = x_fmts_2
587 x_fillerrs_1 = x_error_2
588 x_lem = (fromIntegral (length x_error_msg))
589 x_l_error = (if x_error_cond then True else x_error_1)
590 x_error_msg = (set_error_msg x_numpars_1 x_len_2)
591 x_error_cond = (x_numpars_1/=x_len_2)
592 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 , x_numpars_1 , x_reqs_1 ) = visit_PPC t_PPC x_fillerrs_1 x_fillfmts_1 x_fillmins_1 x_frame_1
593 (x_error_2 , x_fmts_2 , x_len_2 , x_mins_2 ) = visit_PPSArgs t_PPSArgs x_reqs_2
594 visit_PPS (C_Beside_1 t_PPS_2 t_PPS_3 ) x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw )
595 where
596 x_frame_2 = (narrow_frame x_minll_1 x_frame)
597 x_frame_1 = (narrow_ll x_minw_2 x_frame)
598 x_minw = (max x_minw_1 (x_minll_1+x_minw_2))
599 x_minll = (x_minll_1+x_minll_2)
600 x_maxh = (beside_height x_maxh_1 x_maxh_2)
601 x_fmts = (fst_Pair_T_Formats x_fe)
602 x_error = (x_l_error||x_berror)
603 x_l_error = (x_error_1||x_error_2)
604 x_fe = (set_fmts_beside x_fmts_1 x_fmts_2 x_maxh_1 x_maxh_2 x_frame x_l_error)
605 x_berror = (snd_Pair_T_Formats x_fe)
606 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 ) = visit_PPS t_PPS_2 x_frame_1
607 (x_error_2 , x_fmts_2 , x_maxh_2 , x_minll_2 , x_minw_2 ) = visit_PPS t_PPS_3 x_frame_2
608 visit_PPS (C_Dup_1 t_PPS_2 t_PPS_3 ) x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw )
609 where
610 x_frame_2 = x_frame
611 x_frame_1 = x_frame
612 x_minw = x_l_minw
613 x_minll = (min x_minll_1 x_minll_2)
614 x_maxh = (max x_maxh_1 x_maxh_2)
615 x_fmts = (sem_fmts_dup x_fmts_1 x_fmts_2 x_error_1 x_error_2 x_l_minw)
616 x_error = x_l_error
617 x_l_minw = (min x_minw_1 x_minw_2)
618 x_l_error = (x_error_1 && x_error_2)
619 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 ) = visit_PPS t_PPS_2 x_frame_1
620 (x_error_2 , x_fmts_2 , x_maxh_2 , x_minll_2 , x_minw_2 ) = visit_PPS t_PPS_3 x_frame_2
621 visit_PPS (C_Empty_1 ) x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw )
622 where
623 x_minw = 0
624 x_minll = 0
625 x_maxh = 0
626 x_fmts = (set_fmts_empty )
627 x_error = False
628 visit_PPS (C_FillBlock_1 t_INT t_FillList ) x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw )
629 where
630 x_minw = x_minw_2
631 x_minll = x_minll_2
632 x_maxh = x_maxh_2
633 x_fmts = (set_fmts_fillblock t_INT x_fmts_2 x_l_pw)
634 x_error = (((t_INT<0)||(t_INT>x_l_pw))||x_error_2)
635 x_pw_2 = t_INT
636 x_minwi_2 = 0
637 x_minlli_2 = 0
638 x_maxhi_2 = 0
639 x_frame_2 = (C_F_1 t_INT t_INT)
640 x_fmtsi_2 = (empty_fmts )
641 x_errori_2 = False
642 x_l_pw = case x_frame of { (C_F_1 w _) -> w }
643 (x_error_2 , x_fmts_2 , x_maxh_2 , x_minll_2 , x_minw_2 ) = visit_FillList t_FillList x_errori_2 x_fmtsi_2 x_frame_2 x_maxhi_2 x_minlli_2 x_minwi_2 x_pw_2
644 visit_PPS (C_Filla_1 t_FillList ) x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw )
645 where
646 x_minw = x_minw_1
647 x_minll = x_minll_1
648 x_maxh = x_maxh_1
649 x_fmts = (eq_set_fmts_fill x_fmts_1)
650 x_error = x_error_1
651 x_pw_1 = x_l_pw
652 x_minwi_1 = 0
653 x_minlli_1 = 0
654 x_maxhi_1 = 0
655 x_frame_1 = (C_F_1 x_l_pw x_l_pw)
656 x_fmtsi_1 = (empty_fmts )
657 x_errori_1 = False
658 x_l_pw = case x_frame of { (C_F_1 w _) -> w }
659 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 ) = visit_FillList t_FillList x_errori_1 x_fmtsi_1 x_frame_1 x_maxhi_1 x_minlli_1 x_minwi_1 x_pw_1
660 visit_PPS (C_Indent_1 t_INT t_PPS_2 ) x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw )
661 where
662 x_frame_2 = (narrow_frame t_INT x_frame)
663 x_minw = x_l_minw
664 x_minll = (t_INT+x_minll_2)
665 x_maxh = x_maxh_2
666 x_fmts = (set_fmts_indent t_INT x_fmts_2 x_pw x_l_minw x_frame x_error_2)
667 x_error = (((t_INT<0)||(t_INT>x_pw))||x_error_2)
668 x_pw = case x_frame of { (C_F_1 w _) -> w }
669 x_l_minw = (t_INT+x_minw_2)
670 (x_error_2 , x_fmts_2 , x_maxh_2 , x_minll_2 , x_minw_2 ) = visit_PPS t_PPS_2 x_frame_2
671 visit_PPS (C_Join_1 t_PPS_2 ) x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw )
672 where
673 x_frame_1 = x_frame
674 x_minw = x_minw_1
675 x_minll = x_minll_1
676 x_maxh = x_maxh_1
677 x_fmts = (fst_Pair_T_Formats x_fe)
678 x_error = (x_error_1||x_jerror)
679 x_jerror = (snd_Pair_T_Formats x_fe)
680 x_fe = (set_fmts_join x_fmts_1 x_error_1)
681 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 ) = visit_PPS t_PPS_2 x_frame_1
682 visit_PPS (C_Text_1 t_STR ) x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw )
683 where
684 x_minw = x_l_minw
685 x_minll = x_l_minw
686 x_maxh = 1
687 x_fmts = (set_fmts_text t_STR x_l_minw x_l_error)
688 x_error = x_l_error
689 x_pw = case x_frame of { (C_F_1 w _) -> w }
690 x_l_minw = (fromIntegral (length t_STR))
691 x_l_error = (x_l_minw>x_pw)
692 visit_PPC (C_AboveC_1 t_PPC_2 t_PPC_3 ) x_fillerrs x_fillfmts x_fillmins x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw , x_numpars , x_reqs )
693 where
694 x_frame_2 = x_frame
695 x_fillmins_2 = (snd_Pair_Lst_T_Mins x_i)
696 x_fillfmts_2 = (snd_Pair_Lst_T_Fmts x_m)
697 x_fillerrs_2 = (snd_Pair_Lst_T_Errs x_e)
698 x_frame_1 = x_frame
699 x_fillmins_1 = (fst_Pair_Lst_T_Mins x_i)
700 x_fillfmts_1 = (fst_Pair_Lst_T_Fmts x_m)
701 x_fillerrs_1 = (fst_Pair_Lst_T_Errs x_e)
702 x_reqs = (x_reqs_1++x_reqs_2)
703 x_numpars = (x_numpars_1+x_numpars_2)
704 x_minw = (max x_minw_1 x_minw_2)
705 x_minll = x_minll_2
706 x_maxh = (x_maxh_1+x_maxh_2)
707 x_fmts = (fst_Pair_T_Formats x_fe)
708 x_error = ((x_error_1||x_error_2)||x_aerror)
709 x_m = (splitAt_T_Fmts (fromIntegral x_numpars_1) x_fillfmts)
710 x_i = (splitAt_T_Mins (fromIntegral x_numpars_1) x_fillmins)
711 x_fe = (set_fmts_above x_fmts_1 x_fmts_2 x_maxh_1 x_maxh_2)
712 x_e = (splitAt_T_Errs (fromIntegral x_numpars_1) x_fillerrs)
713 x_aerror = (snd_Pair_T_Formats x_fe)
714 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 , x_numpars_1 , x_reqs_1 ) = visit_PPC t_PPC_2 x_fillerrs_1 x_fillfmts_1 x_fillmins_1 x_frame_1
715 (x_error_2 , x_fmts_2 , x_maxh_2 , x_minll_2 , x_minw_2 , x_numpars_2 , x_reqs_2 ) = visit_PPC t_PPC_3 x_fillerrs_2 x_fillfmts_2 x_fillmins_2 x_frame_2
716 visit_PPC (C_ApplyC_1 t_PPC_2 t_PPCArgs ) x_fillerrs x_fillfmts x_fillmins x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw , x_numpars , x_reqs )
717 where
718 x_ireqs_2 = x_reqs_1
719 x_ifillmins_2 = x_fillmins
720 x_ifillfmts_2 = x_fillfmts
721 x_ifillerrs_2 = x_fillerrs
722 x_frame_1 = x_frame
723 x_fillmins_1 = x_fillmins_2
724 x_fillfmts_1 = x_fmts_2
725 x_fillerrs_1 = x_error_2
726 x_reqs = x_reqs_2
727 x_numpars = x_numpars_2
728 x_minw = (set_var_apply x_error_cond x_lem x_minw_1)
729 x_minll = (set_var_apply x_error_cond x_lem x_minll_1)
730 x_maxh = (set_var_apply x_error_cond 1 x_maxh_1)
731 x_fmts = (eq_set_fmts_apply x_error_cond x_error_msg x_fmts_1)
732 x_error = x_l_error
733 x_lem = (fromIntegral (length x_error_msg))
734 x_l_error = (if x_error_cond then True else x_error_1)
735 x_error_msg = (set_error_msg x_numpars_1 x_len_2)
736 x_error_cond = (x_numpars_2/=x_len_2)
737 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 , x_numpars_1 , x_reqs_1 ) = visit_PPC t_PPC_2 x_fillerrs_1 x_fillfmts_1 x_fillmins_1 x_frame_1
738 (x_error_2 , x_fillmins_2 , x_fmts_2 , x_len_2 , x_numpars_2 , x_reqs_2 ) = visit_PPCArgs t_PPCArgs x_ifillerrs_2 x_ifillfmts_2 x_ifillmins_2 x_ireqs_2
739 visit_PPC (C_BesideC_1 t_PPC_2 t_PPC_3 ) x_fillerrs x_fillfmts x_fillmins x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw , x_numpars , x_reqs )
740 where
741 x_frame_2 = (narrow_frame x_minll_1 x_frame)
742 x_fillmins_2 = (snd_Pair_Lst_T_Mins x_i)
743 x_fillfmts_2 = (snd_Pair_Lst_T_Fmts x_m)
744 x_fillerrs_2 = (snd_Pair_Lst_T_Errs x_e)
745 x_frame_1 = (narrow_ll x_minw_2 x_frame)
746 x_fillmins_1 = (fst_Pair_Lst_T_Mins x_i)
747 x_fillfmts_1 = (fst_Pair_Lst_T_Fmts x_m)
748 x_fillerrs_1 = (fst_Pair_Lst_T_Errs x_e)
749 x_reqs = (x_reqs_1++x_reqs_2)
750 x_numpars = (x_numpars_1+x_numpars_2)
751 x_minw = (max x_minw_1 (x_minll_1+x_minw_2))
752 x_minll = (x_minll_1+x_minll_2)
753 x_maxh = (beside_height x_maxh_1 x_maxh_2)
754 x_fmts = (fst_Pair_T_Formats x_fe)
755 x_error = (x_l_error||x_berror)
756 x_m = (splitAt_T_Fmts (fromIntegral x_numpars_1) x_fillfmts)
757 x_l_error = (x_error_1||x_error_2)
758 x_i = (splitAt_T_Mins (fromIntegral x_numpars_1) x_fillmins)
759 x_fe = (set_fmts_beside x_fmts_1 x_fmts_2 x_maxh_1 x_maxh_2 x_frame x_l_error)
760 x_e = (splitAt_T_Errs (fromIntegral x_numpars_1) x_fillerrs)
761 x_berror = (snd_Pair_T_Formats x_fe)
762 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 , x_numpars_1 , x_reqs_1 ) = visit_PPC t_PPC_2 x_fillerrs_1 x_fillfmts_1 x_fillmins_1 x_frame_1
763 (x_error_2 , x_fmts_2 , x_maxh_2 , x_minll_2 , x_minw_2 , x_numpars_2 , x_reqs_2 ) = visit_PPC t_PPC_3 x_fillerrs_2 x_fillfmts_2 x_fillmins_2 x_frame_2
764 visit_PPC (C_DupC_1 t_PPC_2 t_PPC_3 ) x_fillerrs x_fillfmts x_fillmins x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw , x_numpars , x_reqs )
765 where
766 x_frame_2 = x_frame
767 x_fillmins_2 = x_fillmins
768 x_fillfmts_2 = x_fillfmts
769 x_fillerrs_2 = x_fillerrs
770 x_frame_1 = x_frame
771 x_fillmins_1 = x_fillmins
772 x_fillfmts_1 = x_fillfmts
773 x_fillerrs_1 = x_fillerrs
774 x_reqs = (eq_DupC x_reqs_1 x_reqs_2)
775 x_numpars = x_numpars_1
776 x_minw = x_l_minw
777 x_minll = (min x_minll_1 x_minll_2)
778 x_maxh = (max x_maxh_1 x_maxh_2)
779 x_fmts = (sem_fmts_cdup x_fmts_1 x_fmts_2 x_error_1 x_error_2 x_numpars_1 x_numpars_2 x_l_minw x_error_msg)
780 x_error = x_l_error
781 x_l_minw = (min x_minw_1 x_minw_2)
782 x_l_error = ((x_numpars_1/=x_numpars_2)||(x_error_1 && x_error_2))
783 x_error_msg = (eq_set_error_msg x_numpars_1 x_numpars_2)
784 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 , x_numpars_1 , x_reqs_1 ) = visit_PPC t_PPC_2 x_fillerrs_1 x_fillfmts_1 x_fillmins_1 x_frame_1
785 (x_error_2 , x_fmts_2 , x_maxh_2 , x_minll_2 , x_minw_2 , x_numpars_2 , x_reqs_2 ) = visit_PPC t_PPC_3 x_fillerrs_2 x_fillfmts_2 x_fillmins_2 x_frame_2
786 visit_PPC (C_IndentC_1 t_INT t_PPC_2 ) x_fillerrs x_fillfmts x_fillmins x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw , x_numpars , x_reqs )
787 where
788 x_frame_2 = (narrow_frame t_INT x_frame)
789 x_fillmins_2 = x_fillmins
790 x_fillfmts_2 = x_fillfmts
791 x_fillerrs_2 = x_fillerrs
792 x_reqs = x_reqs_2
793 x_numpars = x_numpars_2
794 x_minw = x_l_minw
795 x_minll = (t_INT+x_minll_2)
796 x_maxh = x_maxh_2
797 x_fmts = (set_fmts_indent t_INT x_fmts_2 x_pw x_l_minw x_frame x_error_2)
798 x_error = (((t_INT<0)||(t_INT>x_pw))||x_error_2)
799 x_pw = case x_frame of { (C_F_1 w _) -> w }
800 x_l_minw = (t_INT+x_minw_2)
801 (x_error_2 , x_fmts_2 , x_maxh_2 , x_minll_2 , x_minw_2 , x_numpars_2 , x_reqs_2 ) = visit_PPC t_PPC_2 x_fillerrs_2 x_fillfmts_2 x_fillmins_2 x_frame_2
802 visit_PPC (C_JoinC_1 t_PPC_2 ) x_fillerrs x_fillfmts x_fillmins x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw , x_numpars , x_reqs )
803 where
804 x_frame_1 = x_frame
805 x_fillmins_1 = x_fillmins
806 x_fillfmts_1 = x_fillfmts
807 x_fillerrs_1 = x_fillerrs
808 x_reqs = x_reqs_1
809 x_numpars = x_numpars_1
810 x_minw = x_minw_1
811 x_minll = x_minll_1
812 x_maxh = x_maxh_1
813 x_fmts = (fst_Pair_T_Formats x_fe)
814 x_error = (x_error_1||x_jerror)
815 x_jerror = (snd_Pair_T_Formats x_fe)
816 x_fe = (set_fmts_join x_fmts_1 x_error_1)
817 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 , x_numpars_1 , x_reqs_1 ) = visit_PPC t_PPC_2 x_fillerrs_1 x_fillfmts_1 x_fillmins_1 x_frame_1
818 visit_PPC (C_ParC_1 ) x_fillerrs x_fillfmts x_fillmins x_frame = (x_error , x_fmts , x_maxh , x_minll , x_minw , x_numpars , x_reqs )
819 where
820 x_reqs = ((:) x_frame ([] ))
821 x_numpars = 1
822 x_minw = (fst_t x_l_m)
823 x_minll = (snd_t x_l_m)
824 x_maxh = (third_t x_l_m)
825 x_fmts = (head_T_Fmts x_fillfmts)
826 x_error = x_l_error
827 x_l_m = (head_T_Mins x_fillmins)
828 x_l_error = (head_T_Errs x_fillerrs)
829 visit_PPCArgs (C_ConsPPCArgs_1 t_PPC t_PPCArgs_2 ) x_ifillerrs x_ifillfmts x_ifillmins x_ireqs = (x_error , x_fillmins , x_fmts , x_len , x_numpars , x_reqs )
830 where
831 x_ireqs_2 = (tail_T_Reqs x_ireqs)
832 x_ifillmins_2 = (snd_Pair_Lst_T_Mins x_i)
833 x_ifillfmts_2 = (snd_Pair_Lst_T_Fmts x_m)
834 x_ifillerrs_2 = (snd_Pair_Lst_T_Errs x_e)
835 x_reqs = (x_reqs_1++x_reqs_2)
836 x_numpars = (x_numpars_1+x_numpars_2)
837 x_len = (x_len_2+1)
838 x_fmts = ((:) x_fmts_1 x_fmts_2)
839 x_fillmins = ((:) (C_Triple_1 x_minw_1 x_minll_1 x_maxh_1) x_fillmins_2)
840 x_error = ((:) x_error_1 x_error_2)
841 x_frame_1 = (head_T_Reqs x_ireqs)
842 x_fillmins_1 = (fst_Pair_Lst_T_Mins x_i)
843 x_fillfmts_1 = (fst_Pair_Lst_T_Fmts x_m)
844 x_fillerrs_1 = (fst_Pair_Lst_T_Errs x_e)
845 x_m = (splitAt_T_Fmts (fromIntegral x_numpars_1) x_ifillfmts)
846 x_i = (splitAt_T_Mins (fromIntegral x_numpars_1) x_ifillmins)
847 x_e = (splitAt_T_Errs (fromIntegral x_numpars_1) x_ifillerrs)
848 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 , x_numpars_1 , x_reqs_1 ) = visit_PPC t_PPC x_fillerrs_1 x_fillfmts_1 x_fillmins_1 x_frame_1
849 (x_error_2 , x_fillmins_2 , x_fmts_2 , x_len_2 , x_numpars_2 , x_reqs_2 ) = visit_PPCArgs t_PPCArgs_2 x_ifillerrs_2 x_ifillfmts_2 x_ifillmins_2 x_ireqs_2
850 visit_PPCArgs (C_NilPPCArgs_1 ) x_ifillerrs x_ifillfmts x_ifillmins x_ireqs = (x_error , x_fillmins , x_fmts , x_len , x_numpars , x_reqs )
851 where
852 x_reqs = ([] )
853 x_numpars = 0
854 x_len = 0
855 x_fmts = ([] )
856 x_fillmins = ([] )
857 x_error = ([] )
858
859
860 visit_PPSArgs :: PPSArgs -> [T_Frame] -> (T_Errs, T_Fmts, Integer, T_Mins)
861 -- This function's most general type is
862 -- visit_PPSArgs :: forall a. (Integral a, Show a)
863 -- => PPSArgs -> [T_Frame] -> (T_Errs, T_Fmts, a, T_Mins)
864 -- But in the same mutually recusive group is visit_PPS whose type becomes
865 -- visit_PPS :: forall a. (Integral a, Show a)
866 -- => PPS -> T_Frame -> (Bool, T_Formats, INT, INT, INT)
867 -- which GHC now (rightfully) rejects that as ambiguous, even though
868 -- acutally default resolution will allow it at call sites,
869 -- So I've added a type signature
870 -- SLPJ July 2012
871
872 visit_PPSArgs (C_ConsArgs_1 t_PPS t_PPSArgs_2 ) x_reqs = (x_error , x_fmts , x_len , x_mins )
873 where
874 x_reqs_2 = (tail_T_Reqs x_reqs)
875 x_mins = ((:) (C_Triple_1 x_minw_1 x_minll_1 x_maxh_1) x_mins_2)
876 x_len = (x_len_2+1)
877 x_fmts = ((:) x_fmts_1 x_fmts_2)
878 x_error = ((:) x_error_1 x_error_2)
879 x_frame_1 = (head_T_Reqs x_reqs)
880 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 ) = visit_PPS t_PPS x_frame_1
881 (x_error_2 , x_fmts_2 , x_len_2 , x_mins_2 ) = visit_PPSArgs t_PPSArgs_2 x_reqs_2
882 visit_PPSArgs (C_NilArgs_1 ) x_reqs = (x_error , x_fmts , x_len , x_mins )
883 where
884 x_mins = ([] )
885 x_len = 0
886 x_fmts = ([] )
887 x_error = ([] )
888 visit_FillList (C_ConsFillList_1 t_PPS t_FillList_2 ) x_errori x_fmtsi x_frame x_maxhi x_minlli x_minwi x_pw = (x_error , x_fmts , x_maxh , x_minll , x_minw )
889 where
890 x_frame_1 = x_frame
891 x_pw_2 = x_pw
892 x_minwi_2 = x_minwi
893 x_minlli_2 = ((x_minlli+x_minwi)+x_minw_1)
894 x_maxhi_2 = (cons_height x_maxh_1 x_maxhi True)
895 x_frame_2 = x_frame
896 x_fmtsi_2 = (fst_Pair_Formats x_fe)
897 x_errori_2 = (x_errori||x_ferror)
898 x_minw = x_minw_2
899 x_minll = x_minll_2
900 x_maxh = x_maxh_2
901 x_fmts = x_fmts_2
902 x_error = (x_error_2||x_error_1)
903 x_newll = (x_minlli+x_minw_1)
904 x_ferror = (snd_Pair_Formats x_fe)
905 x_fe = (set_fmts_filllist x_fmtsi x_fmts_1 x_maxhi x_maxh_1 x_frame x_avail)
906 x_avail = ((x_pw-x_newll)>=0)
907 (x_error_1 , x_fmts_1 , x_maxh_1 , x_minll_1 , x_minw_1 ) = visit_PPS t_PPS x_frame_1
908 (x_error_2 , x_fmts_2 , x_maxh_2 , x_minll_2 , x_minw_2 ) = visit_FillList t_FillList_2 x_errori_2 x_fmtsi_2 x_frame_2 x_maxhi_2 x_minlli_2 x_minwi_2 x_pw_2
909 visit_FillList (C_NilFillList_1 ) x_errori x_fmtsi x_frame x_maxhi x_minlli x_minwi x_pw = (x_error , x_fmts , x_maxh , x_minll , x_minw )
910 where
911 x_minw = x_minwi
912 x_minll = x_minlli
913 x_maxh = x_maxhi
914 x_fmts = x_fmtsi
915 x_error = x_errori
916 above_fmt u l =
917 case u of { (C_Elem_1 uh ul uw ut) -> case l of { (C_Elem_1 lh ll lw lt) -> (C_Elem_1 (uh+lh) ll (max uw lw) (ut++lt)) } }
918 above_fmts u l =
919 case u of { ( [] ) -> ([] ) ; ( (:) u2 us ) -> case l of { ( [] ) -> ([] ) ; ( (:) l2 ls ) -> let { (utw) = (total_w u2) ; (ltw) = (total_w l2) ; (fe) = (above_fmt u2 l2) } in (if (utw>=ltw) then ((:) fe (above_fmts us l)) else ((:) fe (above_fmts u ls))) } }
920 actformparams actparams lfps =
921 case actparams of { ( (:) t1 ts ) -> case lfps of { ( (:) p ls ) -> case p of { (C_AParam_1 t2 n) -> (if (t1==t2) then (actformparams ts ls) else ((:) (C_E_T_ActParam_1 ) (actformparams ts ls))) } ; ( [] ) -> ((:) (C_E_T_ActParam_1 ) ([] )) } ; ( [] ) -> case lfps of { ( (:) p ls ) -> ((:) (C_E_T_ActParam_1 ) ([] )) ; ( [] ) -> ([] ) } }
922 add_glue i ls =
923 case ls of { ( [] ) -> ([] ) ; ( (:) s ss ) -> ((:) ((repeatCHAR ' ' i)++s) (add_glue i ss)) }
924 afmt_txt string =
925 (C_AFormat_1 (text_fmts string))
926 allf fs =
927 case fs of { ( [] ) -> "" ; ( (:) f fs2 ) -> ((txtstr f 0 "\n\n")++(best fs2)) }
928 assign_InfType n exptype fid env =
929 let { (desttype) = (gettype n fid env) } in (if ((coersibleTypes desttype exptype)==(C_Errortype_1 )) then (C_E_T_NC_1 desttype exptype) else (C_NoTypeError_1 ))
930 asts i =
931 (if (i==0) then "" else (if (i==1) then "*" else ((":"++(repeatCHAR '*' (fromIntegral (i-2))))++"*>")) )
932 beside_fmt l r =
933 case l of { (C_Elem_1 lh ll lw lt) -> case r of { (C_Elem_1 rh rl rw rt) -> (C_Elem_1 ((lh+rh)-1) (ll+rl) (max lw (ll+rw)) (join ll lt rt)) } }
934 beside_fmts f l r =
935 case f of { (C_F_1 pw _) -> (foldLeft pw l r) }
936 beside_height lh rh =
937 (if ((lh==0)||(rh==0)) then 0 else 1)
938 best fs =
939 case fs of { ( [] ) -> "" ; ( (:) f fs2 ) -> (txtstr f 0 "") }
940 blockStats sts =
941 (C_Above_1 (C_Beside_1 (C_Text_1 "{") (C_Indent_1 2 sts)) (C_Text_1 "}"))
942 checkactparams s actpars env =
943 case (lrc_map_application s env) of { (C_Consfunc_1 t i lfp) -> (actformparams actpars lfp) ; _ -> ([] ) }
944 choose_ab_beside_fmts avail fa fb f =
945 (if avail then (beside_fmts f fa fb) else (above_fmts fa fb))
946 choose_ab_error_beside avail fa fb f =
947 (if avail then (error_beside fa fb) else (above_fmts fa fb))
948 coersibleTypes t1 t2 =
949 (if (t1==t2) then t1 else case t1 of { (C_Realtype_1 ) -> case t2 of { (C_Inttype_1 ) -> t1 ; _ -> (C_Errortype_1 ) } ; _ -> (C_Errortype_1 ) } )
950 cons_height pph acth avail =
951 (if (acth==0) then (if (pph>0) then 1 else 0) else (acth+(if avail then 0 else 1) ))
952 dispf fs =
953 case fs of { ( [] ) -> "" ; ( (:) f fs2 ) -> (txtstr f 0 "") }
954 dropWhileFormatsNotFit i fs =
955 case fs of { ( [] ) -> ([] ) ; ( (:) f fs2 ) -> (if (notFits i f) then (dropWhileFormatsNotFit i fs2) else fs) }
956 dropWhileFormatsTooWide i l r =
957 case r of { ( [] ) -> ([] ) ; ( (:) f fs ) -> (if (tooWide i l f) then (dropWhileFormatsTooWide i l fs) else r) }
958 empty_fmts =
959 ([] )
960 enclosedBy o b c =
961 (C_Beside_1 (C_Text_1 o) (C_Beside_1 b (C_Text_1 c)))
962 eq_DupC r1 r2 =
963 (zipwith_max r1 r2)
964 eq_all_fmts pw fmts =
965 (allf (set_fmts_render pw fmts))
966 eq_best_fmts pw fmts =
967 (best (set_fmts_render pw fmts))
968 eq_disp pw fmts =
969 (dispf (set_fmts_render pw fmts))
970 eq_set_error_msg apars bpars =
971 (((("<Error: incorrect choice expression. #pars left "++(lrc_INTtoSTR apars))++" /= #pars right ")++(lrc_INTtoSTR bpars))++">")
972 eq_set_fmts_apply error msg fmts =
973 (set_fmts_apply error (C_AFormat_1 (text_fmts msg)) fmts)
974 eq_set_fmts_fill fmts =
975 (C_AFormat_1 fmts)
976 error_beside fs1 fs2 =
977 ([] )
978 error_indent i fs =
979 (map_indent_fmt i fs)
980 foldLeft pw l r =
981 case l of { ( [] ) -> ([] ) ; ( (:) f fs ) -> (map_With_fmts f (dropWhileFormatsTooWide pw f r)) }
982 fst_Pair_Formats f =
983 case f of { (C_C_Pair_Formats_1 a b) -> a }
984 fst_Pair_Lst_T_Errs t =
985 case t of { (C_CPair_Lst_T_Errs_1 a _) -> a }
986 fst_Pair_Lst_T_Fmts t =
987 case t of { (C_CPair_Lst_T_Fmts_1 a _) -> a }
988 fst_Pair_Lst_T_Mins t =
989 case t of { (C_CPair_Lst_T_Mins_1 a _) -> a }
990 fst_Pair_T_Formats f =
991 case f of { (C_C_Pair_T_Formats_1 a b) -> a }
992 fst_t t =
993 case t of { (C_Triple_1 pw _ _) -> pw }
994 func_def_a_la_c ty name formpars body =
995 (C_Above_1 (C_Beside_1 name (C_Beside_1 (C_Text_1 "(") (C_Beside_1 formpars (C_Beside_1 (C_Text_1 ") : ") ty)))) (blockStats body))
996 funccall name pars =
997 (C_Beside_1 name (enclosedBy "(" pars ")"))
998 genCodeMainFun =
999 ((:) (C_Call_1 (C_Ident_1 "main")) ((:) (C_Halt_1 ) ([] )))
1000 genCodeParamsFunc i lsttp cap =
1001 case lsttp of { ( [] ) -> ([] ) ; ( (:) fp fps ) -> case cap of { ( [] ) -> ([] ) ; ( (:) c cs ) -> case fp of { (C_AParam_1 t n) -> (((:) (C_Pusha_1 n i) c)++((:) (C_Store_1 ) (genCodeParamsFunc i fps cs))) } } }
1002 gen_code_func nf lst =
1003 case lst of { ( [] ) -> ([] ) ; ( (:) apar ls ) -> case apar of { (C_AParam_1 t n) -> ((:) (C_Var_1 n nf t) (gen_code_func nf ls)) } }
1004 gen_code_func_inv fn env cap =
1005 case (lrc_map_application fn env) of { (C_Consfunc_1 t i lstp) -> ((genCodeParamsFunc i lstp cap)++((:) (C_Call_1 fn) ([] ))) ; _ -> ([] ) }
1006 gen_code_ite i e c1 c2 =
1007 (((e++((:) (C_Jumpf_1 (C_Ident_1 ("else_"++(lrc_INTtoSTR i)))) c1))++((:) (C_Jumpf_1 (C_Ident_1 ("end_if_"++(lrc_INTtoSTR i)))) ((:) (C_ALabel_1 (C_Ident_1 ("else_"++(lrc_INTtoSTR i)))) c2)))++((:) (C_ALabel_1 (C_Ident_1 ("end_if_"++(lrc_INTtoSTR i)))) ([] )))
1008 gen_code_while i e c1 =
1009 ((((:) (C_ALabel_1 (C_Ident_1 ("while_"++(lrc_INTtoSTR i)))) e)++((:) (C_Jumpf_1 (C_Ident_1 ("end_while_"++(lrc_INTtoSTR i)))) c1))++((:) (C_Jump_1 (C_Ident_1 ("while_"++(lrc_INTtoSTR i)))) ((:) (C_ALabel_1 (C_Ident_1 ("end_while_"++(lrc_INTtoSTR i)))) ([] ))))
1010 gen_data_mem e =
1011 ([] )
1012 get_fmts fs =
1013 case fs of { (C_AFormat_1 a) -> a ; (C_TFormats_1 _ _ _ _) -> (text_fmts "<Error: can\'t dup a dup") }
1014 gettype id fid env =
1015 case (lrc_map_application id env) of { (C_Consvar_1 t i) -> t ; (C_Consarray_1 t i i2) -> t ; (C_Consfunc_1 t i l) -> t ; _ -> case (lrc_map_application fid env) of { (C_Consfunc_1 t i lstp) -> (gettypefp id lstp) ; _ -> (C_Errortype_1 ) } }
1016 gettypefp id lstfp =
1017 case lstfp of { ( (:) p ls ) -> case p of { (C_AParam_1 t n) -> (if (id==n) then t else (gettypefp id ls)) } ; ( [] ) -> (C_Errortype_1 ) }
1018 head_T_Errs t =
1019 case t of { ( (:) s _ ) -> s }
1020 head_T_Fmts t =
1021 case t of { ( (:) s _ ) -> s }
1022 head_T_Mins t =
1023 case t of { ( (:) s _ ) -> s }
1024 head_T_Reqs t =
1025 case t of { ( (:) f _ ) -> f }
1026 hv a b =
1027 (C_Join_1 (C_Dup_1 (C_Beside_1 a b) (C_Above_1 a b)))
1028 hvc a b =
1029 (C_DupC_1 (C_BesideC_1 a b) (C_AboveC_1 a b))
1030 if_t_ePP exp stats1 stats2 =
1031 (hv (hv (hv (C_Text_1 "if") (C_Beside_1 (C_Text_1 "(") (C_Beside_1 exp (C_Text_1 ")")))) (hv (C_Text_1 "then") (blockStats stats1))) (hv (C_Text_1 "else") (blockStats stats2)))
1032 indent_fmt i f =
1033 case f of { (C_Elem_1 dh dl dw dt) -> (C_Elem_1 dh (i+dl) (i+dw) (add_glue i dt)) }
1034 indent_fmts f i fs =
1035 case f of { (C_F_1 pw _) -> (map_indent_fmt i (dropWhileFormatsNotFit (pw-i) fs)) }
1036 infType op t1 t2 =
1037 case op of { 1 -> (coersibleTypes t1 t2) ; 2 -> (if (t1==t2) then (C_Booltype_1 ) else (C_Errortype_1 )) ; _ -> (C_Errortype_1 ) }
1038 initLst_Str l =
1039 case l of { ( [] ) -> ([] ) ; ( (:) x ( [] ) ) -> ([] ) ; ( (:) x ls ) -> ((:) x (initLst_Str ls)) }
1040 isaritmexp t =
1041 case t of { (C_Inttype_1 ) -> True ; _ -> False }
1042 isboolexp t =
1043 case t of { (C_Booltype_1 ) -> True ; _ -> False }
1044 isinenv n fid env =
1045 (if (lrc_map_in n env) then True else case (lrc_map_application fid env) of { (C_Consfunc_1 t i lstp) -> (isinlst n lstp) ; _ -> False } )
1046 isinlst n l =
1047 case l of { ( [] ) -> False ; ( (:) apar ls ) -> case apar of { (C_AParam_1 t n2) -> (if (n==n2) then True else (isinlst n ls)) } }
1048 isinttype t =
1049 case t of { (C_Inttype_1 ) -> True ; _ -> False }
1050 join i lt rt =
1051 case rt of { ( [] ) -> lt ; ( (:) x rt2 ) -> (((initLst_Str lt)++((:) ((lastLst_Str lt)++x) ([] )))++(add_glue i rt2)) }
1052 lastLst_Str l =
1053 case l of { ( (:) x ( [] ) ) -> x ; ( (:) _ ls ) -> (lastLst_Str ls) }
1054 last_w f =
1055 case f of { (C_Elem_1 _ pll _ _) -> pll }
1056 map_With_fmts f fs =
1057 case fs of { ( [] ) -> ([] ) ; ( (:) f2 fs2 ) -> ((:) (beside_fmt f f2) (map_With_fmts f fs2)) }
1058 map_indent_fmt i fs =
1059 case fs of { ( [] ) -> ([] ) ; ( (:) f fs2 ) -> ((:) (indent_fmt i f) (map_indent_fmt i fs2)) }
1060 max_T_Frame a b =
1061 case a of { (C_F_1 w _) -> case b of { (C_F_1 z _) -> (if (w>z) then a else b) } }
1062 merge xs ys =
1063 case xs of { ( [] ) -> ys ; ( (:) x xs2 ) -> case ys of { ( [] ) -> xs ; ( (:) y ys2 ) -> (if (x==y) then ((:) x (merge xs2 ys2)) else (if (x<y) then ((:) x (merge xs2 ys)) else ((:) y (merge xs ys2))) ) } }
1064 nametoSTR n =
1065 case n of { (C_Ident_1 s) -> s }
1066 narrow_frame i f =
1067 case f of { (C_F_1 s l) -> (C_F_1 (s-i) (l-i)) }
1068 narrow_ll i f =
1069 case f of { (C_F_1 s l) -> (C_F_1 s (l-i)) }
1070 newlines ls =
1071 case ls of { ( (:) x ( [] ) ) -> x ; ( (:) x xs ) -> ((x++"\n")++(newlines xs)) }
1072 notFits delta f =
1073 case f of { (C_Elem_1 _ _ dw _) -> (dw>delta) }
1074 nullFormats fs =
1075 case fs of { ( [] ) -> True ; _ -> False }
1076 ppName n =
1077 case n of { (C_Ident_1 s) -> (C_Text_1 s) }
1078 ppType t =
1079 case t of { (C_Inttype_1 ) -> (C_Text_1 "Int") ; (C_Realtype_1 ) -> (C_Text_1 "Real") ; (C_Booltype_1 ) -> (C_Text_1 "Bool") ; (C_Chartype_1 ) -> (C_Text_1 "Char") ; (C_Errortype_1 ) -> (C_Text_1 "Error??") }
1080 s2fmt s = let { (l) = (fromIntegral (length s)) } in (C_Elem_1 1 l l ((:) s ([] )))
1081 sem_fmts_cdup a b ae be anpars bnpars min_w mesg =
1082 (if (anpars/=bnpars) then (afmt_txt mesg) else (sem_fmts_dup a b ae be min_w))
1083 sem_fmts_dup afs bfs ae be minw =
1084 (if (ae && be) then (afmt_txt (asts minw)) else (C_TFormats_1 (get_fmts afs) (get_fmts bfs) ae be))
1085 set_error_msg numpars len =
1086 (((("<Error: incorrect apply expression. #pars "++(lrc_INTtoSTR numpars))++" /= #args ")++(lrc_INTtoSTR len))++">")
1087 set_fmts_ab_above fs gs uh lh etxt =
1088 case fs of { (C_AFormat_1 ffmts) -> case gs of { (C_AFormat_1 gfmts) -> (C_C_Pair_T_Formats_1 (C_AFormat_1 (set_fmts_abovea ffmts gfmts uh lh)) False) ; (C_TFormats_1 a bs ae be) -> (C_C_Pair_T_Formats_1 (C_TFormats_1 (set_fmts_abovea ffmts a uh lh) (set_fmts_abovea ffmts bs uh lh) ae be) False) } ; (C_TFormats_1 a bs ae be) -> case gs of { (C_AFormat_1 gfmts) -> (C_C_Pair_T_Formats_1 (C_TFormats_1 (set_fmts_abovea a gfmts uh lh) (set_fmts_abovea bs gfmts uh lh) ae be) False) ; _ -> (C_C_Pair_T_Formats_1 (afmt_txt etxt) True) } }
1089 set_fmts_ab_beside fs gs uh lh frame error etxt =
1090 case fs of { (C_AFormat_1 ffmts) -> case gs of { (C_AFormat_1 gfmts) -> (C_C_Pair_T_Formats_1 (C_AFormat_1 (set_fmts_besidea ffmts gfmts uh lh frame error)) False) ; (C_TFormats_1 a bs ae be) -> (C_C_Pair_T_Formats_1 (C_TFormats_1 (set_fmts_besidea ffmts a uh lh frame error) (set_fmts_besidea ffmts bs uh lh frame error) ae be) False) } ; (C_TFormats_1 a bs ae be) -> case gs of { (C_AFormat_1 gfmts) -> (C_C_Pair_T_Formats_1 (C_TFormats_1 (set_fmts_besidea a gfmts uh lh frame error) (set_fmts_besidea bs gfmts uh lh frame error) ae be) False) ; _ -> (C_C_Pair_T_Formats_1 (afmt_txt etxt) True) } }
1091 set_fmts_above us ls uh lh =
1092 (set_fmts_ab_above us ls uh lh "<Error: can\'t above two pairs")
1093 set_fmts_abovea a bs uh lh =
1094 (if (uh==0) then bs else (if (lh==0) then a else (above_fmts a bs)) )
1095 set_fmts_apply error msg fmts =
1096 (if error then msg else fmts)
1097 set_fmts_beside ls rs lh rh frame error =
1098 (set_fmts_ab_beside ls rs lh rh frame error "<Error: can\'t beside two pairs")
1099 set_fmts_besidea ls rs lh rh frame error =
1100 (if (lh==0) then rs else (if (rh==0) then ls else (if error then (error_beside ls rs) else (beside_fmts frame ls rs)) ) )
1101 set_fmts_empty =
1102 (C_AFormat_1 (empty_fmts ))
1103 set_fmts_fillblock i fmts w =
1104 (if (i<0) then (afmt_txt "<Error: negative page width in fillblock>") else (if (i>w) then (afmt_txt (asts i)) else (C_AFormat_1 fmts)) )
1105 set_fmts_filllist af bf ah bh f avail =
1106 case bf of { (C_AFormat_1 ns) -> (if (ah==0) then (C_C_Pair_Formats_1 ns False) else (if (bh==0) then (C_C_Pair_Formats_1 af False) else (if (bh<=1) then (C_C_Pair_Formats_1 (choose_ab_beside_fmts avail af ns f) False) else (C_C_Pair_Formats_1 (choose_ab_error_beside avail af (text_fmts "<Error: element in fill higher than 1>") f) True)) ) ) ; _ -> (C_C_Pair_Formats_1 (set_fmts_filllista (text_fmts "<Error: element in fill list is a pair>") af ah bh avail f) True) }
1107 set_fmts_filllista fs afmts ah nh avail f =
1108 (if (ah==0) then afmts else (if (nh==0) then fs else (choose_ab_error_beside avail fs afmts f)) )
1109 set_fmts_indent i f pw minw frame error =
1110 (if (i<0) then (afmt_txt "<Error: negative indentation>") else (if (i>pw) then (afmt_txt (asts minw)) else (if error then (set_fmts_indent_error_indent i f) else (set_fmts_indent_indent_fmts i f frame)) ) )
1111 set_fmts_indent_error_indent i fmts =
1112 case fmts of { (C_AFormat_1 fs) -> (C_AFormat_1 (error_indent i fs)) ; (C_TFormats_1 a bs ae be) -> (C_TFormats_1 (error_indent i a) (error_indent i bs) ae be) }
1113 set_fmts_indent_indent_fmts i fmts frame =
1114 case fmts of { (C_AFormat_1 fs) -> (C_AFormat_1 (indent_fmts frame i fs)) ; (C_TFormats_1 a bs ae be) -> (C_TFormats_1 (indent_fmts frame i a) (indent_fmts frame i bs) ae be) }
1115 set_fmts_join fs err =
1116 case fs of { (C_AFormat_1 f) -> (if err then (C_C_Pair_T_Formats_1 fs err) else (C_C_Pair_T_Formats_1 (afmt_txt "<Error: can\'t join a single result>") True)) ; (C_TFormats_1 a bs ae be) -> let { (aa) = (if be then (if (nullFormats a) then bs else a) else (if ae then (if (nullFormats bs) then a else bs) else (merge a bs)) ) } in (C_C_Pair_T_Formats_1 (C_AFormat_1 aa) False) }
1117 set_fmts_render pw fmts =
1118 (if (pw<0) then (text_fmts "<Error: negative page width >") else case fmts of { (C_AFormat_1 fmt) -> fmt ; _ -> (text_fmts "<Error: can\'t render a pair>") } )
1119 set_fmts_text string minw error =
1120 (afmt_txt (if error then (asts minw) else string) )
1121 set_var_apply error lem min =
1122 (if error then lem else min)
1123 snd_Pair_Formats f =
1124 case f of { (C_C_Pair_Formats_1 a b) -> b }
1125 snd_Pair_Lst_T_Errs t =
1126 case t of { (C_CPair_Lst_T_Errs_1 _ a) -> a }
1127 snd_Pair_Lst_T_Fmts t =
1128 case t of { (C_CPair_Lst_T_Fmts_1 _ a) -> a }
1129 snd_Pair_Lst_T_Mins t =
1130 case t of { (C_CPair_Lst_T_Mins_1 _ a) -> a }
1131 snd_Pair_T_Formats f =
1132 case f of { (C_C_Pair_T_Formats_1 a b) -> b }
1133 snd_t t =
1134 case t of { (C_Triple_1 _ pll _) -> pll }
1135 splitAt_T_Errs i tm =
1136 (if (i<=0) then (C_CPair_Lst_T_Errs_1 ([] ) tm) else case tm of { ( [] ) -> (C_CPair_Lst_T_Errs_1 ([] ) ([] )) ; ( (:) x xs ) -> let { (a) = (splitAt_T_Errs (i-1) xs) ; (xs2) = (fst_Pair_Lst_T_Errs a) ; (xs22) = (snd_Pair_Lst_T_Errs a) } in (C_CPair_Lst_T_Errs_1 ((:) x xs2) xs22) } )
1137 splitAt_T_Fmts i tm =
1138 (if (i<=0) then (C_CPair_Lst_T_Fmts_1 ([] ) tm) else case tm of { ( [] ) -> (C_CPair_Lst_T_Fmts_1 ([] ) ([] )) ; ( (:) x xs ) -> let { (a) = (splitAt_T_Fmts (i-1) xs) ; (xs2) = (fst_Pair_Lst_T_Fmts a) ; (xs22) = (snd_Pair_Lst_T_Fmts a) } in (C_CPair_Lst_T_Fmts_1 ((:) x xs2) xs22) } )
1139 splitAt_T_Mins i tm =
1140 (if (i<=0) then (C_CPair_Lst_T_Mins_1 ([] ) tm) else case tm of { ( [] ) -> (C_CPair_Lst_T_Mins_1 ([] ) ([] )) ; ( (:) x xs ) -> let { (a) = (splitAt_T_Mins (i-1) xs) ; (xs2) = (fst_Pair_Lst_T_Mins a) ; (xs22) = (snd_Pair_Lst_T_Mins a) } in (C_CPair_Lst_T_Mins_1 ((:) x xs2) xs22) } )
1141 tail_T_Reqs t =
1142 case t of { ( (:) _ tr ) -> tr }
1143 text_fmts s =
1144 ((:) (s2fmt s) ([] ))
1145 third_t t =
1146 case t of { (C_Triple_1 _ _ ph) -> ph }
1147 tooWide pw x y =
1148 ((max (total_w x) ((last_w x)+(total_w y)))>pw)
1149 total_w f =
1150 case f of { (C_Elem_1 _ _ w _) -> w }
1151 txtstr f n s =
1152 case f of { (C_Elem_1 dh dl dw dt) -> ((newlines (add_glue n dt))++s) }
1153 typecheck s exptype fid env =
1154 (if (exptype==(gettype s fid env)) then True else False)
1155 whilePP bg exp stats =
1156 (C_Apply_1 (C_JoinC_1 (hvc (C_ParC_1 ) (C_JoinC_1 (hvc (C_ParC_1 ) C_ParC_1)))) (C_ConsArgs_1 bg (C_ConsArgs_1 exp (C_ConsArgs_1 stats (C_NilArgs_1 )))))
1157 whilePPOLD exp stats =
1158 (hv (hv (C_Text_1 "while") (C_Beside_1 (C_Text_1 "(") (C_Beside_1 exp (C_Text_1 ")")))) (blockStats stats))
1159 zipwith_max l1 l2 =
1160 case l1 of { ( [] ) -> l2 ; ( (:) l11 l11s ) -> case l2 of { ( [] ) -> l1 ; ( (:) l22 l22s ) -> ((:) (max_T_Frame l11 l22) (zipwith_max l11s l22s)) } }