diff --git a/compiler/main/mls2seq.ml b/compiler/main/mls2seq.ml index f488e96..09d4c2b 100644 --- a/compiler/main/mls2seq.ml +++ b/compiler/main/mls2seq.ml @@ -41,7 +41,7 @@ let write_obc_file p = let no_conf () = () let targets = [ "c",(Obc_no_params Cmain.program, no_conf); - (*"java", (Obc Java_main.program, Java_main.java_conf);*) + "java", (Obc Java_main.program, Java_main.java_conf); "obc", (Obc write_obc_file, no_conf); "obc_np", (Obc_no_params write_obc_file, no_conf); "epo", (Minils write_object_file, no_conf) ] @@ -68,7 +68,7 @@ let generate_target p s = let p_list = Callgraph.program p in let o_list = List.map Mls2obc.program p_list in let o_list = List.map Obc_compiler.compile_program o_list in - List.iter convert_fun o_list + List.iter convert_fun o_list let load_conf () = let target_conf s = diff --git a/compiler/obc/java/obc2java.ml b/compiler/obc/java/obc2java.ml index 64f58a1..f1cfbd9 100644 --- a/compiler/obc/java/obc2java.ml +++ b/compiler/obc/java/obc2java.ml @@ -399,9 +399,16 @@ let const_dec_list cd_l = match cd_l with let program p = - let classes = const_dec_list p.p_consts in - let classes = type_dec_list classes p.p_types in - let p = class_def_list classes p.p_classes in + let rec program_descs pds (ns,cs,ts) = match pds with + | [] -> ns,cs,ts + | Obc.Pclass n :: pds -> program_descs pds (n::ns,cs,ts) + | Obc.Pconst c :: pds -> program_descs pds (ns,c::cs,ts) + | Obc.Ptype t :: pds -> program_descs pds (ns,cs,t::ts) + in + let ns,cs,ts = program_descs p.p_desc ([],[],[]) in + let classes = const_dec_list cs in + let classes = type_dec_list classes ts in + let p = class_def_list classes ns in get_classes()@p