OpenAssetTools/src/Parser/Parsing/Simple/Matcher/SimpleMatcherFactory.cpp

41 lines
1.5 KiB
C++

#include "SimpleMatcherFactory.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));
}