Browse Source

Moved Builder source code to a new folder.

David Piuva 3 years ago
parent
commit
2e316e17fa

+ 1 - 1
Source/tools/builder/buildProject.bat

@@ -14,7 +14,7 @@ set BUILDER_EXECUTABLE=%BUILDER_FOLDER%builder.exe
 echo BUILDER_EXECUTABLE = %BUILDER_EXECUTABLE%
 set DFPSR_LIBRARY=%BUILDER_FOLDER%..\..\DFPSR
 echo DFPSR_LIBRARY = %DFPSR_LIBRARY%
-set BUILDER_SOURCE=%BUILDER_FOLDER%\main.cpp %BUILDER_FOLDER%\Machine.cpp %BUILDER_FOLDER%\generator.cpp %BUILDER_FOLDER%\analyzer.cpp %BUILDER_FOLDER%\expression.cpp %DFPSR_LIBRARY%\collection\collections.cpp %DFPSR_LIBRARY%\api\fileAPI.cpp %DFPSR_LIBRARY%\api\bufferAPI.cpp %DFPSR_LIBRARY%\api\stringAPI.cpp %DFPSR_LIBRARY%\base\SafePointer.cpp
+set BUILDER_SOURCE=%BUILDER_FOLDER%\code\main.cpp %BUILDER_FOLDER%\code\Machine.cpp %BUILDER_FOLDER%\code\generator.cpp %BUILDER_FOLDER%\code\analyzer.cpp %BUILDER_FOLDER%\code\expression.cpp %DFPSR_LIBRARY%\collection\collections.cpp %DFPSR_LIBRARY%\api\fileAPI.cpp %DFPSR_LIBRARY%\api\bufferAPI.cpp %DFPSR_LIBRARY%\api\stringAPI.cpp %DFPSR_LIBRARY%\base\SafePointer.cpp
 echo BUILDER_SOURCE = %BUILDER_SOURCE%
 
 set CPP_COMPILER_FOLDER=C:\Program\CodeBlocks\MinGW\bin

+ 1 - 1
Source/tools/builder/buildProject.sh

@@ -20,7 +20,7 @@ if [ -e "${BUILDER_EXECUTABLE}" ]; then
 else
 	echo "Building the Builder build system for first time use."
 	LIBRARY_PATH="$(realpath ${BUILDER_FOLDER}/../../DFPSR)"
-	SOURCE_CODE="${BUILDER_FOLDER}/main.cpp ${BUILDER_FOLDER}/Machine.cpp ${BUILDER_FOLDER}/generator.cpp ${BUILDER_FOLDER}/analyzer.cpp ${BUILDER_FOLDER}/expression.cpp ${LIBRARY_PATH}/collection/collections.cpp ${LIBRARY_PATH}/api/fileAPI.cpp ${LIBRARY_PATH}/api/bufferAPI.cpp ${LIBRARY_PATH}/api/stringAPI.cpp ${LIBRARY_PATH}/base/SafePointer.cpp"
+	SOURCE_CODE="${BUILDER_FOLDER}/code/main.cpp ${BUILDER_FOLDER}/code/Machine.cpp ${BUILDER_FOLDER}/code/generator.cpp ${BUILDER_FOLDER}/code/analyzer.cpp ${BUILDER_FOLDER}/code/expression.cpp ${LIBRARY_PATH}/collection/collections.cpp ${LIBRARY_PATH}/api/fileAPI.cpp ${LIBRARY_PATH}/api/bufferAPI.cpp ${LIBRARY_PATH}/api/stringAPI.cpp ${LIBRARY_PATH}/base/SafePointer.cpp"
 	"${CPP_COMPILER_PATH}" -o "${BUILDER_EXECUTABLE}" ${SOURCE_CODE} -std=c++14
 	if [ $? -eq 0 ]; then
 		echo "Completed building the Builder build system."

+ 3 - 1
Source/tools/builder/Machine.cpp → Source/tools/builder/code/Machine.cpp

@@ -1,7 +1,7 @@
 
 #include "Machine.h"
 #include "expression.h"
