diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-12-23 20:54:05 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-02-17 14:10:51 +0100 |
commit | 3756806674da909ec6dc10ad25862b592792604e (patch) | |
tree | f2af7e47f8444caaff0a5a33599f381889db24e3 /CMakeLists.txt | |
parent | 77580a893283f2bde7ab46496bd3a3d7b2fc6784 (diff) |
treewide: rewrite ucode interpreter
Replace the former AST walking interpreter implementation with a single pass
bytecode compiler and a corresponding virtual machine.
The rewrite lays the groundwork for a couple of improvements with will be
subsequently implemented:
- Ability to precompile ucode sources into binary byte code
- Strippable debug information
- Reduced runtime memory usage
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9edfc6a..2046392 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,23 +32,7 @@ IF(JSONC_FOUND) INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS}) ENDIF() -ADD_CUSTOM_COMMAND( - OUTPUT contrib/lemon - DEPENDS contrib/lemon.c contrib/lempar.c - COMMAND gcc -o contrib/lemon contrib/lemon.c - COMMENT "Generating lemon parser generator" -) - -ADD_CUSTOM_COMMAND( - OUTPUT parser.c - DEPENDS parser.y contrib/lemon - COMMAND ./contrib/lemon parser.y - COMMENT "Generating parser.c" -) - -SET_PROPERTY(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "lemon;parser.h;parser.out") -SET_SOURCE_FILES_PROPERTIES("parser.c" PROPERTIES GENERATED TRUE COMPILE_FLAGS -Wno-error=unused-but-set-variable) -ADD_EXECUTABLE(ucode main.c ast.c lexer.c parser.c eval.c lib.c) +ADD_EXECUTABLE(ucode main.c lexer.c lib.c vm.c chunk.c value.c object.c compiler.c source.c) TARGET_LINK_LIBRARIES(ucode ${json}) CHECK_FUNCTION_EXISTS(dlopen DLOPEN_FUNCTION_EXISTS) |