Project

General

Profile

« Previous | Next » 

Revision eb70bae5

Added by Christophe Garion about 6 years ago

parser-json: final version of parser with new types

View differences:

src/tools/stateflow/parser-json/parser_json.ml
26 26
    with
27 27
      Type_error _ -> [ json ]
28 28

  
29
  let rec parse_prog json =
29
  let rec parse_prog json : prog_t =
30 30
     (*Format.printf "parse_prog@.";*)
31
    Prog (
31
    Program (
32 32
      json |> member "name"        |> to_string,
33 33
     (json |> member "states"      |> to_list |> List.map parse_state) @
34 34
     (json |> member "junctions"   |> to_list |> List.map parse_junction)
35 35
     @
36 36
     (json |> member "sffunctions" |> to_list |> List.map
37
        (fun res -> SFFunction (parse_prog res)))
37
        (fun res -> SFFunction (parse_prog res))),
38
      [] (* TODO: to be replaced by variables ! *)
38 39
    )
39 40
  and parse_variables json =
40 41
     (*Format.printf "parse_variables@.";*)

Also available in: Unified diff