Changeset 2383 for Deliverables


Ignore:
Timestamp:
Oct 1, 2012, 5:58:58 PM (8 years ago)
Author:
campbell
Message:

Branch prototype so that there's a version with the matita output patch
preinstalled.

Location:
Deliverables/D2.2/8051-matita-out
Files:
7 edited
1 copied

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051-matita-out/src/acc.ml

    r1546 r2383  
    2828  let is_lustre_file = Options.is_lustre_file () in
    2929  let remove_lustre_externals = Options.is_remove_lustre_externals () in
     30  let (exact_output, output_filename) = match Options.get_output_files () with
     31    | None -> (false, filename)
     32    | Some filename' -> (true, filename') in
     33  let save ?(suffix="") ?(matita=false) ast =
     34    Languages.save ~matita
     35      (Options.is_asm_pretty ()) exact_output output_filename suffix ast
     36  in
    3037  let input_ast =
    3138    Languages.parse ~is_lustre_file ~remove_lustre_externals
    3239      src_language filename in
     40  if tgt_language = Languages.Clight &&
     41       Options.is_matita_output_enabled () then save ~matita:true input_ast;
    3342  let input_ast = Languages.add_runtime input_ast in
    3443  let input_ast = Languages.labelize input_ast in
    35   let (exact_output, output_filename) = match Options.get_output_files () with
    36     | None -> (false, filename)
    37     | Some filename' -> (true, filename') in
    38   let save ?(suffix="") ast =
    39     Languages.save
    40       (Options.is_asm_pretty ()) exact_output output_filename suffix ast
    41   in
    4244  let target_asts =
    4345    (** If debugging is enabled, the compilation function returns all
     
    5052  let final_ast, intermediate_asts = Misc.ListExt.cut_last target_asts in
    5153  save final_ast;
     54  if tgt_language <> Languages.Clight &&
     55     Options.is_matita_output_enabled () then save ~matita:true final_ast;
    5256  if Options.annotation_requested () then
    5357    begin
     
    6064    end;
    6165
    62   if Options.is_debug_enabled () then
     66  if Options.is_debug_enabled () then begin
    6367    List.iter save intermediate_asts;
     68    if Options.is_matita_output_enabled () then
     69      List.iter (save ~matita:true) intermediate_asts
     70  end;
    6471
    6572  if Options.interpretations_requested () then
  • Deliverables/D2.2/8051-matita-out/src/clight/clightFromC.ml

    r1542 r2383  
    273273  let ty = convertTyp env e.etyp in
    274274  match e.edesc with
     275  | C.EConst(C.CInt(i, _, _)) when i = Int64.zero && ty = Tpointer Tvoid ->
     276      Expr(Ecast (ty, Expr (Econst_int 0, Tint (I8, AST.Unsigned))), ty)
    275277  | C.EConst(C.CInt(i, _, _)) ->
    276278      Expr(Econst_int( convertInt i), ty)
  • Deliverables/D2.2/8051-matita-out/src/driver.ml

    r740 r2383  
    55module DataSize32 =
    66struct
    7   let alignment = Some 4
     7  let alignment = Some 1
    88  let int_size = 4
    9   let ptr_size = 4
     9  let ptr_size = 2
    1010end
    1111
  • Deliverables/D2.2/8051-matita-out/src/languages.ml

    r1542 r2383  
    258258    [ASMPrinter.print_program p]
    259259
    260 let save asm_pretty exact_output filename suffix ast =
     260let string_output_matita = function
     261 | AstClight p ->
     262   [ClightPrintMatita.print_program p]
     263 | AstCminor p ->
     264   [CminorMatitaPrinter.print_program p]
     265 | AstRTLabs p ->
     266   [RTLabsPrinter.print_program p]
     267   (*[RTLabsMatitaPrinter.print_program p]*)
     268 | AstRTL p ->
     269   [RTLPrinter.print_program p]
     270 | AstERTL p ->
     271   [ERTLPrinter.print_program p]
     272 | AstLTL p ->
     273   [LTLPrinter.print_program p]
     274 | AstLIN p ->
     275   [LINPrinter.print_program p]
     276 | AstASM p ->
     277   [Pretty.print_program p ; ASMPrinter.print_program p]
     278
     279let save asm_pretty ?(matita=false) exact_output filename suffix ast =
    261280  let ext_chopped_filename =
    262281    if exact_output then filename
     
    266285  let ext_chopped_filename = ext_chopped_filename ^ suffix in
    267286  let ext_filenames =
    268     List.map (fun ext -> ext_chopped_filename ^ "." ^ ext)
     287    List.map (fun ext ->
     288        if matita then ext_chopped_filename ^ "." ^ ext ^ ".ma"
     289                  else ext_chopped_filename ^ "." ^ ext)
    269290      (extension (language_of_ast ast)) in
    270291  let output_filenames =
    271292    if exact_output then ext_filenames
    272293    else List.map Misc.SysExt.alternative ext_filenames in
    273   let output_strings = string_output asm_pretty ast in
     294  let output_strings =
     295    if matita then string_output_matita ast
     296              else string_output asm_pretty ast in
    274297  let f filename s =
    275298    let cout = open_out filename in
  • Deliverables/D2.2/8051-matita-out/src/languages.mli

    r1542 r2383  
    9191    is false then the written file will be fresh. If [asm_pretty] is true, then
    9292    an additional pretty-printed assembly file is output. *)
    93 val save : bool -> bool -> string -> string -> ast -> unit
     93val save : bool -> ?matita:bool -> bool -> string -> string -> ast -> unit
    9494
    9595(** [save_cost exact_name filename cost_id cost_incr extern_cost_variables]
  • Deliverables/D2.2/8051-matita-out/src/options.ml

    r1664 r2383  
    100100
    101101
     102let matita_flag                 = ref false
     103let is_matita_output_enabled () = !matita_flag
     104
    102105(*
    103106let print_result_flag           = ref false
     
    235238  "-dev", Arg.Set dev_test,
    236239  " Playground for developers.";
     240
     241  "-m", Arg.Set matita_flag,
     242  " Output matita term (when available).";
    237243]
  • Deliverables/D2.2/8051-matita-out/src/options.mli

    r1546 r2383  
    7676(** {2 Developers' playground} *)
    7777val is_dev_test_enabled : unit -> bool
     78
     79(** {2 Output matita term when available} *)
     80val is_matita_output_enabled : unit -> bool
Note: See TracChangeset for help on using the changeset viewer.