diff --git a/.gitmodules b/.gitmodules index a74bc5fa..7f7c45f1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,7 +5,7 @@ path = Extern/imgui url = https://github.com/ocornut/imgui.git [submodule "Libs/Pipe"] - path = Libs/Pipe + path = Extern/Pipe url = https://github.com/PipeRift/pipe.git [submodule "Extern/glfw"] path = Extern/glfw diff --git a/Apps/CLI/CMakeLists.txt b/Apps/CLI/CMakeLists.txt index f23b02be..e2da1fb6 100644 --- a/Apps/CLI/CMakeLists.txt +++ b/Apps/CLI/CMakeLists.txt @@ -8,7 +8,7 @@ target_sources(RiftCLIExe PRIVATE ${CLI_SOURCE_FILES}) target_link_libraries(RiftCLIExe PUBLIC CLI11 - Rift + RiftAST RiftCompilerModules ) diff --git a/Apps/CLI/Src/main.cpp b/Apps/CLI/Src/main.cpp index 436e2657..a620b4d5 100644 --- a/Apps/CLI/Src/main.cpp +++ b/Apps/CLI/Src/main.cpp @@ -4,9 +4,9 @@ // Override as first include #include +#include #include #include -#include #include #include #include @@ -19,6 +19,7 @@ #include + using namespace rift; @@ -65,7 +66,7 @@ namespace rift int main(int argc, char** argv) { p::Initialize("Saved/Logs"); - EnableModule(); + EnableModule(); EnableModule(); EnableModule(); EnableModule(); diff --git a/Apps/Editor/Src/main.cpp b/Apps/Editor/Src/main.cpp index 17cd234e..82799da6 100644 --- a/Apps/Editor/Src/main.cpp +++ b/Apps/Editor/Src/main.cpp @@ -3,8 +3,8 @@ #include // Override as first include +#include #include -#include #include #include #include @@ -13,6 +13,7 @@ #include + using namespace rift; @@ -23,7 +24,7 @@ using namespace rift; int RunEditor(StringView projectPath) { p::Initialize("Saved/Logs"); - EnableModule(); + EnableModule(); EnableModule(); EnableModule(); EnableModule(); diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b4d638f..d3eb20fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ option(RIFT_BUILD_TESTS "Build Rift and Core tests" ${RIFT_IS_PROJECT}) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(CMake/DownloadProject.cmake) -include(Libs/Pipe/CMake/Util.cmake) +include(Extern/Pipe/CMake/Util.cmake) include(CMake/Util.cmake) include(CMake/SetIcon.cmake) include(CMake/CheckClangTools.cmake) @@ -56,7 +56,7 @@ if(CLANG_FORMAT_EXE) # Additional targets to perform clang-format/clang-tidy file(GLOB_RECURSE ALL_SOURCE_FILES CONFIGURE_DEPENDS Apps/**/*.cpp Apps/**/*.h - Libs/Framework/**/*.cpp Libs/Framework/**/*.h + Libs/AST/**/*.cpp Libs/AST/**/*.h Libs/UI/**/*.cpp Libs/UI/**/*.h Libs/Pipe/Include/**/*.cpp Libs/Pipe/Include/**/*.h Libs/Pipe/Src/**/*.cpp Libs/Pipe/Src/**/*.h @@ -71,7 +71,7 @@ endif() if(CLANG_TIDY_EXE) file(GLOB_RECURSE ALL_SOURCE_FILES CONFIGURE_DEPENDS Apps/**/*.cpp - Libs/Framework/**/*.cpp + Libs/AST/**/*.cpp Libs/UI/**/*.cpp Libs/Pipe/Include/**/*.cpp Libs/Pipe/Src/**/*.cpp diff --git a/Extern/CMakeLists.txt b/Extern/CMakeLists.txt index e5c3154d..ca38d749 100644 --- a/Extern/CMakeLists.txt +++ b/Extern/CMakeLists.txt @@ -4,6 +4,11 @@ include(FetchContent) set(BUILD_SHARED_LIBS OFF) # Submodule libraries + +set(PIPE_BUILD_TESTS ${RIFT_BUILD_TESTS} CACHE BOOL "Build Pipe tests") +add_subdirectory(Pipe) + + set(CLI11_BUILD_TESTS OFF CACHE BOOL "Build CLI11 tests") set(CMAKE_POLICY_DEFAULT_CMP0054 NEW) add_subdirectory(CLI11) diff --git a/Libs/Pipe b/Extern/Pipe similarity index 100% rename from Libs/Pipe rename to Extern/Pipe diff --git a/Libs/AST/CMakeLists.txt b/Libs/AST/CMakeLists.txt new file mode 100644 index 00000000..23829d36 --- /dev/null +++ b/Libs/AST/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright 2015-2023 Piperift - All rights reserved + +add_library(RiftAST STATIC) +target_include_directories(RiftAST PUBLIC Include) + +file(GLOB_RECURSE AST_SOURCE_FILES CONFIGURE_DEPENDS Src/*.cpp Src/*.h) +target_sources(RiftAST PRIVATE ${AST_SOURCE_FILES}) + +target_link_libraries(RiftAST PUBLIC + Pipe + Taskflow + RiftBindingNative +) + +rift_module(RiftAST) +set_target_properties (RiftAST PROPERTIES FOLDER Rift) diff --git a/Libs/Framework/Include/AST/Components/CDeclClass.h b/Libs/AST/Include/AST/Components/CDeclClass.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CDeclClass.h rename to Libs/AST/Include/AST/Components/CDeclClass.h diff --git a/Libs/Framework/Include/AST/Components/CDeclFunction.h b/Libs/AST/Include/AST/Components/CDeclFunction.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CDeclFunction.h rename to Libs/AST/Include/AST/Components/CDeclFunction.h diff --git a/Libs/Framework/Include/AST/Components/CDeclNative.h b/Libs/AST/Include/AST/Components/CDeclNative.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CDeclNative.h rename to Libs/AST/Include/AST/Components/CDeclNative.h diff --git a/Libs/Framework/Include/AST/Components/CDeclRecord.h b/Libs/AST/Include/AST/Components/CDeclRecord.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CDeclRecord.h rename to Libs/AST/Include/AST/Components/CDeclRecord.h diff --git a/Libs/Framework/Include/AST/Components/CDeclStatic.h b/Libs/AST/Include/AST/Components/CDeclStatic.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CDeclStatic.h rename to Libs/AST/Include/AST/Components/CDeclStatic.h diff --git a/Libs/Framework/Include/AST/Components/CDeclStruct.h b/Libs/AST/Include/AST/Components/CDeclStruct.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CDeclStruct.h rename to Libs/AST/Include/AST/Components/CDeclStruct.h diff --git a/Libs/Framework/Include/AST/Components/CDeclType.h b/Libs/AST/Include/AST/Components/CDeclType.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CDeclType.h rename to Libs/AST/Include/AST/Components/CDeclType.h diff --git a/Libs/Framework/Include/AST/Components/CDeclVariable.h b/Libs/AST/Include/AST/Components/CDeclVariable.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CDeclVariable.h rename to Libs/AST/Include/AST/Components/CDeclVariable.h diff --git a/Libs/Framework/Include/AST/Components/CDeclaration.h b/Libs/AST/Include/AST/Components/CDeclaration.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CDeclaration.h rename to Libs/AST/Include/AST/Components/CDeclaration.h diff --git a/Libs/Framework/Include/AST/Components/CExprBinaryOperator.h b/Libs/AST/Include/AST/Components/CExprBinaryOperator.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CExprBinaryOperator.h rename to Libs/AST/Include/AST/Components/CExprBinaryOperator.h diff --git a/Libs/Framework/Include/AST/Components/CExprCall.h b/Libs/AST/Include/AST/Components/CExprCall.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CExprCall.h rename to Libs/AST/Include/AST/Components/CExprCall.h diff --git a/Libs/Framework/Include/AST/Components/CExprDeclRef.h b/Libs/AST/Include/AST/Components/CExprDeclRef.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CExprDeclRef.h rename to Libs/AST/Include/AST/Components/CExprDeclRef.h diff --git a/Libs/Framework/Include/AST/Components/CExprInputs.h b/Libs/AST/Include/AST/Components/CExprInputs.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CExprInputs.h rename to Libs/AST/Include/AST/Components/CExprInputs.h diff --git a/Libs/Framework/Include/AST/Components/CExprOutputs.h b/Libs/AST/Include/AST/Components/CExprOutputs.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CExprOutputs.h rename to Libs/AST/Include/AST/Components/CExprOutputs.h diff --git a/Libs/Framework/Include/AST/Components/CExprType.h b/Libs/AST/Include/AST/Components/CExprType.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CExprType.h rename to Libs/AST/Include/AST/Components/CExprType.h diff --git a/Libs/Framework/Include/AST/Components/CExprUnaryOperator.h b/Libs/AST/Include/AST/Components/CExprUnaryOperator.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CExprUnaryOperator.h rename to Libs/AST/Include/AST/Components/CExprUnaryOperator.h diff --git a/Libs/Framework/Include/AST/Components/CExpression.h b/Libs/AST/Include/AST/Components/CExpression.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CExpression.h rename to Libs/AST/Include/AST/Components/CExpression.h diff --git a/Libs/Framework/Include/AST/Components/CFileRef.h b/Libs/AST/Include/AST/Components/CFileRef.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CFileRef.h rename to Libs/AST/Include/AST/Components/CFileRef.h diff --git a/Libs/Framework/Include/AST/Components/CLiteral.h b/Libs/AST/Include/AST/Components/CLiteral.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CLiteral.h rename to Libs/AST/Include/AST/Components/CLiteral.h diff --git a/Libs/Framework/Include/AST/Components/CLiteralBool.h b/Libs/AST/Include/AST/Components/CLiteralBool.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CLiteralBool.h rename to Libs/AST/Include/AST/Components/CLiteralBool.h diff --git a/Libs/Framework/Include/AST/Components/CLiteralFloating.h b/Libs/AST/Include/AST/Components/CLiteralFloating.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CLiteralFloating.h rename to Libs/AST/Include/AST/Components/CLiteralFloating.h diff --git a/Libs/Framework/Include/AST/Components/CLiteralIntegral.h b/Libs/AST/Include/AST/Components/CLiteralIntegral.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CLiteralIntegral.h rename to Libs/AST/Include/AST/Components/CLiteralIntegral.h diff --git a/Libs/Framework/Include/AST/Components/CLiteralString.h b/Libs/AST/Include/AST/Components/CLiteralString.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CLiteralString.h rename to Libs/AST/Include/AST/Components/CLiteralString.h diff --git a/Libs/Framework/Include/AST/Components/CModule.h b/Libs/AST/Include/AST/Components/CModule.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CModule.h rename to Libs/AST/Include/AST/Components/CModule.h diff --git a/Libs/Framework/Include/AST/Components/CNamespace.h b/Libs/AST/Include/AST/Components/CNamespace.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CNamespace.h rename to Libs/AST/Include/AST/Components/CNamespace.h diff --git a/Libs/Framework/Include/AST/Components/CProject.h b/Libs/AST/Include/AST/Components/CProject.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CProject.h rename to Libs/AST/Include/AST/Components/CProject.h diff --git a/Libs/Framework/Include/AST/Components/CStatement.h b/Libs/AST/Include/AST/Components/CStatement.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CStatement.h rename to Libs/AST/Include/AST/Components/CStatement.h diff --git a/Libs/Framework/Include/AST/Components/CStmtFor.h b/Libs/AST/Include/AST/Components/CStmtFor.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CStmtFor.h rename to Libs/AST/Include/AST/Components/CStmtFor.h diff --git a/Libs/Framework/Include/AST/Components/CStmtIf.h b/Libs/AST/Include/AST/Components/CStmtIf.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CStmtIf.h rename to Libs/AST/Include/AST/Components/CStmtIf.h diff --git a/Libs/Framework/Include/AST/Components/CStmtInput.h b/Libs/AST/Include/AST/Components/CStmtInput.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CStmtInput.h rename to Libs/AST/Include/AST/Components/CStmtInput.h diff --git a/Libs/Framework/Include/AST/Components/CStmtOutputs.h b/Libs/AST/Include/AST/Components/CStmtOutputs.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CStmtOutputs.h rename to Libs/AST/Include/AST/Components/CStmtOutputs.h diff --git a/Libs/Framework/Include/AST/Components/CStmtReturn.h b/Libs/AST/Include/AST/Components/CStmtReturn.h similarity index 100% rename from Libs/Framework/Include/AST/Components/CStmtReturn.h rename to Libs/AST/Include/AST/Components/CStmtReturn.h diff --git a/Libs/Framework/Include/AST/Components/Tags/CChanged.h b/Libs/AST/Include/AST/Components/Tags/CChanged.h similarity index 100% rename from Libs/Framework/Include/AST/Components/Tags/CChanged.h rename to Libs/AST/Include/AST/Components/Tags/CChanged.h diff --git a/Libs/Framework/Include/AST/Components/Tags/CDirty.h b/Libs/AST/Include/AST/Components/Tags/CDirty.h similarity index 100% rename from Libs/Framework/Include/AST/Components/Tags/CDirty.h rename to Libs/AST/Include/AST/Components/Tags/CDirty.h diff --git a/Libs/Framework/Include/AST/Components/Tags/CInvalid.h b/Libs/AST/Include/AST/Components/Tags/CInvalid.h similarity index 100% rename from Libs/Framework/Include/AST/Components/Tags/CInvalid.h rename to Libs/AST/Include/AST/Components/Tags/CInvalid.h diff --git a/Libs/Framework/Include/AST/Components/Tags/CPendingLoad.h b/Libs/AST/Include/AST/Components/Tags/CPendingLoad.h similarity index 100% rename from Libs/Framework/Include/AST/Components/Tags/CPendingLoad.h rename to Libs/AST/Include/AST/Components/Tags/CPendingLoad.h diff --git a/Libs/Framework/Include/AST/Components/Views/CNodePosition.h b/Libs/AST/Include/AST/Components/Views/CNodePosition.h similarity index 100% rename from Libs/Framework/Include/AST/Components/Views/CNodePosition.h rename to Libs/AST/Include/AST/Components/Views/CNodePosition.h diff --git a/Libs/Framework/Include/AST/Id.h b/Libs/AST/Include/AST/Id.h similarity index 100% rename from Libs/Framework/Include/AST/Id.h rename to Libs/AST/Include/AST/Id.h diff --git a/Libs/Framework/Include/AST/Statics/SLoadQueue.h b/Libs/AST/Include/AST/Statics/SLoadQueue.h similarity index 100% rename from Libs/Framework/Include/AST/Statics/SLoadQueue.h rename to Libs/AST/Include/AST/Statics/SLoadQueue.h diff --git a/Libs/Framework/Include/AST/Statics/SModules.h b/Libs/AST/Include/AST/Statics/SModules.h similarity index 100% rename from Libs/Framework/Include/AST/Statics/SModules.h rename to Libs/AST/Include/AST/Statics/SModules.h diff --git a/Libs/Framework/Include/AST/Statics/SStringLoad.h b/Libs/AST/Include/AST/Statics/SStringLoad.h similarity index 100% rename from Libs/Framework/Include/AST/Statics/SStringLoad.h rename to Libs/AST/Include/AST/Statics/SStringLoad.h diff --git a/Libs/Framework/Include/AST/Statics/STypes.h b/Libs/AST/Include/AST/Statics/STypes.h similarity index 100% rename from Libs/Framework/Include/AST/Statics/STypes.h rename to Libs/AST/Include/AST/Statics/STypes.h diff --git a/Libs/Framework/Include/AST/Systems/FunctionsSystem.h b/Libs/AST/Include/AST/Systems/FunctionsSystem.h similarity index 100% rename from Libs/Framework/Include/AST/Systems/FunctionsSystem.h rename to Libs/AST/Include/AST/Systems/FunctionsSystem.h diff --git a/Libs/Framework/Include/AST/Systems/LoadSystem.h b/Libs/AST/Include/AST/Systems/LoadSystem.h similarity index 100% rename from Libs/Framework/Include/AST/Systems/LoadSystem.h rename to Libs/AST/Include/AST/Systems/LoadSystem.h diff --git a/Libs/Framework/Include/AST/Systems/TransactionSystem.h b/Libs/AST/Include/AST/Systems/TransactionSystem.h similarity index 100% rename from Libs/Framework/Include/AST/Systems/TransactionSystem.h rename to Libs/AST/Include/AST/Systems/TransactionSystem.h diff --git a/Libs/Framework/Include/AST/Systems/TypeSystem.h b/Libs/AST/Include/AST/Systems/TypeSystem.h similarity index 100% rename from Libs/Framework/Include/AST/Systems/TypeSystem.h rename to Libs/AST/Include/AST/Systems/TypeSystem.h diff --git a/Libs/Framework/Include/AST/Tree.h b/Libs/AST/Include/AST/Tree.h similarity index 100% rename from Libs/Framework/Include/AST/Tree.h rename to Libs/AST/Include/AST/Tree.h diff --git a/Libs/Framework/Include/AST/TypeRef.h b/Libs/AST/Include/AST/TypeRef.h similarity index 100% rename from Libs/Framework/Include/AST/TypeRef.h rename to Libs/AST/Include/AST/TypeRef.h diff --git a/Libs/Framework/Include/AST/Utils/Expressions.h b/Libs/AST/Include/AST/Utils/Expressions.h similarity index 100% rename from Libs/Framework/Include/AST/Utils/Expressions.h rename to Libs/AST/Include/AST/Utils/Expressions.h diff --git a/Libs/Framework/Include/AST/Utils/ModuleIterator.h b/Libs/AST/Include/AST/Utils/ModuleIterator.h similarity index 100% rename from Libs/Framework/Include/AST/Utils/ModuleIterator.h rename to Libs/AST/Include/AST/Utils/ModuleIterator.h diff --git a/Libs/Framework/Include/AST/Utils/ModuleUtils.h b/Libs/AST/Include/AST/Utils/ModuleUtils.h similarity index 100% rename from Libs/Framework/Include/AST/Utils/ModuleUtils.h rename to Libs/AST/Include/AST/Utils/ModuleUtils.h diff --git a/Libs/Framework/Include/AST/Utils/Namespaces.h b/Libs/AST/Include/AST/Utils/Namespaces.h similarity index 100% rename from Libs/Framework/Include/AST/Utils/Namespaces.h rename to Libs/AST/Include/AST/Utils/Namespaces.h diff --git a/Libs/Framework/Include/AST/Utils/Paths.h b/Libs/AST/Include/AST/Utils/Paths.h similarity index 100% rename from Libs/Framework/Include/AST/Utils/Paths.h rename to Libs/AST/Include/AST/Utils/Paths.h diff --git a/Libs/Framework/Include/AST/Utils/Statements.h b/Libs/AST/Include/AST/Utils/Statements.h similarity index 100% rename from Libs/Framework/Include/AST/Utils/Statements.h rename to Libs/AST/Include/AST/Utils/Statements.h diff --git a/Libs/Framework/Include/AST/Utils/TransactionUtils.h b/Libs/AST/Include/AST/Utils/TransactionUtils.h similarity index 100% rename from Libs/Framework/Include/AST/Utils/TransactionUtils.h rename to Libs/AST/Include/AST/Utils/TransactionUtils.h diff --git a/Libs/Framework/Include/AST/Utils/TypeIterator.h b/Libs/AST/Include/AST/Utils/TypeIterator.h similarity index 100% rename from Libs/Framework/Include/AST/Utils/TypeIterator.h rename to Libs/AST/Include/AST/Utils/TypeIterator.h diff --git a/Libs/Framework/Include/AST/Utils/TypeUtils.h b/Libs/AST/Include/AST/Utils/TypeUtils.h similarity index 100% rename from Libs/Framework/Include/AST/Utils/TypeUtils.h rename to Libs/AST/Include/AST/Utils/TypeUtils.h diff --git a/Libs/Framework/Include/FrameworkModule.h b/Libs/AST/Include/ASTModule.h similarity index 81% rename from Libs/Framework/Include/FrameworkModule.h rename to Libs/AST/Include/ASTModule.h index 267082ff..0bf2869d 100644 --- a/Libs/Framework/Include/FrameworkModule.h +++ b/Libs/AST/Include/ASTModule.h @@ -12,9 +12,9 @@ namespace rift class Tree; } - class FrameworkModule : public Module + class ASTModule : public Module { - CLASS(FrameworkModule, Module) + CLASS(ASTModule, Module) public: static const p::Tag structType; diff --git a/Libs/Framework/Include/Compiler/Backend.h b/Libs/AST/Include/Compiler/Backend.h similarity index 100% rename from Libs/Framework/Include/Compiler/Backend.h rename to Libs/AST/Include/Compiler/Backend.h diff --git a/Libs/Framework/Include/Compiler/Compiler.h b/Libs/AST/Include/Compiler/Compiler.h similarity index 100% rename from Libs/Framework/Include/Compiler/Compiler.h rename to Libs/AST/Include/Compiler/Compiler.h diff --git a/Libs/Framework/Include/Compiler/CompilerConfig.h b/Libs/AST/Include/Compiler/CompilerConfig.h similarity index 100% rename from Libs/Framework/Include/Compiler/CompilerConfig.h rename to Libs/AST/Include/Compiler/CompilerConfig.h diff --git a/Libs/Framework/Include/Compiler/Systems/OptimizationSystem.h b/Libs/AST/Include/Compiler/Systems/OptimizationSystem.h similarity index 100% rename from Libs/Framework/Include/Compiler/Systems/OptimizationSystem.h rename to Libs/AST/Include/Compiler/Systems/OptimizationSystem.h diff --git a/Libs/Framework/Include/Compiler/Utils/BackendUtils.h b/Libs/AST/Include/Compiler/Utils/BackendUtils.h similarity index 100% rename from Libs/Framework/Include/Compiler/Utils/BackendUtils.h rename to Libs/AST/Include/Compiler/Utils/BackendUtils.h diff --git a/Libs/Framework/Include/Module.h b/Libs/AST/Include/Module.h similarity index 100% rename from Libs/Framework/Include/Module.h rename to Libs/AST/Include/Module.h diff --git a/Libs/Framework/Include/Rift.h b/Libs/AST/Include/Rift.h similarity index 100% rename from Libs/Framework/Include/Rift.h rename to Libs/AST/Include/Rift.h diff --git a/Libs/Framework/Include/View.h b/Libs/AST/Include/View.h similarity index 100% rename from Libs/Framework/Include/View.h rename to Libs/AST/Include/View.h diff --git a/Libs/Framework/Src/AST/Components/CNamespace.cpp b/Libs/AST/Src/AST/Components/CNamespace.cpp similarity index 100% rename from Libs/Framework/Src/AST/Components/CNamespace.cpp rename to Libs/AST/Src/AST/Components/CNamespace.cpp diff --git a/Libs/Framework/Src/AST/Systems/FunctionsSystem.cpp b/Libs/AST/Src/AST/Systems/FunctionsSystem.cpp similarity index 100% rename from Libs/Framework/Src/AST/Systems/FunctionsSystem.cpp rename to Libs/AST/Src/AST/Systems/FunctionsSystem.cpp diff --git a/Libs/Framework/Src/AST/Systems/LoadSystem.cpp b/Libs/AST/Src/AST/Systems/LoadSystem.cpp similarity index 100% rename from Libs/Framework/Src/AST/Systems/LoadSystem.cpp rename to Libs/AST/Src/AST/Systems/LoadSystem.cpp diff --git a/Libs/Framework/Src/AST/Systems/TransactionSystem.cpp b/Libs/AST/Src/AST/Systems/TransactionSystem.cpp similarity index 100% rename from Libs/Framework/Src/AST/Systems/TransactionSystem.cpp rename to Libs/AST/Src/AST/Systems/TransactionSystem.cpp diff --git a/Libs/Framework/Src/AST/Systems/TypeSystem.cpp b/Libs/AST/Src/AST/Systems/TypeSystem.cpp similarity index 100% rename from Libs/Framework/Src/AST/Systems/TypeSystem.cpp rename to Libs/AST/Src/AST/Systems/TypeSystem.cpp diff --git a/Libs/Framework/Src/AST/Tree.cpp b/Libs/AST/Src/AST/Tree.cpp similarity index 100% rename from Libs/Framework/Src/AST/Tree.cpp rename to Libs/AST/Src/AST/Tree.cpp diff --git a/Libs/Framework/Src/AST/Utils/Expressions.cpp b/Libs/AST/Src/AST/Utils/Expressions.cpp similarity index 100% rename from Libs/Framework/Src/AST/Utils/Expressions.cpp rename to Libs/AST/Src/AST/Utils/Expressions.cpp diff --git a/Libs/Framework/Src/AST/Utils/ModuleUtils.cpp b/Libs/AST/Src/AST/Utils/ModuleUtils.cpp similarity index 100% rename from Libs/Framework/Src/AST/Utils/ModuleUtils.cpp rename to Libs/AST/Src/AST/Utils/ModuleUtils.cpp diff --git a/Libs/Framework/Src/AST/Utils/Namespaces.cpp b/Libs/AST/Src/AST/Utils/Namespaces.cpp similarity index 100% rename from Libs/Framework/Src/AST/Utils/Namespaces.cpp rename to Libs/AST/Src/AST/Utils/Namespaces.cpp diff --git a/Libs/Framework/Src/AST/Utils/Statements.cpp b/Libs/AST/Src/AST/Utils/Statements.cpp similarity index 100% rename from Libs/Framework/Src/AST/Utils/Statements.cpp rename to Libs/AST/Src/AST/Utils/Statements.cpp diff --git a/Libs/Framework/Src/AST/Utils/TransactionUtils.cpp b/Libs/AST/Src/AST/Utils/TransactionUtils.cpp similarity index 100% rename from Libs/Framework/Src/AST/Utils/TransactionUtils.cpp rename to Libs/AST/Src/AST/Utils/TransactionUtils.cpp diff --git a/Libs/Framework/Src/AST/Utils/TypeUtils.cpp b/Libs/AST/Src/AST/Utils/TypeUtils.cpp similarity index 99% rename from Libs/Framework/Src/AST/Utils/TypeUtils.cpp rename to Libs/AST/Src/AST/Utils/TypeUtils.cpp index 11ca1cec..b36862ab 100644 --- a/Libs/Framework/Src/AST/Utils/TypeUtils.cpp +++ b/Libs/AST/Src/AST/Utils/TypeUtils.cpp @@ -27,7 +27,7 @@ #include "AST/Utils/Namespaces.h" #include "AST/Utils/Paths.h" #include "AST/Utils/TransactionUtils.h" -#include "FrameworkModule.h" +#include "ASTModule.h" #include "Rift.h" #include diff --git a/Libs/Framework/Src/FrameworkModule.cpp b/Libs/AST/Src/ASTModule.cpp similarity index 80% rename from Libs/Framework/Src/FrameworkModule.cpp rename to Libs/AST/Src/ASTModule.cpp index dee8dead..39542e49 100644 --- a/Libs/Framework/Src/FrameworkModule.cpp +++ b/Libs/AST/Src/ASTModule.cpp @@ -1,6 +1,6 @@ // Copyright 2015-2023 Piperift - All rights reserved -#include "FrameworkModule.h" +#include "ASTModule.h" #include "AST/Components/CDeclClass.h" #include "AST/Components/CDeclStatic.h" @@ -13,12 +13,12 @@ namespace rift { - const p::Tag FrameworkModule::structType = "Struct"; - const p::Tag FrameworkModule::classType = "Class"; - const p::Tag FrameworkModule::staticType = "Static"; + const p::Tag ASTModule::structType = "Struct"; + const p::Tag ASTModule::classType = "Class"; + const p::Tag ASTModule::staticType = "Static"; - void FrameworkModule::Load() + void ASTModule::Load() { AST::RegisterFileType( structType, {.displayName = "Struct", .hasVariables = true, .hasFunctions = false}); diff --git a/Libs/Framework/Src/Compiler/Compiler.cpp b/Libs/AST/Src/Compiler/Compiler.cpp similarity index 100% rename from Libs/Framework/Src/Compiler/Compiler.cpp rename to Libs/AST/Src/Compiler/Compiler.cpp diff --git a/Libs/Framework/Src/Compiler/CompilerConfig.cpp b/Libs/AST/Src/Compiler/CompilerConfig.cpp similarity index 100% rename from Libs/Framework/Src/Compiler/CompilerConfig.cpp rename to Libs/AST/Src/Compiler/CompilerConfig.cpp diff --git a/Libs/Framework/Src/Compiler/Systems/OptimizationSystem.cpp b/Libs/AST/Src/Compiler/Systems/OptimizationSystem.cpp similarity index 100% rename from Libs/Framework/Src/Compiler/Systems/OptimizationSystem.cpp rename to Libs/AST/Src/Compiler/Systems/OptimizationSystem.cpp diff --git a/Libs/Framework/Src/Compiler/Utils/BackendUtils.cpp b/Libs/AST/Src/Compiler/Utils/BackendUtils.cpp similarity index 100% rename from Libs/Framework/Src/Compiler/Utils/BackendUtils.cpp rename to Libs/AST/Src/Compiler/Utils/BackendUtils.cpp diff --git a/Libs/Framework/Src/Module.cpp b/Libs/AST/Src/Module.cpp similarity index 100% rename from Libs/Framework/Src/Module.cpp rename to Libs/AST/Src/Module.cpp diff --git a/Libs/Framework/Src/Rift.cpp b/Libs/AST/Src/Rift.cpp similarity index 100% rename from Libs/Framework/Src/Rift.cpp rename to Libs/AST/Src/Rift.cpp diff --git a/Libs/Backends/LLVM/CMakeLists.txt b/Libs/Backends/LLVM/CMakeLists.txt index 15b17fc0..8b0f9de6 100644 --- a/Libs/Backends/LLVM/CMakeLists.txt +++ b/Libs/Backends/LLVM/CMakeLists.txt @@ -3,7 +3,7 @@ add_library(RiftBackendLLVM STATIC) rift_compiler_module(RiftBackendLLVM) -target_link_libraries(RiftBackendLLVM PUBLIC Rift) +target_link_libraries(RiftBackendLLVM PUBLIC RiftAST) target_link_libraries(RiftBackendLLVM PRIVATE RiftLLVM RiftBindingNative diff --git a/Libs/Backends/MIR/CMakeLists.txt b/Libs/Backends/MIR/CMakeLists.txt index 720226f2..c2798038 100644 --- a/Libs/Backends/MIR/CMakeLists.txt +++ b/Libs/Backends/MIR/CMakeLists.txt @@ -3,7 +3,7 @@ add_library(RiftBackendMIR STATIC) rift_compiler_module(RiftBackendMIR) -target_link_libraries(RiftBackendMIR PUBLIC Rift) +target_link_libraries(RiftBackendMIR PUBLIC RiftAST) target_link_libraries(RiftBackendMIR PRIVATE mir_static RiftBindingNative diff --git a/Libs/Bindings/Native/CMakeLists.txt b/Libs/Bindings/Native/CMakeLists.txt index 949d8721..f71a7696 100644 --- a/Libs/Bindings/Native/CMakeLists.txt +++ b/Libs/Bindings/Native/CMakeLists.txt @@ -3,7 +3,7 @@ add_library(RiftBindingNative STATIC) -target_link_libraries(RiftBindingNative PUBLIC Rift) +target_link_libraries(RiftBindingNative PUBLIC RiftAST) target_link_libraries(RiftBindingNative PRIVATE RiftClang) rift_compiler_module(RiftBindingNative) diff --git a/Libs/CMakeLists.txt b/Libs/CMakeLists.txt index 38840940..90036f0a 100644 --- a/Libs/CMakeLists.txt +++ b/Libs/CMakeLists.txt @@ -1,9 +1,6 @@ # Copyright 2015-2023 Piperift - All rights reserved -set(PIPE_BUILD_TESTS ${RIFT_BUILD_TESTS} CACHE BOOL "Build Pipe tests") -add_subdirectory(Pipe) - -add_subdirectory(Framework) +add_subdirectory(AST) add_subdirectory(Backends/LLVM) add_subdirectory(Backends/MIR) add_subdirectory(Bindings/Native) diff --git a/Libs/Editor/CMakeLists.txt b/Libs/Editor/CMakeLists.txt index 480af04b..514b0359 100644 --- a/Libs/Editor/CMakeLists.txt +++ b/Libs/Editor/CMakeLists.txt @@ -7,7 +7,7 @@ file(GLOB_RECURSE RiftEditor_SOURCE_FILES CONFIGURE_DEPENDS Src/*.cpp Src/*.h) target_sources(RiftEditor PRIVATE ${RiftEditor_SOURCE_FILES}) target_link_libraries(RiftEditor PUBLIC - Rift + RiftAST RiftBackendLLVM RiftBackendMIR RiftUI diff --git a/Libs/Framework/CMakeLists.txt b/Libs/Framework/CMakeLists.txt deleted file mode 100644 index 315112af..00000000 --- a/Libs/Framework/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2015-2023 Piperift - All rights reserved - -add_library(Rift STATIC) -target_include_directories(Rift PUBLIC Include) - -file(GLOB_RECURSE FRAMEWORK_SOURCE_FILES CONFIGURE_DEPENDS Src/*.cpp Src/*.h) -target_sources(Rift PRIVATE ${FRAMEWORK_SOURCE_FILES}) - -target_link_libraries(Rift PUBLIC - Pipe - Taskflow - RiftBindingNative -) - -rift_module(Rift) -set_target_properties (Rift PROPERTIES FOLDER Rift) diff --git a/Libs/Views/Graph/CMakeLists.txt b/Libs/Views/Graph/CMakeLists.txt index 80378500..81ae9962 100644 --- a/Libs/Views/Graph/CMakeLists.txt +++ b/Libs/Views/Graph/CMakeLists.txt @@ -2,7 +2,7 @@ add_library(RiftViewGraph STATIC) rift_compiler_module(RiftViewGraph) -target_link_libraries(RiftViewGraph PUBLIC Rift) +target_link_libraries(RiftViewGraph PUBLIC RiftAST) add_library(RiftViewGraphEditor STATIC) rift_editor_module(RiftViewGraphEditor) diff --git a/Libs/Views/Graph/Compiler/Include/GraphViewModule.h b/Libs/Views/Graph/Compiler/Include/GraphViewModule.h index ae8afc45..20e27bc6 100644 --- a/Libs/Views/Graph/Compiler/Include/GraphViewModule.h +++ b/Libs/Views/Graph/Compiler/Include/GraphViewModule.h @@ -2,13 +2,14 @@ #pragma once +#include #include -#include #include #include #include + namespace rift { class GraphViewModule : public Module diff --git a/Libs/Views/Graph/Compiler/Src/GraphViewModule.cpp b/Libs/Views/Graph/Compiler/Src/GraphViewModule.cpp index a730fae8..d65e5ea2 100644 --- a/Libs/Views/Graph/Compiler/Src/GraphViewModule.cpp +++ b/Libs/Views/Graph/Compiler/Src/GraphViewModule.cpp @@ -9,7 +9,7 @@ namespace rift { RegisterView(View{ .name = "Graph", - .supportedTypes = {FrameworkModule::classType, FrameworkModule::structType}, + .supportedTypes = {ASTModule::classType, ASTModule::structType}, .onDrawEditor = &GraphViewModule::DrawEditor }); } diff --git a/Tests/AST/Namespaces.spec.cpp b/Tests/AST/Namespaces.spec.cpp index d3b12751..fe973c53 100644 --- a/Tests/AST/Namespaces.spec.cpp +++ b/Tests/AST/Namespaces.spec.cpp @@ -4,9 +4,10 @@ #include #include #include +#include #include #include -#include + using namespace snowhouse; @@ -25,7 +26,7 @@ go_bandit([]() { AST::GetNamespace(ast, functionId).ToString().c_str(), Equals("@TestFunction")); AssertThat(AST::GetParentNamespace(ast, functionId).ToString().c_str(), Equals("")); - AST::Id classBId = AST::CreateType(ast, FrameworkModule::classType, "TestClass"); + AST::Id classBId = AST::CreateType(ast, ASTModule::classType, "TestClass"); AST::Id functionBId = AST::AddFunction({ast, classBId}, "TestFunction"); AssertThat(AST::GetNamespace(ast, functionBId).ToString().c_str(), Equals("@TestClass.TestFunction")); @@ -35,7 +36,7 @@ go_bandit([]() { AST::Id parentC = ast.Create(); ast.Add(parentC); ast.Add(parentC, AST::CNamespace{"SomeScope"}); - AST::Id classCId = AST::CreateType(ast, FrameworkModule::classType, "TestClass"); + AST::Id classCId = AST::CreateType(ast, ASTModule::classType, "TestClass"); p::Attach(ast, parentC, classCId); AST::Id functionCId = AST::AddFunction({ast, classCId}, "TestFunction"); AssertThat(AST::GetNamespace(ast, functionCId).ToString().c_str(), @@ -50,7 +51,7 @@ go_bandit([]() { AST::Id parent = ast.Create(); ast.Add(parent); ast.Add(parent, AST::CNamespace{"SomeModule"}); - AST::Id classId = AST::CreateType(ast, FrameworkModule::classType, "TestClass"); + AST::Id classId = AST::CreateType(ast, ASTModule::classType, "TestClass"); p::Attach(ast, parent, classId); AST::Id functionId = AST::AddFunction({ast, classId}, "TestFunction"); p::String ns = AST::GetNamespace(ast, functionId).ToString(true); @@ -105,10 +106,10 @@ go_bandit([]() { ast.Add(parent); ast.Add(parent, AST::CNamespace{"A"}); - AST::Id classId = AST::CreateType(ast, FrameworkModule::classType, "B"); + AST::Id classId = AST::CreateType(ast, ASTModule::classType, "B"); p::Attach(ast, parent, classId); - AST::Id class2Id = AST::CreateType(ast, FrameworkModule::classType, "B2"); + AST::Id class2Id = AST::CreateType(ast, ASTModule::classType, "B2"); p::Attach(ast, parent, class2Id); AST::Id functionId = AST::AddFunction({ast, classId}, "C"); diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index f20d6041..84c8b53b 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -5,6 +5,6 @@ add_executable(RiftTests ${TESTS_SOURCE_FILES}) rift_module(RiftTests) pipe_target_shared_output_directory(RiftTests) target_include_directories(RiftTests PUBLIC .) -target_link_libraries(RiftTests PUBLIC Rift Bandit) +target_link_libraries(RiftTests PUBLIC RiftAST Bandit) add_test(NAME RiftTests COMMAND $)