module Parser: sig endexception Error of string
type 'a t = {
|
lex : |
|
deparse : |
|
complete : |
|
accept : |
|
desc : |
val int : ?max:int -> ?min:int -> unit -> int tval float : unit -> float tval unit : unit tval bool : bool tval string : string tval option : 'a t -> 'a option tval pair : 'a t -> 'b t -> ('a * 'b) tval triple : 'a t -> 'b t -> 'c t -> ('a * 'b * 'c) tval quadruple : 'a t ->
'b t -> 'c t -> 'd t -> ('a * 'b * 'c * 'd) tval pentuple : 'a t ->
'b t ->
'c t ->
'd t -> 'e t -> ('a * 'b * 'c * 'd * 'e) tval accept_only : 'a list -> 'a t -> 'a tval callback : ('a -> unit) -> 'a t -> 'a tval command : (unit -> unit) tval variable : string tval add_command : string -> 'a t -> string -> ('a -> unit) -> unitadd_command name type description handler adds the command to the list
of commands. Examples of usage in MLGame:
Parser.add_command "exec" Parser.string "executes the given script" exec
Parser.add_command "bind_global" (Parser.pair Key.parser Parser.command) "Bind_global binds..." my_function;;
Parser.add_command "disconnect" Net.local_player_parser "This fun.." fun;;
val add_variable : string -> 'a t -> 'a -> 'a Pervasives.refval get : string -> stringval set : string -> string -> unitval parse : string -> unit -> unitparse expression Parses a given string and returns a simple function
that executes the parsed expression.Error if something went wrong.val available_completions : string -> string listval create_log : string -> string -> bool -> string -> unitcreate_log name prefix init creates a debug logger that can be switched
on and off via the parser.val sextuple : 'a t ->
'b t ->
'c t ->
'd t ->
'e t -> 'f t -> ('a * 'b * 'c * 'd * 'e * 'f) tval septuple : 'a t ->
'b t ->
'c t ->
'd t ->
'e t ->
'f t -> 'g t -> ('a * 'b * 'c * 'd * 'e * 'f * 'g) tval octuple : 'a t ->
'b t ->
'c t ->
'd t ->
'e t ->
'f t ->
'g t ->
'h t -> ('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h) tval nonuple : 'a t ->
'b t ->
'c t ->
'd t ->
'e t ->
'f t ->
'g t ->
'h t ->
'i t -> ('a * 'b * 'c * 'd * 'e * 'f * 'g * 'h * 'i) t