#pragma once #include "Parsing/Menu/MenuFileParserState.h" #include "Parsing/Sequence/SequenceResult.h" #include "Parsing/Simple/Matcher/SimpleMatcherFactory.h" namespace menu { class MenuMatcherFactory : public SimpleMatcherFactory { static constexpr auto TAG_STRING_CHAIN = 1420; static constexpr auto TAG_IDENTIFIER = 1421; static constexpr auto TAG_INT = 1422; static constexpr auto TAG_NUMERIC = 1423; static constexpr auto TAG_EXPRESSION = 1424; static constexpr auto CAPTURE_FIRST_TOKEN = 1420; static constexpr auto CAPTURE_STRING_CHAIN = 1421; static constexpr auto CAPTURE_IDENTIFIER = 1422; static constexpr auto CAPTURE_INT = 1423; static constexpr auto CAPTURE_NUMERIC = 1424; public: explicit MenuMatcherFactory(const IMatcherForLabelSupplier* labelSupplier); [[nodiscard]] MatcherFactoryWrapper StringChain() const; [[nodiscard]] MatcherFactoryWrapper Text() const; [[nodiscard]] MatcherFactoryWrapper TextOrNumeric() const; [[nodiscard]] MatcherFactoryWrapper TextNoChain() const; [[nodiscard]] MatcherFactoryWrapper TextNoChainOrNumeric() const; [[nodiscard]] MatcherFactoryWrapper Numeric() const; [[nodiscard]] MatcherFactoryWrapper TextExpression() const; [[nodiscard]] MatcherFactoryWrapper IntExpression() const; [[nodiscard]] MatcherFactoryWrapper NumericExpression() const; [[nodiscard]] static int TokenNumericIntValue(const SimpleParserValue& value); [[nodiscard]] static double TokenNumericFloatingPointValue(const SimpleParserValue& value); [[nodiscard]] static std::string& TokenTextValue(const SimpleParserValue& value); [[nodiscard]] static std::string TokenTextExpressionValue(MenuFileParserState* state, SequenceResult& result); [[nodiscard]] static int TokenIntExpressionValue(MenuFileParserState* state, SequenceResult& result); [[nodiscard]] static double TokenNumericExpressionValue(MenuFileParserState* state, SequenceResult& result); }; } // namespace menu