package rfsm

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

Source file annot.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(**********************************************************************)
(*                                                                    *)
(*              This file is part of the RFSM package                 *)
(*                                                                    *)
(*  Copyright (c) 2018-present, Jocelyn SEROT.  All rights reserved.  *)
(*                                                                    *)
(*  This source code is licensed under the license found in the       *)
(*  LICENSE file in the root directory of this source tree.           *)
(*                                                                    *)
(**********************************************************************)

(**{1 Annotations} *)

type ('a,'b) t = {

   mutable desc: 'a; [@main] (** Annotated value *)

   mutable typ: 'b;  (** Type annotation (type ['b] will be bound to the guest language type) *)

   loc: Location.t [@default Location.no_location] (** Location in source code *)
      } [@@deriving map]
   (** The type [('a,'b) t] is used to attach type and location annotations to values of type ['a].  *)

let mk ~loc:l ~typ:t x = { desc=x; typ=t; loc=Location.mk l }