Project

General

Profile

« Previous | Next » 

Revision d3f0059e

Added by Arnaud Dieumegard about 5 years ago

New version of the VHDL importer with pretty printing based on ppx_show

View differences:

src/tools/importer/main_lustre_importer.ml
14 14
open Vhdl_test
15 15
  *)
16 16
open Yojson.Safe
17
open Vhdl_ast_utils
18
open Vhdl_ast_map
17 19
open Vhdl_ast
20
open Ppxlib_traverse_builtins
18 21
open Printf
19 22

  
20 23
let _ =
......
24 27
  (* Create VHDL values *)
25 28
  let vhdl = vhdl_file_t_of_yojson vhdl_json in
26 29

  
30
  (* Simplify VHDL values *)
27 31
  match vhdl with
28 32
    Ok x ->
29
      Format.printf "Parsed VHDL: \n%s\n" (pretty_to_string (vhdl_file_t_to_yojson x))
33
      Format.printf "Parsed VHDL: \n%s\n" (pretty_to_string (vhdl_file_t_to_yojson x));
34
      let folded = replace_op_expr#vhdl_file_t x in
35
      Format.printf "PP VHDL: \n%s\n" (show_vhdl_file_t folded);
30 36
  | Error e -> Format.printf "Error: %s\n" e;
37

  

Also available in: Unified diff