Module Interp

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
Convert a list of Syntax.subactions into a list of Interp_types.opcodes. The extra list given as argument is the list to prepend to.
val int_pos : Bulletml.Interp_types.position -> int * int
Convert a (float) Interp_types.position to a pair of ints.
val initial_obj : Bulletml.Interp_types.opcode list ->
Bulletml.Interp_types.position -> Bulletml.Interp_types.obj
Given a program and a position, build an Interp_types.obj with default values.
val collect_obj : Bulletml.Interp_types.obj -> Bulletml.Interp_types.obj list
Create the list of descendants of an Interp_types.obj, including itself.
val animate : Bulletml.Interp_types.env ->
Bulletml.Interp_types.obj -> Bulletml.Interp_types.obj
Compute the next state of an Interp_types.obj: The interpretation phase can interpret several Interp_types.opcodes, 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
Skeleton for a main loop. See Interp_types.interpreter.