Kaitai_of_data_encoding.Helpers
val mk_tid_gen : string -> tid_gen
mk_tid_gen prefix
is a tid_gen
where generated ids have the given prefix
.
val default_doc_spec : Kaitai.Types.DocSpec.t
default_doc_spec
is without summary and references.
val cond_no_cond : Kaitai.Types.AttrSpec.ConditionalSpec.t
cond_no_cond
is default conditional specification that has no if
expression and no repetition.
val default_attr_spec : id:string -> Kaitai.Types.AttrSpec.t
default_attr_spec ~id
is initialized with default (empty) values except id
set to ~id
.
val default_meta_spec : ?imports:string list -> unit -> Kaitai.Types.MetaSpec.t
default_meta_spec ~id
returns default MetaSpec.t
.
The following meta section properties are set:
endian
is set to BE
(as per data-encoding default).imports
is set to imports
if not empty.[]
or None
.val default_class_spec :
?description:string ->
?imports:string list ->
unit ->
Kaitai.Types.ClassSpec.t
default_class_spec ?id
builds an default (empty) ClassSpec.t
.
add_uniq_assoc kvs kv
returns an association list with associations from kvs
as well as kv
.
If kvs
already contains kv
, then kvs
is returned.
val class_spec_of_attrs :
?description:string ->
?enums:(string * Kaitai.Types.EnumSpec.t) list ->
?types:(string * Kaitai.Types.ClassSpec.t) list ->
?instances:(string * Kaitai.Types.InstanceSpec.t) list ->
?imports:string list ->
Kaitai.Types.AttrSpec.t list ->
Kaitai.Types.ClassSpec.t
class_spec_of_attrs ~id ?description ?enums ?instances attrs
returns a ClassSpec.t
for the seq attrs
.
val default_instance_spec :
id:string ->
Kaitai.Types.Ast.t ->
Kaitai.Types.InstanceSpec.t
default_instance_spec ~id expr
returns a default instance specification for of a given id
and expr
.
val merge_summaries :
Kaitai.Types.AttrSpec.t ->
string option ->
Kaitai.Types.AttrSpec.t
merge_summaries a s
adds the summary s
to the doc of a
preserving the existing doc if any.
val merge_valid :
Kaitai.Types.AttrSpec.t ->
Kaitai.Types.ValidationSpec.t ->
Kaitai.Types.AttrSpec.t
merge_valid a v
adds the validation-spec v
to the attribute a
, combining the validation-specs if one is already present.