module OASISExpr:sig..end
This module provides a boolean expression evaluator. See OASIS manual
for the precise syntax of the boolean expression
Author(s): Sylvain Le Gall
See also OASIS Manual
type test
val tests : test listval string_of_test : test -> stringval test_of_string : string -> testtypeflag =string
type t =
| |
EBool of |
(* |
true or false
| *) |
| |
ENot of |
(* |
! e
| *) |
| |
EAnd of |
(* |
e1 && e2
| *) |
| |
EOr of |
(* |
e1 || e2
| *) |
| |
EFlag of |
(* |
flag(foo), a boolean value.
| *) |
| |
ETest of |
(* |
os_type(Win32), a value compared to a string.
| *) |
type'achoices =(t * 'a) list
val eval : (string -> string) -> t -> booleval eval_tst t Evaluates the expression. Use eval_tst
to get values of flags and tests.val choose : ?printer:('a -> string) ->
?name:string -> (string -> string) -> 'a choices -> 'achoose ~printer ~name eval_tst choices Evaluate each conditions
of choices and choose the last condition that evaluates to true.
If something goes wrong, use printer to display values and ~name as the
choice list name.
See also OASISExpr.eval.
val check : flag list -> t -> unitval reduce : t -> tval reduce_choices : (t * 'a) list -> (t * 'a) listval if_then_else : t ->
(t * 'a) list -> (t * 'a) list -> (t * 'a) listif_then_else cond choices_if choices_else Combine choices, if_then_else
style.val odn_of_t : t -> ODN.tval odn_of_choices : ('a -> ODN.t) -> 'a choices -> ODN.t
val to_string : t -> stringval string_of_choices : ('a -> string) -> 'a choices -> string