package nuscr
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=c5a419fd1fdea78fb63b3a3c335b0e6b0f2b08d65b79870565bdcc0f997bc728
sha512=83ef593ed514eeef1b10069af54562833d617d1c338c5adaf82ee5c3ea7ec4569b3643fcbb237b3cb79ce2f579094cbd17217efa5f4e522bd20f67e1df3a7dbd
doc/nuscr.lib/Nuscrlib/index.html
Module Nuscrlib
Source
Main entry point of the library
A type for parsed syntax tree
Load pragmas defined in a parsed syntax tree
Parsing
This section deals with parsing protocols.
Parse a string into a scr_module
.
Parse from an input channel. The first parameter is the filename, for use in error messages.
Validation
validate_exn module
validates the module module
by performing standard checks. If verbose is set to true in the config, debugging messages will be printed
Other operations
protocols_names_of module
returns the list of the names of protocols occuring in module
enumerate module
enumerates the roles occurring in module
. The output is a list of pair (protocol, role-name)
.
val project_role :
scr_module ->
protocol:Names.ProtocolName.t ->
role:Names.RoleName.t ->
Ltype.t
project_role module protocol role
computes the local type for role role
in the protocol protocol
.
get_global_type module ~protocol
gets the corresponding global type for a protocol in a module
val get_global_type_literature_syntax :
scr_module ->
protocol:Names.ProtocolName.t ->
LiteratureSyntax.global
get_global_type module_literature_syntax ~protocol
gets the corresponding global type for a protocol in a module in literature syntax
val generate_fsm :
scr_module ->
protocol:Names.ProtocolName.t ->
role:Names.RoleName.t ->
Efsm.state * Efsm.t
generate_fsm module protocol role
computes the finite state machine of role role
in protocol protocol
, in module module
. It returns a pair (v, g)
where g
is the graph describing the fsm, and v
is the root index.
val generate_go_code :
scr_module ->
protocol:Names.ProtocolName.t ->
out_dir:string ->
go_path:string option ->
string
generate_code module protocol out_dir go_path
generates Golang implementation for protocol
. The protocol implementation designed to be a subpackage within a project. out_dir
is the path from the root of the project until the package inside which the protocol implementation (subpackage) should be generated - it is needed to generate imports. go_path
is the path to the project root, which can optionally be provided in order to write the implementation to the file system.
val generate_ocaml_code :
monad:bool ->
scr_module ->
protocol:Names.ProtocolName.t ->
role:Names.RoleName.t ->
string
generate_code ~monad module protocol role
generates event-style OCaml code for the role
in protocol
, inside a module
monad
indicates whether the generated code uses a monad for transport (e.g. Lwt, Async)
generate_code ~monad module protocol role
generates event-style OCaml code for the role
in protocol
, inside a module
monad
indicates whether the generated code uses a monad for transport (e.g. Lwt, Async)
val generate_ast :
monad:bool ->
scr_module ->
protocol:Names.ProtocolName.t ->
role:Names.RoleName.t ->
Ppxlib_ast.Parsetree.structure
generate_ast ~monad module protocol role
is similar to generate_code
, except it returns an AST instead of a string
val generate_fstar_code :
scr_module ->
protocol:Names.ProtocolName.t ->
role:Names.RoleName.t ->
string
Generate F* code, with support for refinement types
module Pragma : sig ... end
This module contains variables configuarations, to be set by pragmas or command line arguments, not to be changed for the duration of the program
module Expr : sig ... end
Expressions, used in RefinementTypes
pragma
module Gtype : sig ... end
Global types
module Ltype : sig ... end
Local type management
module Efsm : sig ... end
module Err : sig ... end
module Names : sig ... end
Identifiers and Namespaces
module Loc : sig ... end
module LiteratureSyntax : sig ... end
A Multiparty Session Type representation that is similar to those used in the literature