mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 16:15:43 +00:00
48 lines
1.8 KiB
C++
48 lines
1.8 KiB
C++
#include "SimpleMatcherFactory.h"
|
|
|
|
|
|
#include "SimpleMatcherAnyCharacterBesides.h"
|
|
#include "SimpleMatcherCharacter.h"
|
|
#include "SimpleMatcherKeyword.h"
|
|
#include "SimpleMatcherValueType.h"
|
|
|
|
SimpleMatcherFactory::SimpleMatcherFactory(const IMatcherForLabelSupplier<SimpleParserValue>* labelSupplier)
|
|
: AbstractMatcherFactory(labelSupplier)
|
|
{
|
|
}
|
|
|
|
MatcherFactoryWrapper<SimpleParserValue> SimpleMatcherFactory::Type(SimpleParserValueType type) const
|
|
{
|
|
return MatcherFactoryWrapper<SimpleParserValue>(std::make_unique<SimpleMatcherValueType>(type));
|
|
}
|
|
|
|
MatcherFactoryWrapper<SimpleParserValue> SimpleMatcherFactory::Keyword(std::string value) const
|
|
{
|
|
return MatcherFactoryWrapper<SimpleParserValue>(std::make_unique<SimpleMatcherKeyword>(std::move(value)));
|
|
}
|
|
|
|
MatcherFactoryWrapper<SimpleParserValue> SimpleMatcherFactory::Identifier() const
|
|
{
|
|
return MatcherFactoryWrapper<SimpleParserValue>(std::make_unique<SimpleMatcherValueType>(SimpleParserValueType::IDENTIFIER));
|
|
}
|
|
|
|
MatcherFactoryWrapper<SimpleParserValue> SimpleMatcherFactory::Integer() const
|
|
{
|
|
return MatcherFactoryWrapper<SimpleParserValue>(std::make_unique<SimpleMatcherValueType>(SimpleParserValueType::INTEGER));
|
|
}
|
|
|
|
MatcherFactoryWrapper<SimpleParserValue> SimpleMatcherFactory::FloatingPoint() const
|
|
{
|
|
return MatcherFactoryWrapper<SimpleParserValue>(std::make_unique<SimpleMatcherValueType>(SimpleParserValueType::FLOATING_POINT));
|
|
}
|
|
|
|
MatcherFactoryWrapper<SimpleParserValue> SimpleMatcherFactory::Char(char c) const
|
|
{
|
|
return MatcherFactoryWrapper<SimpleParserValue>(std::make_unique<SimpleMatcherCharacter>(c));
|
|
}
|
|
|
|
MatcherFactoryWrapper<SimpleParserValue> SimpleMatcherFactory::AnyCharBesides(std::vector<char> chars) const
|
|
{
|
|
return MatcherFactoryWrapper<SimpleParserValue>(std::make_unique<SimpleMatcherAnyCharacterBesides>(std::move(chars)));
|
|
}
|