-#include "../../DFPSR/api/fileAPI.h"
+#include "../../../DFPSR/api/fileAPI.h"
 
 using namespace dsr;
 
@@ -169,6 +169,8 @@ void evaluateScript(SessionContext &output, Machine &target, const ReadableStrin
 	bool commented = false;
 	for (int64_t i = 0; i <= string_length(projectContent); i++) {
 		DsrChar c = projectContent[i];
+		// Treat end of file as a linebreak to simplify tokenization rules.
+		if (c == U'\0') c == U'\n';
 		// The null terminator does not really exist in projectContent,
 		//   but dsr::String returns a null character safely when requesting a character out of bound,
 		//   which allow interpreting the last line without duplicating code.

+ 1 - 1
Source/tools/builder/Machine.h → Source/tools/builder/code/Machine.h

@@ -2,7 +2,7 @@
 #ifndef DSR_BUILDER_MACHINE_MODULE
 #define DSR_BUILDER_MACHINE_MODULE
 
-#include "../../DFPSR/api/stringAPI.h"
+#include "../../../DFPSR/api/stringAPI.h"
 #include "builderTypes.h"
 
 using namespace dsr;

+ 0 - 0
Source/tools/builder/analyzer.cpp → Source/tools/builder/code/analyzer.cpp


+ 1 - 1
Source/tools/builder/analyzer.h → Source/tools/builder/code/analyzer.h

@@ -2,7 +2,7 @@
 #ifndef DSR_BUILDER_ANALYZER_MODULE
 #define DSR_BUILDER_ANALYZER_MODULE
 
-#include "../../DFPSR/api/fileAPI.h"
+#include "../../../DFPSR/api/fileAPI.h"
 #include "builderTypes.h"
 
 using namespace dsr;

+ 1 - 1
Source/tools/builder/builderTypes.h → Source/tools/builder/code/builderTypes.h

@@ -2,7 +2,7 @@
 #ifndef DSR_BUILDER_TYPES
 #define DSR_BUILDER_TYPES
 
-#include "../../DFPSR/api/stringAPI.h"
+#include "../../../DFPSR/api/stringAPI.h"
 
 using namespace dsr;
 

+ 1 - 1
Source/tools/builder/expression.cpp → Source/tools/builder/code/expression.cpp

@@ -1,6 +1,6 @@
 
 #include "expression.h"
-#include "../../DFPSR/api/stringAPI.h"
+#include "../../../DFPSR/api/stringAPI.h"
 
 using namespace dsr;
 

+ 1 - 1
Source/tools/builder/expression.h → Source/tools/builder/code/expression.h

@@ -2,7 +2,7 @@
 #ifndef DSR_BUILDER_EXPRESSION_MODULE
 #define DSR_BUILDER_EXPRESSION_MODULE
 
-#include "../../DFPSR/api/stringAPI.h"
+#include "../../../DFPSR/api/stringAPI.h"
 
 // The expression module is a slow but generic system for evaluating expressions where all data is stored as strings for simplicity.
 //   No decimal numbers allowed, because it requires both human readable syntax and full determinism without precision loss.

+ 0 - 0
Source/tools/builder/generator.cpp → Source/tools/builder/code/generator.cpp


+ 1 - 1
Source/tools/builder/generator.h → Source/tools/builder/code/generator.h

@@ -2,7 +2,7 @@
 #ifndef DSR_BUILDER_GENERATOR_MODULE
 #define DSR_BUILDER_GENERATOR_MODULE
 
-#include "../../DFPSR/api/fileAPI.h"
+#include "../../../DFPSR/api/fileAPI.h"
 #include "builderTypes.h"
 
 using namespace dsr;

+ 1 - 1
Source/tools/builder/main.cpp → Source/tools/builder/code/main.cpp

@@ -65,7 +65,7 @@ Project files:
 		* Optimization, a natural integer specifying the amount of optimization to apply.
 */
 
-#include "../../DFPSR/api/fileAPI.h"
+#include "../../../DFPSR/api/fileAPI.h"
 #include "Machine.h"
 #include "expression.h"
 #include "analyzer.h"