package sexp_grammar

  1. Overview
  2. Docs

Module Sexp_grammarSource

Sourcemodule type Callbacks_for_fold_common = sig ... end
Sourcemodule type Callbacks_for_fold_nonrecursive = sig ... end
Sourcemodule type Callbacks_for_fold_recursive = sig ... end
Sourcemodule type Fold = sig ... end
Sourcemodule type Fold_partial = sig ... end
Sourcemodule Field : sig ... end
Sourcemodule Case_sensitivity : sig ... end
Sourcetype grammar = Sexp_grammar__.Sexp_grammar_intf.Sexp_grammar.grammar =
  1. | Any of Base.string
  2. | Bool
  3. | Char
  4. | Integer
  5. | Float
  6. | String
  7. | Option of grammar
  8. | List of list_grammar
  9. | Variant of variant
  10. | Union of grammar Base.list
  11. | Tagged of grammar with_tag
  12. | Tyvar of Base.string
  13. | Tycon of Base.string * grammar Base.list
  14. | Recursive of grammar * defn Base.list
  15. | Lazy of grammar Base.Lazy.t
Sourceand list_grammar = Sexp_grammar__.Sexp_grammar_intf.Sexp_grammar.list_grammar =
  1. | Empty
  2. | Cons of grammar * list_grammar
  3. | Many of grammar
  4. | Fields of record
Sourceand record = Sexp_grammar__.Sexp_grammar_intf.Sexp_grammar.record = {
  1. allow_extra_fields : Base.bool;
  2. fields : field with_tag_list Base.list;
}
Sourceand field = Sexp_grammar__.Sexp_grammar_intf.Sexp_grammar.field = {
  1. name : Base.string;
  2. required : Base.bool;
  3. args : list_grammar;
}
Sourceand case_sensitivity = Sexp_grammar__.Sexp_grammar_intf.Sexp_grammar.case_sensitivity =
  1. | Case_insensitive
  2. | Case_sensitive
  3. | Case_sensitive_except_first_character
Sourceand variant = Sexp_grammar__.Sexp_grammar_intf.Sexp_grammar.variant = {
  1. case_sensitivity : case_sensitivity;
  2. clauses : clause with_tag_list Base.list;
}
Sourceand clause = Sexp_grammar__.Sexp_grammar_intf.Sexp_grammar.clause = {
  1. name : Base.string;
  2. clause_kind : clause_kind;
}
Sourceand clause_kind = Sexp_grammar__.Sexp_grammar_intf.Sexp_grammar.clause_kind =
  1. | Atom_clause
  2. | List_clause of {
    1. args : list_grammar;
    }
Sourceand 'a with_tag = 'a Sexp_grammar__.Sexp_grammar_intf.Sexp_grammar.with_tag = {
  1. key : Base.string;
  2. value : Base.Sexp.t;
  3. grammar : 'a;
}
Sourceand 'a with_tag_list = 'a Sexp_grammar__.Sexp_grammar_intf.Sexp_grammar.with_tag_list =
  1. | Tag of 'a with_tag_list with_tag
  2. | No_tag of 'a
