2026-07-18 18:48:23 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "klammer.h"
|
2026-07-30 23:50:07 +02:00
|
|
|
#include "target_registry.h"
|
2026-07-18 18:48:23 +02:00
|
|
|
|
2026-07-30 23:50:07 +02:00
|
|
|
class Klammer_registry
|
2026-07-18 18:48:23 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2026-07-30 23:50:07 +02:00
|
|
|
Klammer_registry() = default;
|
|
|
|
|
void add(const Argtype_registry& argtypes, const Target_registry& targets,
|
2026-08-06 13:11:37 +02:00
|
|
|
Option_set_registry& option_sets,
|
2026-07-18 18:48:23 +02:00
|
|
|
std::vector<Katom>::iterator begin, std::vector<Katom>::iterator end, std::vector<Katom>& katoms);
|
2026-07-30 23:50:07 +02:00
|
|
|
void rationalize(const Target_registry& targets);
|
|
|
|
|
void check_klammer(const std::string& name, const std::string& target, const Locator& loc) const;
|
2026-07-18 18:48:23 +02:00
|
|
|
const std::vector<Katom>* constant_body(const std::string& name) const;
|
|
|
|
|
std::string instance_list(int margin) const;
|
2026-08-12 17:20:23 +02:00
|
|
|
// With a search string, only the klammers whose NAME or DESCRIPTION
|
|
|
|
|
// contains it, case-insensitively and with whitespace collapsed on both
|
|
|
|
|
// sides (a description written across several lines in a ".k" file must
|
|
|
|
|
// still match a phrase typed on one). Empty when nothing matched, which
|
|
|
|
|
// is how the caller knows to say so.
|
2026-08-16 01:37:59 +02:00
|
|
|
// `defined_outside` restricts the listing to klammers with at least one
|
|
|
|
|
// definition from a file not in the list -- the input's own klammers,
|
|
|
|
|
// with the loaded klammersets' left out.
|
|
|
|
|
std::string describe(int margin=0, const std::string& search="",
|
|
|
|
|
const strings_t& defined_outside={}) const;
|
2026-07-18 18:48:23 +02:00
|
|
|
|
|
|
|
|
std::map<std::string, Klammer> m_klammers {};
|
|
|
|
|
};
|