From 664fbc5f5c947aaa04bbbf132d9c935959e34a9c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 14 Aug 2019 01:30:08 +0200 Subject: Move program code generation and execution out of program (make it generic) --- doc/Documentation.md | 9 ++++++++- doc/doc_extract.py | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/Documentation.md b/doc/Documentation.md index 2fcfe07..602d0e1 100644 --- a/doc/Documentation.md +++ b/doc/Documentation.md @@ -68,4 +68,11 @@ The versions in the header only changes for every release, not every change. |Type |Field |Description | |-----------|-----------------|---------------------------------------------------------------------------| |u32 |Instructions size|The size of the instructions section, in bytes. | -|Instruction|Instructions data|The instructions data. Each instructions begins with an opcode, see #Opcode| \ No newline at end of file +|Instruction|Instructions data|The instructions data. Each instructions begins with an opcode, see #Opcode| + +# Execution backend +Amalgam supports multiple execution backend and they can be implemented with minimal +effort. The only requirement is implementation of all the functions in executor/executor.h +and adding the source file with the implementation to the build script. See executor/interpreter/executor.c +as an example.\ +These functions are then called by amalgam as amalgam parses the amalgam bytecode when `amal_program_run` is called. \ No newline at end of file diff --git a/doc/doc_extract.py b/doc/doc_extract.py index ce192cb..1ce7dc9 100755 --- a/doc/doc_extract.py +++ b/doc/doc_extract.py @@ -69,9 +69,11 @@ def main(): amalgam_base = os.path.dirname(script_dir) amalgam_includes = os.path.join(amalgam_base, "include") amalgam_sources = os.path.join(amalgam_base, "src") + amalgam_executor_sources = os.path.join(amalgam_base, "executor") source_files = get_source_files_recursive(amalgam_includes) source_files += get_source_files_recursive(amalgam_sources) + source_files += get_source_files_recursive(amalgam_executor_sources) doc_data = [] for filepath in source_files: docs = extract_docs(filepath) -- cgit v1.2.3