Module Cudf_types


module Cudf_types: sig .. end
CUDF type library

Implement core CUDF types (see CUDF spec. ยง2.2.2).

For parsing and pretty printing of CUDF types see Cudf_types_pp.



CUDF types

type version = int 
type relop = [ `Eq | `Geq | `Gt | `Leq | `Lt | `Neq ] 
type constr = (relop * version) option 
type pkgname = string 
type vpkg = pkgname * constr 
type vpkglist = vpkg list 
type enum_keep = [ `Keep_feature | `Keep_none | `Keep_package | `Keep_version ] 
type vpkgformula = vpkg list list 
type veqpkg = pkgname * ([ `Eq ] * version) option 
type veqpkglist = veqpkg list 
type typ = [ `Bool
| `Enum of string list
| `Ident
| `Int
| `Nat
| `Pkgname
| `Posint
| `String
| `Typedecl
| `Veqpkg
| `Veqpkglist
| `Vpkg
| `Vpkgformula
| `Vpkglist ]
val keep_type : typ
val keep_enums : string list
type typedecl1 = [ `Bool of bool option
| `Enum of string list * string option
| `Ident of string option
| `Int of int option
| `Nat of int option
| `Pkgname of string option
| `Posint of int option
| `String of string option
| `Typedecl of typedecl option
| `Veqpkg of veqpkg option
| `Veqpkglist of veqpkglist option
| `Vpkg of vpkg option
| `Vpkgformula of vpkgformula option
| `Vpkglist of vpkglist option ]
type typedecl = (string * typedecl1) list 
type typed_value = [ `Bool of bool
| `Enum of string list * string
| `Ident of string
| `Int of int
| `Nat of int
| `Pkgname of string
| `Posint of int
| `String of string
| `Typedecl of typedecl
| `Veqpkg of veqpkg
| `Veqpkglist of veqpkglist
| `Vpkg of vpkg
| `Vpkgformula of vpkgformula
| `Vpkglist of vpkglist ]
val type_of_typedecl : typedecl1 -> typ
val typedecl_of_value : typed_value -> typedecl1
val value_of_typedecl : typedecl1 -> typed_value option
val typedecl_of_type : typ -> typedecl1
val type_of_value : typed_value -> typ
val cast : typ -> typed_value -> typed_value
type 'a stanza = (string * 'a) list 
type loc = Lexing.position * Lexing.position 
val dummy_loc : loc
val extend_loc : loc -> loc -> loc
val loc_of_lexbuf : Lexing.lexbuf -> loc
exception Parse_error_822 of string * loc
exception Syntax_error of string * loc
Syntax error while parsing some literal value

arguments: error message and file range, respectively

exception Type_error of typ * typed_value * loc
Type error: mismatch between typed value and expected type

arguments: expected type, found value


Accessors, predicates, etc.

val is_eq_formula : vpkgformula -> bool
Check whether a formula uses only equality tests over package versions.