package p4spectec

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file parse.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Value = Runtime.Value
module Run = Runtime.Dynamic_Runner.Signature

let parse_files (mode : Run.mode) (paths_spec : string list) : Value.t =
  match mode with
  | AL_mode -> paths_spec |> Pass.algo |> Ali.Boot.boot_spec
  | SL_mode -> paths_spec |> Pass.structure ~final:true |> Sli.Boot.boot_spec
  | PL_mode -> assert false
  | Empty_mode -> assert false

let parse_string (mode : Run.mode) (_path : string) (str : string) : Value.t =
  match mode with
  | AL_mode ->
      str |> Frontend.Parse.parse_string |> Pass.Elaborate.Elab.elab_spec
      |> Pass.Algo.algo_spec |> Ali.Boot.boot_spec
  | SL_mode ->
      str |> Frontend.Parse.parse_string |> Pass.Elaborate.Elab.elab_spec
      |> Pass.Algo.algo_spec
      |> Pass.Structure.Struct.struct_spec ~final:true
      |> Sli.Boot.boot_spec
  | PL_mode -> assert false
  | Empty_mode -> assert false