-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#969: Use new CTPG parser in java vm (#455)
related to exasol/script-languages-release#969 --------- Co-authored-by: Torsten Kilias <[email protected]>
- Loading branch information
Showing
40 changed files
with
1,123 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "base/javacontainer/javacontainer_builder.h" | ||
#include "base/javacontainer/script_options/parser_ctpg.h" | ||
#include "base/javacontainer/script_options/parser_legacy.h" | ||
#include "base/swig_factory/swig_factory_impl.h" | ||
|
||
#ifdef ENABLE_JAVA_VM | ||
|
||
namespace SWIGVMContainers { | ||
|
||
JavaContainerBuilder::JavaContainerBuilder() | ||
: m_useCtpgParser(false) {} | ||
|
||
JavaContainerBuilder& JavaContainerBuilder::useCtpgParser(const bool useCtpgParser) { | ||
m_useCtpgParser = useCtpgParser; | ||
return *this; | ||
} | ||
|
||
JavaVMach* JavaContainerBuilder::build() { | ||
std::unique_ptr<JavaScriptOptions::ScriptOptionsParser> parser; | ||
if (m_useCtpgParser) { | ||
parser = std::make_unique<JavaScriptOptions::ScriptOptionLinesParserCTPG>(std::make_unique<SwigFactoryImpl>()); | ||
} else { | ||
parser = std::make_unique<JavaScriptOptions::ScriptOptionLinesParserLegacy>(std::make_unique<SwigFactoryImpl>()); | ||
} | ||
return new JavaVMach(false, std::move(parser)); | ||
} | ||
|
||
|
||
} //namespace SWIGVMContainers | ||
|
||
|
||
#endif //ENABLE_JAVA_VM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef JAVACONTAINER_BUILDER_H | ||
#define JAVACONTAINER_BUILDER_H | ||
|
||
#include <memory> | ||
#include "base/javacontainer/javacontainer.h" | ||
|
||
#ifdef ENABLE_JAVA_VM | ||
|
||
namespace SWIGVMContainers { | ||
|
||
namespace JavaScriptOptions { | ||
|
||
struct ScriptOptionsParser; | ||
|
||
} | ||
|
||
class JavaContainerBuilder { | ||
public: | ||
JavaContainerBuilder(); | ||
|
||
JavaContainerBuilder& useCtpgParser(const bool value); | ||
|
||
JavaVMach* build(); | ||
|
||
private: | ||
bool m_useCtpgParser; | ||
}; | ||
|
||
} //namespace SWIGVMContainers | ||
|
||
|
||
#endif //ENABLE_JAVA_VM | ||
|
||
|
||
#endif //JAVACONTAINER_BUILDER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.