package frama-c
Install
Dune Dependency
Authors
-
MMichele Alberti
-
TThibaud Antignac
-
GGergö Barany
-
PPatrick Baudin
-
TThibaut Benjamin
-
AAllan Blanchard
-
LLionel Blatter
-
FFrançois Bobot
-
RRichard Bonichon
-
QQuentin Bouillaguet
-
DDavid Bühler
-
ZZakaria Chihani
-
LLoïc Correnson
-
JJulien Crétin
-
PPascal Cuoq
-
ZZaynah Dargaye
-
BBasile Desloges
-
JJean-Christophe Filliâtre
-
PPhilippe Herrmann
-
MMaxime Jacquemin
-
FFlorent Kirchner
-
AAlexander Kogtenkov
-
TTristan Le Gall
-
JJean-Christophe Léchenet
-
MMatthieu Lemerre
-
DDara Ly
-
DDavid Maison
-
CClaude Marché
-
AAndré Maroneze
-
TThibault Martin
-
FFonenantsoa Maurica
-
MMelody Méaulle
-
BBenjamin Monate
-
YYannick Moy
-
AAnne Pacalet
-
VValentin Perrelle
-
GGuillaume Petiot
-
DDario Pinto
-
VVirgile Prevosto
-
AArmand Puccetti
-
FFélix Ridoux
-
VVirgile Robles
-
MMuriel Roger
-
JJulien Signoles
-
NNicolas Stouls
-
KKostyantyn Vorobyov
-
BBoris Yakobowski
Maintainers
Sources
sha256=5b13574a16a58971c27909bee94ae7f37b17d897852b40c768a3d4e2e09e39d2
doc/frama-c-server.core/Server/Data/Enum/index.html
Module Data.Enum
Source
Enum factory.
You shall start by declaring a dictionary with Enum.dictionary
for your values. Then, populate the dictionary with Enum.tag
values. Finally, you shall call Enum.publish
to obtain a new data module for your type.
You have two options for computing tags: either you provide values when declaring tags, and these tags will be associated to registered values for both directions; alternatively you might provide a ~tag
function to Enum.publish
.
The difficulty when providing values only at tag definition is to ensure that all possible value has been registered.
The conversion values from and to json may fail when no value has been registered with tags.
Creates an opened, empty dictionary.
val tag :
name:string ->
?label:Frama_c_kernel.Markdown.text ->
descr:Frama_c_kernel.Markdown.text ->
?value:'a ->
'a dictionary ->
'a tag
Register a new tag in the dictionary. The default label is the capitalized name. The provided value, if any, will be used for decoding json tags. If would be used also for encoding values to json tags if no ~tag
function is provided when publishing the dictionary. Registered values must be hashable with Hashtbl.hash
function.
You may register a new tag after the dictionary has been published.
val add :
name:string ->
?label:Frama_c_kernel.Markdown.text ->
descr:Frama_c_kernel.Markdown.text ->
?value:'a ->
'a dictionary ->
unit
Same as tag
but to not return the associated tag.
Returns the value associated to some tag.
Returns the tag associated to a value.
Returns the tag from its name.
val prefix :
name:string ->
?var:string ->
?label:Frama_c_kernel.Markdown.text ->
descr:Frama_c_kernel.Markdown.text ->
'a dictionary ->
'a prefix
Register a new prefix tag in the dictionary. The default label is the capitalized prefix. To decoding from json is provided to prefix tags. Encoding is done by emitting tags with form 'prefix:*'
. The variable part of the prefix is documented as 'prefix:xxx'
when ~var:"xxx"
is provided.
You may register a new prefix-tag after the dictionary has been published.
Returns the tag for a value associated with the given prefix.
val extends :
name:string ->
?label:Frama_c_kernel.Markdown.text ->
descr:Frama_c_kernel.Markdown.text ->
?value:'a ->
'a prefix ->
'a tag
Publish a new instance in the documentation.
Obtain all the tags registered in the dictionary so far.
Set tagging function for values. If the lookup function raises `Not_found`, the dictionary will use the tag associated with the provided value, if any.
val publish :
package:Package.package ->
name:string ->
descr:Frama_c_kernel.Markdown.text ->
'a dictionary ->
(module S
with type t = 'a)
Publish the dictionary. No more tag nor prefix can be added afterwards. If no ~tag
function is provided, the values registered with tags are used.