diff options
| author | Kathy Gray | 2014-10-03 19:32:35 +0100 |
|---|---|---|
| committer | Kathy Gray | 2014-10-03 19:32:35 +0100 |
| commit | 217dd9cb329831d5302ebaa4c3ab168d85cebaaf (patch) | |
| tree | ca176a22a21c157a35e1be9d92eaee30ac8678ac /src/lem_interp/interp_interface.lem | |
| parent | 16fe6613b5ecd93a36234daf8a3c4bc221da6abc (diff) | |
Add a decoding function to interp_interface and interp_inter_imp. (Note, this is quite specific to Power's spec)
Diffstat (limited to 'src/lem_interp/interp_interface.lem')
| -rw-r--r-- | src/lem_interp/interp_interface.lem | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lem_interp/interp_interface.lem b/src/lem_interp/interp_interface.lem index d49edfd5..9f967b1e 100644 --- a/src/lem_interp/interp_interface.lem +++ b/src/lem_interp/interp_interface.lem @@ -66,6 +66,15 @@ val build_context : Interp_ast.defs Interp.tannot -> context (*defs should come val initial_instruction_state : context -> string -> list value -> instruction_state (* string is a function name, list of value are the parameters to that function *) +type i_state_or_error = + | Instr of instruction_state + | Unsupported_instruction_error + | Not_an_instruction_error + | Internal_error of string + +(*Function to decode an instruction and build the state to run it*) +val decode_to_istate : context -> value -> i_state_or_error + (* Big step of the interpreter, to the next request for an external action *) (* When interp_mode has eager_eval false, interpreter is (close to) small step *) val interp : interp_mode -> instruction_state -> outcome |
