package frama-c
Install
Dune Dependency
Authors
-
MMichele Alberti
-
TThibaud Antignac
-
GGergö Barany
-
PPatrick Baudin
-
NNicolas Bellec
-
TThibaut Benjamin
-
AAllan Blanchard
-
LLionel Blatter
-
FFrançois Bobot
-
RRichard Bonichon
-
VVincent Botbol
-
QQuentin Bouillaguet
-
DDavid Bühler
-
ZZakaria Chihani
-
SSylvain Chiron
-
LLoïc Correnson
-
JJulien Crétin
-
PPascal Cuoq
-
ZZaynah Dargaye
-
BBasile Desloges
-
JJean-Christophe Filliâtre
-
PPhilippe Herrmann
-
MMaxime Jacquemin
-
BBenjamin Jorge
-
FFlorent Kirchner
-
AAlexander Kogtenkov
-
RRemi Lazarini
-
TTristan Le Gall
-
KKilyan Le Gallic
-
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
-
PPierre Nigron
-
AAnne Pacalet
-
VValentin Perrelle
-
GGuillaume Petiot
-
DDario Pinto
-
VVirgile Prevosto
-
AArmand Puccetti
-
FFélix Ridoux
-
VVirgile Robles
-
JJan Rochel
-
MMuriel Roger
-
CCécile Ruet-Cros
-
JJulien Signoles
-
NNicolas Stouls
-
KKostyantyn Vorobyov
-
BBoris Yakobowski
Maintainers
Sources
sha256=a94384f00d53791cbb4b4d83ab41607bc71962d42461f02d71116c4ff6dca567
doc/frama-c-server.core/Server/Data/index.html
Module Server.Data
Source
Data Encoding.
Datatypes
This module is responsible for marshaling and demarshaling data to handle communications between the server and the client in both directions.
Each datatype must be equipped with functions to encode and decode values to/from JSON format. Moreover, data types shall be also properly documented and registered in the generated documentation of the Frama-C server.
Generally speaking, we will have a module with signature Data.D
for every datatype to be exchanged with the server. For simple values, predefined modules are already provided. More complex datatypes can be built with some functors, typically for options, lists or arrays.
Records and enumerated types are typical in JSON formatting, but difficult to build from OCaml records and abstract datatypes. For those kinds of data, we provide an API based on the following general scheme:
- First create an empty container with its name, documentation and such;
- Then add each field or constructor to the container;
- Finally pack the container, which actually registers its complete documentation and returns an OCaml value containing the resulting datatype module.
Hence, in addition to module signature Data.S
for values, there is also a polymorphic type 'a Data.data
for module values carrying a data module with type t = 'a
.
The same mechanism is used throughout modules States
and Request
each time a JSON record or tag is needed.
Atomic Data
val jpretty :
?indent:int ->
?margin:int ->
(Stdlib.Format.formatter -> 'a -> unit) ->
'a ->
Jtext.t
All-in-one formatter. Return the JSON encoding of formatted text.
Constructors
Functional API
Declare the derived names for the provided type. Shall not be used directely.
val declare :
package:Package.package ->
name:string ->
?descr:Frama_c_kernel.Markdown.text ->
Package.jtype ->
Package.jtype
Declare a new type and returns its alias. Same as Jdata (declare_id ~package ~name (D_type js))
. Automatically declare the derived names.
Records
Enums
Indexed Values
These datatypes automatically index complex values with unique identifiers. This avoids to encode the internal OCaml representation of each value, by only providing to the server a unique identifier for each value.
These datatype functors come into three flavors:
Index()
for projectified datatypes,Static()
for project independant datatypes,Identified()
for projectified values already identified by integers.Tagged()
for projectified values already identified by strings.
Builds an indexer that does not depend on current project.
Builds a projectified index.
Datatype already identified by unique integers.
module Identified
(A : IdentifiedType)
(_ : Info) :
Index with type t = A.t and type tag := int
Builds a projectified index on types with unique identifiers.
Datatype already identified by unique integers.
Builds a projectified index on types with unique identifiers.
Error handling
These utilities shall be used when writing your own encoding and decoding values to JSON format.
Exception thrown during the decoding of a request's inputs.