#include "common.hpp"
#include "helpers.hpp"
#include <lloyal/nlohmann/json.hpp>
#include <algorithm>
#include <functional>
#include <limits>
#include <map>
#include <regex>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
Go to the source code of this file.
|
| std::string | lloyal::json_schema_to_grammar (const json &schema, bool force_gbnf=false) |
| | Convert JSON schema to GBNF grammar.
|
| |
| std::string | lloyal::build_grammar (const std::function< void(const common_grammar_builder &)> &cb, const common_grammar_options &options={}) |
| | Build grammar from callback.
|
| |
| bool | lloyal::detail::is_reserved_name (const std::string &name) |
| | Check if name conflicts with GBNF reserved keywords.
|
| |
| std::regex | lloyal::detail::INVALID_RULE_CHARS_RE ("[^a-zA-Z0-9-]+") |
| |
| std::regex | lloyal::detail::GRAMMAR_LITERAL_ESCAPE_RE ("[\r\n\"]") |
| |
| std::regex | lloyal::detail::GRAMMAR_RANGE_LITERAL_ESCAPE_RE ("[\r\n\"\\]\\-\\\\]") |
| |
| std::string | lloyal::detail::build_repetition (const std::string &item_rule, int min_items, int max_items, const std::string &separator_rule="") |
| |
| void | lloyal::detail::_build_min_max_int (int min_value, int max_value, std::stringstream &out, int decimals_left=16, bool top_level=true) |
| |
| std::string | lloyal::detail::replacePattern (const std::string &input, const std::regex ®ex, const std::function< std::string(const std::smatch &)> &replacement) |
| |
| std::string | lloyal::detail::format_literal (const std::string &literal) |
| |