-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from quantifyearth/mwd-misc-shuffle-2
Refactor AST code into single dir
- Loading branch information
Showing
14 changed files
with
93 additions
and
105 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(** {1 AST} | ||
The AST is the logical representation of the workflow described in a | ||
sharkdown file, including the structure of groups (aka basic blocks | ||
in PL, but block is an overloaded term in this context). *) | ||
|
||
type t | ||
(** An AST instance *) | ||
|
||
val order_command_list : Fpath.t list -> (string * Command.t list) list -> t | ||
(** Takes the sharkdown frontmatter and a list of named CommandGroups and builds | ||
an AST from them. | ||
TODOs: Don't take in all of the frontmatter just what we need? The CommandGroups | ||
should probably be a recursive data structure? *) | ||
|
||
val to_list : t -> Commandgroup.t list | ||
(** Convert the AST to a list of command blocks. *) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
open Sexplib.Conv | ||
|
||
type t = { name : string; children : Leaf.t list } [@@deriving sexp] | ||
|
||
let pp ppf t = Sexplib.Sexp.pp_hum ppf (sexp_of_t t) | ||
let v name children = { name; children } | ||
let name g = g.name | ||
let children g = g.children |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(** A named basic-block in PL terms. *) | ||
|
||
type t [@@deriving sexp] | ||
|
||
val v : string -> Leaf.t list -> t | ||
(** Creates a command group made up of a series of leaf nodes and given a name. *) | ||
|
||
val pp : t Fmt.t | ||
(** A pretty printer for command groups. *) | ||
|
||
val name : t -> string | ||
val children : t -> Leaf.t list |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
open Sexplib.Conv | ||
|
||
type style = Command | Map [@@deriving sexp] | ||
|
||
type t = { | ||
id : int; | ||
command : Command.t; | ||
style : style; | ||
inputs : Datafile.t list; | ||
outputs : Datafile.t list; | ||
} | ||
[@@deriving sexp] | ||
|
||
let pp ppf t = Sexplib.Sexp.pp_hum ppf (sexp_of_t t) | ||
let v id command style inputs outputs = { id; command; style; inputs; outputs } | ||
let command o = o.command | ||
let inputs o = o.inputs | ||
let outputs o = o.outputs | ||
let command_style o = o.style | ||
let id o = o.id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(** A Leaf is an atomic exection unit the in the pipeline graph. *) | ||
|
||
type style = Command | Map | ||
type t [@@deriving sexp] | ||
|
||
val v : int -> Command.t -> style -> Datafile.t list -> Datafile.t list -> t | ||
(** Creats a new leaf node, taking an integer identifier, the command to execute | ||
and a list of inputs and a list of outputs. *) | ||
|
||
val pp : t Fmt.t | ||
(** A pretty printer for leaves. *) | ||
|
||
val id : t -> int | ||
val command : t -> Command.t | ||
val command_style : t -> style | ||
val inputs : t -> Datafile.t list | ||
val outputs : t -> Datafile.t list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
(include_subdirs unqualified) | ||
|
||
(library | ||
(name shark) | ||
(libraries | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
(include_subdirs no) | ||
|
||
(executable | ||
(name main) | ||
(modes js) | ||
|