Sourceand defn = Sexp_grammar__.Sexp_grammar_intf.Sexp_grammar.defn = {
  1. tycon : Base.string;
  2. tyvars : Base.string Base.list;
  3. grammar : grammar;
}
Sourceand 'a t = 'a Sexp_grammar__.Sexp_grammar_intf.Sexp_grammar.t = {
  1. untyped : grammar;
}
Sourceval compare_grammar : grammar -> grammar -> Base.int
Sourceval compare_list_grammar : list_grammar -> list_grammar -> Base.int
Sourceval compare_record : record -> record -> Base.int
Sourceval compare_field : field -> field -> Base.int
Sourceval compare_case_sensitivity : case_sensitivity -> case_sensitivity -> Base.int
Sourceval compare_variant : variant -> variant -> Base.int
Sourceval compare_clause : clause -> clause -> Base.int
Sourceval compare_clause_kind : clause_kind -> clause_kind -> Base.int
Sourceval compare_with_tag : ('a -> 'a -> Base.int) -> 'a with_tag -> 'a with_tag -> Base.int
Sourceval compare_with_tag_list : ('a -> 'a -> Base.int) -> 'a with_tag_list -> 'a with_tag_list -> Base.int
Sourceval compare_defn : defn -> defn -> Base.int
Sourceval compare : ('a -> 'a -> Base.int) -> 'a t -> 'a t -> Base.int
Sourceval equal_grammar : grammar -> grammar -> Base.bool
Sourceval equal_list_grammar : list_grammar -> list_grammar -> Base.bool
Sourceval equal_record : record -> record -> Base.bool
Sourceval equal_field : field -> field -> Base.bool
Sourceval equal_case_sensitivity : case_sensitivity -> case_sensitivity -> Base.bool
Sourceval equal_variant : variant -> variant -> Base.bool
Sourceval equal_clause : clause -> clause -> Base.bool
Sourceval equal_clause_kind : clause_kind -> clause_kind -> Base.bool
Sourceval equal_with_tag : ('a -> 'a -> Base.bool) -> 'a with_tag -> 'a with_tag -> Base.bool
Sourceval equal_with_tag_list : ('a -> 'a -> Base.bool) -> 'a with_tag_list -> 'a with_tag_list -> Base.bool
Sourceval equal_defn : defn -> defn -> Base.bool
Sourceval equal : ('a -> 'a -> Base.bool) -> 'a t -> 'a t -> Base.bool
Sourceval sexp_of_grammar : grammar -> Sexplib0.Sexp.t
Sourceval sexp_of_list_grammar : list_grammar -> Sexplib0.Sexp.t
Sourceval sexp_of_record : record -> Sexplib0.Sexp.t
Sourceval sexp_of_field : field -> Sexplib0.Sexp.t
Sourceval sexp_of_case_sensitivity : case_sensitivity -> Sexplib0.Sexp.t
Sourceval sexp_of_variant : variant -> Sexplib0.Sexp.t
Sourceval sexp_of_clause : clause -> Sexplib0.Sexp.t
Sourceval sexp_of_clause_kind : clause_kind -> Sexplib0.Sexp.t
Sourceval sexp_of_with_tag : ('a -> Sexplib0.Sexp.t) -> 'a with_tag -> Sexplib0.Sexp.t
Sourceval sexp_of_with_tag_list : ('a -> Sexplib0.Sexp.t) -> 'a with_tag_list -> Sexplib0.Sexp.t
Sourceval sexp_of_defn : defn -> Sexplib0.Sexp.t
Sourceval sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t

For stable serializations of these types, see Sexp_grammar_stable.

Sourceval coerce : _ t -> _ t

Like Fold_nonrecursive. Ties the knot for recursive grammars. May raise if the grammar contains malformed recursive definitions, e.g. an undefined type variable or applying a type constructor with the wrong arity. Exceptions may be delayed until of_lazy values are forced.

Sourcemodule Eager_copy : Fold with type t := grammar and type list_t := list_grammar

An instance of Fold_nonrecursive. Produces an equivalent grammar with no Lazy nodes. Implicitly used by sexp_of_t.

An instance of Fold_recursive. Produces an equivalent grammar with no Recursive, Tycon, or Tyvar nodes. This can be useful for subsequent grammar processing without the need for type variable / type constructor bookkeeping. The resulting tree may unfold infinitely, and uses Lazy nodes to avoid divergence.

Tagging

first_tag_value tags name of_sexp returns the first value of name in tags.

Sourceval completion_suggested : Base.string

completion_suggested = false on a variant constructor means that Sexp_grammar_completion will not suggest the constructor as a completion. The constructor is still recognized as valid syntax. Completions are still suggested for its arguments.

Default is true.

This tag is ignored if its value is not a bool or if it is not placed on a variant constructor.

OCaml

Innovation. Community. Security.