From 37b9da32d3b911091deb254f6cba2a137c471287 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Thu, 12 Oct 2023 10:51:58 +0200 Subject: move to a direct byte code compiler (#8) * chore: refactor to keep only the new parser and bytecode vm * scanner: remove Token.value field * scanner: remove scanner.kind field * chore: move language specification in lang package This avoid a cyclic dependency in scanner_test which can now use the golang/GoSpec language specification for Go. * clean code * scanner: export scanner fields Also parser now generate function calls, including externals. * chore: fix lint issues * parser: handle strings * wip * parser: implement support for 'if, else, else if' statements Resolving labels in the compiler still in progress. * parser: support if statements, improve compiler * improve handling of functions * improve support of local variables * scanner: trim leading and trailing spaces * fixes to make fibonacci work * parser: improve README, fix function parameters parsing --- vm0/README.md | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 vm0/README.md (limited to 'vm0/README.md') diff --git a/vm0/README.md b/vm0/README.md deleted file mode 100644 index fc89429..0000000 --- a/vm0/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# 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