module Interp: sig
.. end
Functions to build a BulletML interpreter.
Functions to build a BulletML interpreter.
val build_prog : Bulletml.Interp_types.env ->
Bulletml.Interp_types.opcode list ->
Bulletml.Syntax.subaction -> Bulletml.Interp_types.opcode list
val int_pos : Bulletml.Interp_types.position -> int * int
val initial_obj : Bulletml.Interp_types.opcode list ->
Bulletml.Interp_types.position -> Bulletml.Interp_types.obj
val collect_obj : Bulletml.Interp_types.obj -> Bulletml.Interp_types.obj list
val animate : Bulletml.Interp_types.env ->
Bulletml.Interp_types.obj -> Bulletml.Interp_types.obj
Compute the next state of an
Interp_types.obj
:
- delete out-of-bounds or vanished children
- recursively
Interp.animate
its remaining children
- interpret its current instruction
- handle physics (move it according to its current direction and speed)
The interpretation phase can interpret several
Interp_types.opcode
s, for
example until a
OpWait
instruction is found.
val prepare : Bulletml.Syntax.t ->
Bulletml.Interp_types.init_params ->
Bulletml.Interp_types.env * Bulletml.Interp_types.obj * string
Compile and prepare a program for interpretation.
Returns an environement, an initial object and the name of the top pattern
val main_loop : Bulletml.Syntax.t ->
Bulletml.Interp_types.init_params ->
('g, 'l, 'r) Bulletml.Interp_types.interpreter -> 'r