Aller au contenu
Bienvenue sur la nouvelle documentation de CppUtils !

Namespace: CppUtils::Language::Lexer

enum class RecurrenceType {
Optional,
EqualTo,
MoreThan,
MoreOrEqualTo
};
using CppUtils::Language::Lexer::ParsingFunction = typedef std::function<bool(Context<Types...>&)>;
using CppUtils::Language::Lexer::BreakPointLexeme = typedef Typed<BreakPointLexemeType, void>;
using CppUtils::Language::Lexer::StringLexeme = typedef Typed<StringLexemeType, std::string>;
using CppUtils::Language::Lexer::ParserLexeme = typedef Typed<ParserLexemeType, NamedParser<Types...> >;
using CppUtils::Language::Lexer::TokenLexeme = typedef Typed<TokenLexemeType, Type::Token>;
using CppUtils::Language::Lexer::TagLexeme = typedef Typed<TagLexemeType, std::unique_ptr<ILexeme> >;
using CppUtils::Language::Lexer::MutedLexeme = typedef Typed<MutedLexemeType, std::unique_ptr<ILexeme> >;
using CppUtils::Language::Lexer::RecurrentLexeme = typedef Typed<RecurrentLexemeType, Recurrence>;
using CppUtils::Language::Lexer::AlternativeLexeme = typedef Typed<AlternativeLexemeType, Alternative>;
using CppUtils::Language::Lexer::ExcludeLexeme = typedef Typed<ExcludeLexemeType, Exclusion>;
template <class Element = char>
auto parseLexeme(String::Cursor<std::basic_string_view<Element>> &cursor, std::reference_wrapper<Container::ASTNode<Element>> &parentNode, Container::AST<Element> &ast, const Container::ASTNode<Element> &lexeme, const Container::AST<Element> &grammar, std::vector<Container::ASTNode<Element>> &memory) -> bool;

template <class Element = char>
auto parseLexemes(String::Cursor<std::basic_string_view<Element>> &cursor, std::reference_wrapper<Container::ASTNode<Element>> &parentNode, Container::AST<Element> &ast, const Container::ASTNode<Element> &lexeme, const Container::AST<Element> &grammar, std::vector<Container::ASTNode<Element>> &memory) -> bool;

template <class Element = char>
auto parseDeclaration(String::Cursor<std::basic_string_view<Element>> &cursor, std::reference_wrapper<Container::ASTNode<Element>> &parentNode, Container::AST<Element> &ast, const Container::ASTNode<Element> &declaration, const Container::AST<Element> &grammar, std::vector<Container::ASTNode<Element>> &memory) -> bool;

template <class Element = char>
auto parseMultipleDeclaration(String::Cursor<std::basic_string_view<Element>> &cursor, std::reference_wrapper<Container::ASTNode<Element>> &parentNode, Container::AST<Element> &ast, const Container::ASTNode<Element> &declarationLexeme, const Container::AST<Element> &grammar, std::vector<Container::ASTNode<Element>> &memory) -> bool;

template <class CharT = char>
auto parse(std::basic_string_view<CharT> src, const Container::AST<CharT> &grammar) -> Container::AST<CharT>;

template <class TargetType>
auto ensureType(const std::unique_ptr<ILexeme> &lexeme) -> TargetType &;

template <class... Types>
NamedParser(std::string, ParsingFunction<Types...>) -> NamedParser<Types...>;

template <class... Types>
NamedParser(std::string, bool(Context<Types...> &)) -> NamedParser<Types...>;

template <class... Types>
auto spaceParser(Context<Types...> &context) -> bool;

template <class... Types>
or(std::same_as<std::string, Types> or ...) inline auto keywordParser(Context<Types...> &context) -> bool;

template <class... Types>
auto charParser(Context<Types...> &context) -> bool;

template <class... Types>
auto escapeCharParser(Context<Types...> &context) -> bool;

template <class... Types>
auto delimiterParser(Context<Types...> &context, std::string_view delimiter, std::type_identity_t<ParsingFunction<Types...>> contentParsingFunction, bool multipleContent, bool skipDelimiter) -> bool;

template <class... Types>
auto stringParser(Context<Types...> &context, std::string_view delimiter, bool skipDelimiter) -> bool;

template <class... Types>
auto uintParser(Context<Types...> &context) -> bool;

template <class... Types>
auto intParser(Context<Types...> &context) -> bool;

template <class... Types>
auto floatParser(Context<Types...> &context) -> bool;

template <class... Types>
auto booleanParser(Context<Types...> &context) -> bool;

template <class... Types>
auto trimModifier(Context<Types...> &context) -> bool;

template <class... Types>
and(std::same_as<Type::Token, Types> or ...) inline auto stringToTokenModifier(Context<Types...> &context) -> bool;

constexpr auto CppUtils::Language::Lexer::BreakPointLexemeType;
constexpr auto CppUtils::Language::Lexer::StringLexemeType;
constexpr auto CppUtils::Language::Lexer::ParserLexemeType;
constexpr auto CppUtils::Language::Lexer::TokenLexemeType;
constexpr auto CppUtils::Language::Lexer::TagLexemeType;
constexpr auto CppUtils::Language::Lexer::MutedLexemeType;
constexpr auto CppUtils::Language::Lexer::RecurrentLexemeType;
constexpr auto CppUtils::Language::Lexer::AlternativeLexemeType;
constexpr auto CppUtils::Language::Lexer::ExcludeLexemeType;