From 9fdef50606a2942389189cd61397e17c0a0ccfd7 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Thu, 24 Aug 2023 17:16:39 +0200 Subject: codegen: add Interpreter struct This makes the code easier to use. --- vm0/README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 vm0/README.md (limited to 'vm0') diff --git a/vm0/README.md b/vm0/README.md new file mode 100644 index 0000000..fc89429 --- /dev/null +++ b/vm0/README.md @@ -0,0 +1,27 @@ +# vm0 + +vm0 is a virtual machine executing directly the syntax tree. + +```mermaid +graph LR +s[ ] --> |source| a(scanner) +--> |tokens| b(parser) +--> |AST| c(vm) +subgraph vm0 + c +end +style s height:0px; +``` + +The execution is performed by walking the AST and evaluating each +visited node. + + +## Motivation + +- have a reference execution model for each defined language +- usable for compilation time evaluation +- to modelize similar VMs (i.e. gnovm) +- to validate and compare with other VMs (once it is itself validated) +- could serve as a basis for AST based symbolic execution (to be + investigated) -- cgit v1.2.3