32 bool addModule(
const std::string& symbol,
const std::string& asset,
float length,
35 bool removeModule(
const std::string& symbol);
37 bool hasModule(
const std::string& symbol)
const;
39 int getModuleCount()
const;
41 std::string getModuleSymbol(
int index)
const;
43 int getVariantCount(
const std::string& symbol)
const;
45 std::string getVariantAsset(
const std::string& symbol,
int index)
const;
47 float getVariantLength(
const std::string& symbol,
int index)
const;
50 bool validate(
const std::string& grammar);
57 bool acceptIncomplete);
59 std::string getError()
const;
61 std::string debugReport()
const;
71 const std::string&
text;
75 std::vector<Element>
sequence(
char terminator =
'\0');
77 void skipWhitespace();
80 float elementMinLength(
const Element&
element)
const;
81 float sequenceMinLength(
const std::vector<Element>&
sequence,
size_t from = 0)
const;
82 bool expandSequence(
const std::vector<Element>&
sequence,
float available,
83 std::vector<std::string>& symbols,
float& used)
const;
86 std::unordered_map<std::string, std::vector<ShapeModuleVariant>> modules_;
87 std::vector<std::string> moduleOrder_;
89 int lastSymbolCount_ = 0;
90 float lastUsedLength_ = 0.f;
91 float lastSplineLength_ = 0.f;