Move Menu Expression to Simple Namespace to have generic configurable expressions

This commit is contained in:
Jan
2021-11-24 17:44:14 +01:00
parent 4f2a8454a6
commit 38f3d7d10e
21 changed files with 619 additions and 407 deletions

View File

@ -7,6 +7,8 @@
#include "MatcherAnd.h"
#include "MatcherLabel.h"
#include "MatcherLoop.h"
#include "MatcherFalse.h"
#include "MatcherTrue.h"
#include "MatcherOptional.h"
#include "MatcherOr.h"
#include "Parsing/IParserValue.h"
@ -85,6 +87,16 @@ public:
{
}
_NODISCARD MatcherFactoryWrapper<TokenType> False() const
{
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherFalse<TokenType>>());
}
_NODISCARD MatcherFactoryWrapper<TokenType> True() const
{
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherTrue<TokenType>>());
}
_NODISCARD MatcherFactoryWrapper<TokenType> And(std::initializer_list<Movable<std::unique_ptr<AbstractMatcher<TokenType>>>> matchers) const
{
return MatcherFactoryWrapper<TokenType>(std::make_unique<MatcherAnd<TokenType>>(matchers));