From 0a7c2c0145148b1411a9408083c20baffbcc1b03 Mon Sep 17 00:00:00 2001
From: Pasha Bibko <156938226+PashaBibko@users.noreply.github.com>
Date: Tue, 22 Apr 2025 11:17:34 +0100
Subject: [PATCH] Organized project files
---
Common/Common.vcxproj.filters | 21 ----------
.../IR-Generator.vcxproj | 33 +++++++++++----
IR-Generator/IR-Generator.vcxproj.filters | 38 +++++++++++++++++
{Common => IR-Generator/inc}/Console.h | 0
{common => IR-Generator/inc}/LLVM.h | 0
{common => IR-Generator/inc}/Lexer.h | 0
{common => IR-Generator/inc}/Parser.h | 0
{common => IR-Generator/inc}/Util.h | 0
{Common => IR-Generator}/src/Console.cpp | 0
.../src/main.cpp | 6 +--
LX-Compiler.sln | 41 +++++++------------
LX-LLVM.vcxproj | 5 +--
LX-LLVM.vcxproj.filters | 6 +--
Lexer/Lexer.vcxproj | 12 +++++-
Parser/Parser.vcxproj | 12 +++++-
build-test/Main.ll | 0
16 files changed, 101 insertions(+), 73 deletions(-)
delete mode 100644 Common/Common.vcxproj.filters
rename Common/Common.vcxproj => IR-Generator/IR-Generator.vcxproj (79%)
create mode 100644 IR-Generator/IR-Generator.vcxproj.filters
rename {Common => IR-Generator/inc}/Console.h (100%)
rename {common => IR-Generator/inc}/LLVM.h (100%)
rename {common => IR-Generator/inc}/Lexer.h (100%)
rename {common => IR-Generator/inc}/Parser.h (100%)
rename {common => IR-Generator/inc}/Util.h (100%)
rename {Common => IR-Generator}/src/Console.cpp (100%)
rename Frontend-Main.cpp => IR-Generator/src/main.cpp (99%)
delete mode 100644 build-test/Main.ll
diff --git a/Common/Common.vcxproj.filters b/Common/Common.vcxproj.filters
deleted file mode 100644
index b18231f..0000000
--- a/Common/Common.vcxproj.filters
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
-
-
-
-
- Source Files
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Common/Common.vcxproj b/IR-Generator/IR-Generator.vcxproj
similarity index 79%
rename from Common/Common.vcxproj
rename to IR-Generator/IR-Generator.vcxproj
index 90b2c99..8db02db 100644
--- a/Common/Common.vcxproj
+++ b/IR-Generator/IR-Generator.vcxproj
@@ -21,8 +21,8 @@
17.0
Win32Proj
- {3125ca11-9f6d-4a4f-afc1-37feb3bbd9fa}
- Common
+ {c88042e2-0e09-4383-93f8-c79f9ee1e897}
+ IRGenerator
10.0
@@ -40,7 +40,7 @@
Unicode
- StaticLibrary
+ Application
true
v143
Unicode
@@ -70,6 +70,14 @@
+
+ $(SolutionDir)bin\$(Platform)\$(Configuration)\
+ $(SolutionDir)bin\inter\$(Platform)\$(Configuration)\$(ProjectName)\
+
+
+ $(SolutionDir)bin\$(Platform)\$(Configuration)\
+ $(SolutionDir)bin\inter\$(Platform)\$(Configuration)\$(ProjectName)\
+
Level3
@@ -104,12 +112,14 @@
true
_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
+ $(ProjectDir)inc;%(AdditionalIncludeDirectories)
stdcpp20
- $(SolutionDir)common;%(AdditionalIncludeDirectories)
Console
true
+ $(SolutionDir)bin\$(Platform)\$(Configuration)
+ Parser.lib;Lexer.lib;ws2_32.lib;%(AdditionalDependencies)
@@ -120,23 +130,28 @@
true
NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
+ $(ProjectDir)inc;%(AdditionalIncludeDirectories)
+ stdcpp20
Console
true
true
true
+ $(SolutionDir)bin\$(Platform)\$(Configuration)
+ Parser.lib;Lexer.lib;ws2_32.lib;%(AdditionalDependencies)
+
-
-
-
-
-
+
+
+
+
+
diff --git a/IR-Generator/IR-Generator.vcxproj.filters b/IR-Generator/IR-Generator.vcxproj.filters
new file mode 100644
index 0000000..5107377
--- /dev/null
+++ b/IR-Generator/IR-Generator.vcxproj.filters
@@ -0,0 +1,38 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+
\ No newline at end of file
diff --git a/Common/Console.h b/IR-Generator/inc/Console.h
similarity index 100%
rename from Common/Console.h
rename to IR-Generator/inc/Console.h
diff --git a/common/LLVM.h b/IR-Generator/inc/LLVM.h
similarity index 100%
rename from common/LLVM.h
rename to IR-Generator/inc/LLVM.h
diff --git a/common/Lexer.h b/IR-Generator/inc/Lexer.h
similarity index 100%
rename from common/Lexer.h
rename to IR-Generator/inc/Lexer.h
diff --git a/common/Parser.h b/IR-Generator/inc/Parser.h
similarity index 100%
rename from common/Parser.h
rename to IR-Generator/inc/Parser.h
diff --git a/common/Util.h b/IR-Generator/inc/Util.h
similarity index 100%
rename from common/Util.h
rename to IR-Generator/inc/Util.h
diff --git a/Common/src/Console.cpp b/IR-Generator/src/Console.cpp
similarity index 100%
rename from Common/src/Console.cpp
rename to IR-Generator/src/Console.cpp
diff --git a/Frontend-Main.cpp b/IR-Generator/src/main.cpp
similarity index 99%
rename from Frontend-Main.cpp
rename to IR-Generator/src/main.cpp
index 80910af..3091ba2 100644
--- a/Frontend-Main.cpp
+++ b/IR-Generator/src/main.cpp
@@ -180,7 +180,7 @@ int main(int argc, char** argv)
LX::PrintStringAsColor(inpPath.filename().string(), LX::Color::WHITE);
std::cout << ":\n";
std::cout << "Line: " << std::setw(lineNumberWidthInConsole) << e.line << " | " << line << "\n";
- std::cout << " " << std::setw(lineNumberWidthInConsole) << "" << " | " << std::setw(e.col);
+ std::cout << " " << std::setw(lineNumberWidthInConsole) << "" << " | " << std::setw(e.col);
LX::PrintStringAsColor("^", LX::Color::LIGHT_RED);
std::cout << "\n";
@@ -197,7 +197,7 @@ int main(int argc, char** argv)
// Gets the line of the error //
std::string line = LX::GetLineAtIndexOf(contents, e.got.index);
-
+
// Prints the error to the console with the relevant info //
std::cout << "\n";
LX::PrintStringAsColor("Error: ", LX::Color::LIGHT_RED);
@@ -233,7 +233,7 @@ int main(int argc, char** argv)
// Default catches any non-specified errors //
catch (...) {}
-
+
// Closes the log if it is open to get as much info as possible //
if (log != nullptr) { log->close(); }
std::cout << "An unknown error occured. Please report this on the github page.\n";
diff --git a/LX-Compiler.sln b/LX-Compiler.sln
index 98e046c..06efb02 100644
--- a/LX-Compiler.sln
+++ b/LX-Compiler.sln
@@ -3,22 +3,17 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.13.35931.197
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Frontend", "LX-LLVM.vcxproj", "{CC37E36F-B3B3-41B0-A887-01E8EFE84994}"
- ProjectSection(ProjectDependencies) = postProject
- {3125CA11-9F6D-4A4F-AFC1-37FEB3BBD9FA} = {3125CA11-9F6D-4A4F-AFC1-37FEB3BBD9FA}
- {4E4019F5-12E0-4EE2-9658-A0DD3038EEDA} = {4E4019F5-12E0-4EE2-9658-A0DD3038EEDA}
- {D6EAFB31-4AFD-4989-9522-D6609AC4ED64} = {D6EAFB31-4AFD-4989-9522-D6609AC4ED64}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lexer", "Lexer\Lexer.vcxproj", "{4E4019F5-12E0-4EE2-9658-A0DD3038EEDA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Frontend-Modules", "Frontend-Modules", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Parser", "Parser\Parser.vcxproj", "{D6EAFB31-4AFD-4989-9522-D6609AC4ED64}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Util", "Util", "{0E83E43A-13FB-422F-B903-96E3E8F74DC2}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "Common\Common.vcxproj", "{3125CA11-9F6D-4A4F-AFC1-37FEB3BBD9FA}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IR-Generator", "IR-Generator\IR-Generator.vcxproj", "{C88042E2-0E09-4383-93F8-C79F9EE1E897}"
+ ProjectSection(ProjectDependencies) = postProject
+ {4E4019F5-12E0-4EE2-9658-A0DD3038EEDA} = {4E4019F5-12E0-4EE2-9658-A0DD3038EEDA}
+ {D6EAFB31-4AFD-4989-9522-D6609AC4ED64} = {D6EAFB31-4AFD-4989-9522-D6609AC4ED64}
+ EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -28,14 +23,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {CC37E36F-B3B3-41B0-A887-01E8EFE84994}.Debug|x64.ActiveCfg = Debug|x64
- {CC37E36F-B3B3-41B0-A887-01E8EFE84994}.Debug|x64.Build.0 = Debug|x64
- {CC37E36F-B3B3-41B0-A887-01E8EFE84994}.Debug|x86.ActiveCfg = Debug|Win32
- {CC37E36F-B3B3-41B0-A887-01E8EFE84994}.Debug|x86.Build.0 = Debug|Win32
- {CC37E36F-B3B3-41B0-A887-01E8EFE84994}.Release|x64.ActiveCfg = Release|x64
- {CC37E36F-B3B3-41B0-A887-01E8EFE84994}.Release|x64.Build.0 = Release|x64
- {CC37E36F-B3B3-41B0-A887-01E8EFE84994}.Release|x86.ActiveCfg = Release|Win32
- {CC37E36F-B3B3-41B0-A887-01E8EFE84994}.Release|x86.Build.0 = Release|Win32
{4E4019F5-12E0-4EE2-9658-A0DD3038EEDA}.Debug|x64.ActiveCfg = Debug|x64
{4E4019F5-12E0-4EE2-9658-A0DD3038EEDA}.Debug|x64.Build.0 = Debug|x64
{4E4019F5-12E0-4EE2-9658-A0DD3038EEDA}.Debug|x86.ActiveCfg = Debug|Win32
@@ -52,14 +39,14 @@ Global
{D6EAFB31-4AFD-4989-9522-D6609AC4ED64}.Release|x64.Build.0 = Release|x64
{D6EAFB31-4AFD-4989-9522-D6609AC4ED64}.Release|x86.ActiveCfg = Release|Win32
{D6EAFB31-4AFD-4989-9522-D6609AC4ED64}.Release|x86.Build.0 = Release|Win32
- {3125CA11-9F6D-4A4F-AFC1-37FEB3BBD9FA}.Debug|x64.ActiveCfg = Debug|x64
- {3125CA11-9F6D-4A4F-AFC1-37FEB3BBD9FA}.Debug|x64.Build.0 = Debug|x64
- {3125CA11-9F6D-4A4F-AFC1-37FEB3BBD9FA}.Debug|x86.ActiveCfg = Debug|Win32
- {3125CA11-9F6D-4A4F-AFC1-37FEB3BBD9FA}.Debug|x86.Build.0 = Debug|Win32
- {3125CA11-9F6D-4A4F-AFC1-37FEB3BBD9FA}.Release|x64.ActiveCfg = Release|x64
- {3125CA11-9F6D-4A4F-AFC1-37FEB3BBD9FA}.Release|x64.Build.0 = Release|x64
- {3125CA11-9F6D-4A4F-AFC1-37FEB3BBD9FA}.Release|x86.ActiveCfg = Release|Win32
- {3125CA11-9F6D-4A4F-AFC1-37FEB3BBD9FA}.Release|x86.Build.0 = Release|Win32
+ {C88042E2-0E09-4383-93F8-C79F9EE1E897}.Debug|x64.ActiveCfg = Debug|x64
+ {C88042E2-0E09-4383-93F8-C79F9EE1E897}.Debug|x64.Build.0 = Debug|x64
+ {C88042E2-0E09-4383-93F8-C79F9EE1E897}.Debug|x86.ActiveCfg = Debug|Win32
+ {C88042E2-0E09-4383-93F8-C79F9EE1E897}.Debug|x86.Build.0 = Debug|Win32
+ {C88042E2-0E09-4383-93F8-C79F9EE1E897}.Release|x64.ActiveCfg = Release|x64
+ {C88042E2-0E09-4383-93F8-C79F9EE1E897}.Release|x64.Build.0 = Release|x64
+ {C88042E2-0E09-4383-93F8-C79F9EE1E897}.Release|x86.ActiveCfg = Release|Win32
+ {C88042E2-0E09-4383-93F8-C79F9EE1E897}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -67,7 +54,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{4E4019F5-12E0-4EE2-9658-A0DD3038EEDA} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{D6EAFB31-4AFD-4989-9522-D6609AC4ED64} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
- {3125CA11-9F6D-4A4F-AFC1-37FEB3BBD9FA} = {0E83E43A-13FB-422F-B903-96E3E8F74DC2}
+ {C88042E2-0E09-4383-93F8-C79F9EE1E897} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {411AFEC9-4075-4FCC-B95A-9288BC822E90}
diff --git a/LX-LLVM.vcxproj b/LX-LLVM.vcxproj
index e10c052..7211ac1 100644
--- a/LX-LLVM.vcxproj
+++ b/LX-LLVM.vcxproj
@@ -24,7 +24,7 @@
{cc37e36f-b3b3-41b0-a887-01e8efe84994}
LXLLVM
10.0
- Frontend
+ Frontend-Old
@@ -136,9 +136,6 @@
$(SolutionDir)$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)
-
-
-
diff --git a/LX-LLVM.vcxproj.filters b/LX-LLVM.vcxproj.filters
index 6695468..9cd8510 100644
--- a/LX-LLVM.vcxproj.filters
+++ b/LX-LLVM.vcxproj.filters
@@ -1,6 +1,2 @@
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/Lexer/Lexer.vcxproj b/Lexer/Lexer.vcxproj
index 6f3b908..730d426 100644
--- a/Lexer/Lexer.vcxproj
+++ b/Lexer/Lexer.vcxproj
@@ -70,6 +70,14 @@
+
+ $(SolutionDir)bin\$(Platform)\$(Configuration)\
+ $(SolutionDir)bin\inter\$(Platform)\$(Configuration)\$(ProjectName)\
+
+
+ $(SolutionDir)bin\$(Platform)\$(Configuration)\
+ $(SolutionDir)bin\inter\$(Platform)\$(Configuration)\$(ProjectName)\
+
Level3
@@ -104,7 +112,7 @@
true
_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
- $(ProjectDir)inc;$(SolutionDir)common;%(AdditionalIncludeDirectories)
+ $(ProjectDir)inc;$(SolutionDir)IR-Generator\inc
stdcpp20
@@ -120,7 +128,7 @@
true
NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
- $(ProjectDir)inc;$(SolutionDir)common;%(AdditionalIncludeDirectories)
+ $(ProjectDir)inc;$(SolutionDir)IR-Generator\inc
stdcpp20
diff --git a/Parser/Parser.vcxproj b/Parser/Parser.vcxproj
index eace985..6fa5752 100644
--- a/Parser/Parser.vcxproj
+++ b/Parser/Parser.vcxproj
@@ -70,6 +70,14 @@
+
+ $(SolutionDir)bin\$(Platform)\$(Configuration)\
+ $(SolutionDir)bin\inter\$(Platform)\$(Configuration)\$(ProjectName)\
+
+
+ $(SolutionDir)bin\$(Platform)\$(Configuration)\
+ $(SolutionDir)bin\inter\$(Platform)\$(Configuration)\$(ProjectName)\
+
Level3
@@ -104,7 +112,7 @@
true
_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
- $(ProjectDir)inc;$(SolutionDir)common;%(AdditionalIncludeDirectories)
+ $(ProjectDir)inc;$(SolutionDir)IR-Generator\inc
stdcpp20
@@ -120,7 +128,7 @@
true
NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
true
- $(ProjectDir)inc;$(SolutionDir)common;%(AdditionalIncludeDirectories)
+ $(ProjectDir)inc;$(SolutionDir)IR-Generator\inc
stdcpp20
diff --git a/build-test/Main.ll b/build-test/Main.ll
deleted file mode 100644
index e69de29..0000000