Module Types.Syntax

Syntax of TINT expressions.

type t = {
  1. hash : char;
  2. left : char;
  3. comma : char;
  4. right : char;
}

The type of syntax descriptions.

val to_string : t -> string

(to_string t) is a 4-character string representing a TINT syntax.

Invariant: ∀t.(t : Syntax.t) (t |> to_string |> of_string |> Result.get_ok = t)

val validated : t -> (t, string) Stdlib.result

(validated t) is (Ok t) if the syntax is valid.

val of_string : string -> (t, string) Stdlib.result

(of_string str) is (Ok t) if str describes a valid syntax.

str must be exactly 4 characters long and the characters are interpreted as follows:

  1. character to replace the default octothorpe (#)
  2. character to replace the default left parenthesis
  3. character to replace the default command
  4. character to replace the default right parenthesis

None of the characters can be duplicated.

val tracstring : string

tracstring is "#(,)", a string that encodes the syntax of Mooers's TRAC.

val trac : t

trac is (Result.get_ok (validated tracstring)).