diff --git a/premake5.lua b/premake5.lua index ba814d55..c8695aa8 100644 --- a/premake5.lua +++ b/premake5.lua @@ -85,6 +85,7 @@ group "" include "src/Common.lua" include "src/Crypto.lua" include "src/Linker.lua" +include "src/Parser.lua" include "src/Unlinker.lua" include "src/Utils.lua" include "src/ZoneCode.lua" @@ -102,6 +103,7 @@ include "src/ObjWriting.lua" group "Components" Common:project() Crypto:project() + Parser:project() Utils:project() ZoneCode:project() ZoneCodeGeneratorLib:project() diff --git a/src/Parser.lua b/src/Parser.lua new file mode 100644 index 00000000..c335ffe7 --- /dev/null +++ b/src/Parser.lua @@ -0,0 +1,47 @@ +Parser = {} + +function Parser:include(includes) + if includes:handle(self:name()) then + includedirs { + path.join(ProjectFolder(), "Parser") + } + Utils:include(includes) + end +end + +function Parser:link(links) + links:add(self:name()) + links:linkto(Utils) +end + +function Parser:use() + +end + +function Parser:name() + return "Parser" +end + +function Parser:project() + local folder = ProjectFolder() + local includes = Includes:create() + + project(self:name()) + targetdir(TargetDirectoryLib) + location "%{wks.location}/src/%{prj.name}" + kind "StaticLib" + language "C++" + + files { + path.join(folder, "Parser/**.h"), + path.join(folder, "Parser/**.cpp") + } + + vpaths { + ["*"] = { + path.join(folder, "Parser") + } + } + + self:include(includes) +end diff --git a/src/ZoneCodeGeneratorLib/Parsing/ILexer.h b/src/Parser/Parsing/ILexer.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/ILexer.h rename to src/Parser/Parsing/ILexer.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/IPackValueSupplier.h b/src/Parser/Parsing/IPackValueSupplier.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/IPackValueSupplier.h rename to src/Parser/Parsing/IPackValueSupplier.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/IParser.h b/src/Parser/Parsing/IParser.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/IParser.h rename to src/Parser/Parsing/IParser.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/IParserLineStream.cpp b/src/Parser/Parsing/IParserLineStream.cpp similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/IParserLineStream.cpp rename to src/Parser/Parsing/IParserLineStream.cpp diff --git a/src/ZoneCodeGeneratorLib/Parsing/IParserLineStream.h b/src/Parser/Parsing/IParserLineStream.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/IParserLineStream.h rename to src/Parser/Parsing/IParserLineStream.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/IParserValue.h b/src/Parser/Parsing/IParserValue.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/IParserValue.h rename to src/Parser/Parsing/IParserValue.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/AbstractDirectiveStreamProxy.cpp b/src/Parser/Parsing/Impl/AbstractDirectiveStreamProxy.cpp similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/AbstractDirectiveStreamProxy.cpp rename to src/Parser/Parsing/Impl/AbstractDirectiveStreamProxy.cpp diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/AbstractDirectiveStreamProxy.h b/src/Parser/Parsing/Impl/AbstractDirectiveStreamProxy.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/AbstractDirectiveStreamProxy.h rename to src/Parser/Parsing/Impl/AbstractDirectiveStreamProxy.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/AbstractLexer.h b/src/Parser/Parsing/Impl/AbstractLexer.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/AbstractLexer.h rename to src/Parser/Parsing/Impl/AbstractLexer.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/AbstractParser.h b/src/Parser/Parsing/Impl/AbstractParser.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/AbstractParser.h rename to src/Parser/Parsing/Impl/AbstractParser.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/CommentRemovingStreamProxy.cpp b/src/Parser/Parsing/Impl/CommentRemovingStreamProxy.cpp similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/CommentRemovingStreamProxy.cpp rename to src/Parser/Parsing/Impl/CommentRemovingStreamProxy.cpp diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/CommentRemovingStreamProxy.h b/src/Parser/Parsing/Impl/CommentRemovingStreamProxy.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/CommentRemovingStreamProxy.h rename to src/Parser/Parsing/Impl/CommentRemovingStreamProxy.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/DefinesStreamProxy.cpp b/src/Parser/Parsing/Impl/DefinesStreamProxy.cpp similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/DefinesStreamProxy.cpp rename to src/Parser/Parsing/Impl/DefinesStreamProxy.cpp diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/DefinesStreamProxy.h b/src/Parser/Parsing/Impl/DefinesStreamProxy.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/DefinesStreamProxy.h rename to src/Parser/Parsing/Impl/DefinesStreamProxy.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/IncludingStreamProxy.cpp b/src/Parser/Parsing/Impl/IncludingStreamProxy.cpp similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/IncludingStreamProxy.cpp rename to src/Parser/Parsing/Impl/IncludingStreamProxy.cpp diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/IncludingStreamProxy.h b/src/Parser/Parsing/Impl/IncludingStreamProxy.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/IncludingStreamProxy.h rename to src/Parser/Parsing/Impl/IncludingStreamProxy.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/PackDefinitionStreamProxy.cpp b/src/Parser/Parsing/Impl/PackDefinitionStreamProxy.cpp similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/PackDefinitionStreamProxy.cpp rename to src/Parser/Parsing/Impl/PackDefinitionStreamProxy.cpp diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/PackDefinitionStreamProxy.h b/src/Parser/Parsing/Impl/PackDefinitionStreamProxy.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/PackDefinitionStreamProxy.h rename to src/Parser/Parsing/Impl/PackDefinitionStreamProxy.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/ParserFilesystemStream.cpp b/src/Parser/Parsing/Impl/ParserFilesystemStream.cpp similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/ParserFilesystemStream.cpp rename to src/Parser/Parsing/Impl/ParserFilesystemStream.cpp diff --git a/src/ZoneCodeGeneratorLib/Parsing/Impl/ParserFilesystemStream.h b/src/Parser/Parsing/Impl/ParserFilesystemStream.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Impl/ParserFilesystemStream.h rename to src/Parser/Parsing/Impl/ParserFilesystemStream.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Matcher/AbstractMatcher.h b/src/Parser/Parsing/Matcher/AbstractMatcher.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Matcher/AbstractMatcher.h rename to src/Parser/Parsing/Matcher/AbstractMatcher.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Matcher/AbstractMatcherFactory.h b/src/Parser/Parsing/Matcher/AbstractMatcherFactory.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Matcher/AbstractMatcherFactory.h rename to src/Parser/Parsing/Matcher/AbstractMatcherFactory.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Matcher/MatcherAnd.h b/src/Parser/Parsing/Matcher/MatcherAnd.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Matcher/MatcherAnd.h rename to src/Parser/Parsing/Matcher/MatcherAnd.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Matcher/MatcherLabel.h b/src/Parser/Parsing/Matcher/MatcherLabel.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Matcher/MatcherLabel.h rename to src/Parser/Parsing/Matcher/MatcherLabel.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Matcher/MatcherLoop.h b/src/Parser/Parsing/Matcher/MatcherLoop.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Matcher/MatcherLoop.h rename to src/Parser/Parsing/Matcher/MatcherLoop.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Matcher/MatcherOptional.h b/src/Parser/Parsing/Matcher/MatcherOptional.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Matcher/MatcherOptional.h rename to src/Parser/Parsing/Matcher/MatcherOptional.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Matcher/MatcherOr.h b/src/Parser/Parsing/Matcher/MatcherOr.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Matcher/MatcherOr.h rename to src/Parser/Parsing/Matcher/MatcherOr.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Matcher/MatcherResult.h b/src/Parser/Parsing/Matcher/MatcherResult.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Matcher/MatcherResult.h rename to src/Parser/Parsing/Matcher/MatcherResult.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/ParsingException.cpp b/src/Parser/Parsing/ParsingException.cpp similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/ParsingException.cpp rename to src/Parser/Parsing/ParsingException.cpp diff --git a/src/ZoneCodeGeneratorLib/Parsing/ParsingException.h b/src/Parser/Parsing/ParsingException.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/ParsingException.h rename to src/Parser/Parsing/ParsingException.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Sequence/AbstractSequence.h b/src/Parser/Parsing/Sequence/AbstractSequence.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Sequence/AbstractSequence.h rename to src/Parser/Parsing/Sequence/AbstractSequence.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/Sequence/SequenceResult.h b/src/Parser/Parsing/Sequence/SequenceResult.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/Sequence/SequenceResult.h rename to src/Parser/Parsing/Sequence/SequenceResult.h diff --git a/src/ZoneCodeGeneratorLib/Parsing/TokenPos.cpp b/src/Parser/Parsing/TokenPos.cpp similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/TokenPos.cpp rename to src/Parser/Parsing/TokenPos.cpp diff --git a/src/ZoneCodeGeneratorLib/Parsing/TokenPos.h b/src/Parser/Parsing/TokenPos.h similarity index 100% rename from src/ZoneCodeGeneratorLib/Parsing/TokenPos.h rename to src/Parser/Parsing/TokenPos.h diff --git a/src/ZoneCodeGeneratorLib.lua b/src/ZoneCodeGeneratorLib.lua index c5b53173..383213b3 100644 --- a/src/ZoneCodeGeneratorLib.lua +++ b/src/ZoneCodeGeneratorLib.lua @@ -5,12 +5,14 @@ function ZoneCodeGeneratorLib:include(includes) includedirs { path.join(ProjectFolder(), "ZoneCodeGeneratorLib") } + Parser:include(includes) Utils:include(includes) end end function ZoneCodeGeneratorLib:link(links) links:add(self:name()) + links:linkto(Parser) links:linkto(Utils) end diff --git a/src/ZoneCodeGeneratorLib/Parsing/Commands/Impl/CommandsParserValue.h b/src/ZoneCodeGeneratorLib/Parsing/Commands/Impl/CommandsParserValue.h index 2a26c9bd..9ef0c204 100644 --- a/src/ZoneCodeGeneratorLib/Parsing/Commands/Impl/CommandsParserValue.h +++ b/src/ZoneCodeGeneratorLib/Parsing/Commands/Impl/CommandsParserValue.h @@ -2,8 +2,6 @@ #include - - #include "Domain/Evaluation/OperationType.h" #include "Parsing/IParserValue.h" #include "Utils/ClassUtils.h" diff --git a/src/ZoneCommon.lua b/src/ZoneCommon.lua index d6ba488b..850579fb 100644 --- a/src/ZoneCommon.lua +++ b/src/ZoneCommon.lua @@ -13,9 +13,10 @@ end function ZoneCommon:link(links) links:add(self:name()) - links:linkto(Utils) links:linkto(Common) links:linkto(ObjCommon) + links:linkto(Parser) + links:linkto(Utils) end function ZoneCommon:use() @@ -42,4 +43,5 @@ function ZoneCommon:project() } self:include(includes) + Parser:include(includes) end