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 list
val string_of_test : test -> string
val test_of_string : string -> test
typeflag =
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'a
choices =(t * 'a) list
val eval : (string -> string) -> t -> bool
eval 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 -> 'a
choose ~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 -> unit
val reduce : t -> t
val reduce_choices : 'a choices -> 'a choices
val if_then_else : t ->
'a choices -> 'a choices -> 'a choices
if_then_else cond choices_if choices_else
Combine choices, if_then_else
style.val odn_of_choices : ('a -> OASISDataNotation.t) -> 'a choices -> OASISDataNotation.t
val to_string : t -> string
val string_of_choices : ('a -> string) -> 'a choices -> string