-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fleche] Write down the language interface to Flèche
This is both a sanity check and a step to prepare for other possible users.
- Loading branch information
Showing
26 changed files
with
693 additions
and
348 deletions.
There are no files selected for viewing
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
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,11 +1,46 @@ | ||
type t | ||
|
||
val loc : t -> Loc.t option | ||
(* Single identifier *) | ||
module Id : sig | ||
type t | ||
|
||
val to_string : t -> string | ||
end | ||
|
||
(* Qualified Identifier *) | ||
module QualId : sig | ||
type t | ||
end | ||
|
||
(* Comparison / hash functions *) | ||
val hash : t -> int | ||
val compare : t -> t -> int | ||
val to_coq : t -> Vernacexpr.vernac_control | ||
val of_coq : Vernacexpr.vernac_control -> t | ||
val loc : t -> Loc.t option | ||
val print : t -> Pp.t | ||
val grab_definitions : (Loc.t -> Names.Id.t -> 'a) -> t list -> 'a list | ||
val grab_definitions : (Loc.t -> Id.t -> 'a) -> t list -> 'a list | ||
val marshal_in : in_channel -> t | ||
val marshal_out : out_channel -> t -> unit | ||
|
||
(* Analysis on AST / Structure inference *) | ||
module View : sig | ||
type ast = t | ||
|
||
type t = | ||
(* This could be also extracted from the interpretation *) | ||
| Open of unit | ||
| End of unit | ||
| Require of | ||
{ prefix : QualId.t option | ||
; refs : QualId.t list | ||
} | ||
| Other | ||
|
||
val kind : ast -> t | ||
end | ||
|
||
(* This can't be used outside of the [Coq] library, and will be gone once we | ||
functiorialize the interface *) | ||
module Internal : sig | ||
val to_coq : t -> Vernacexpr.vernac_control | ||
val of_coq : Vernacexpr.vernac_control -> t | ||
end |
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
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,23 @@ | ||
module type Conv = sig | ||
type t | ||
|
||
module Internal : sig | ||
type coq | ||
|
||
val of_coq : coq -> t | ||
val to_coq : t -> coq | ||
end | ||
end | ||
|
||
module Make (S : sig | ||
type coq | ||
end) : Conv with type Internal.coq = S.coq = struct | ||
module Internal = struct | ||
type coq = S.coq | ||
|
||
let of_coq x = x | ||
let to_coq x = x | ||
end | ||
|
||
type t = S.coq | ||
end |
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
Oops, something went wrong.