12#ifndef INKSCAPE_CSS_SYNTACTIC_DECOMPOSITION_H
13#define INKSCAPE_CSS_SYNTACTIC_DECOMPOSITION_H
25class SyntacticDecomposition;
72 requires(RuleStatement
const &rule, BlockAtStatement
const &block,
OtherStatement const &other, F f) {
99 [&handler,
this](
auto const &element) { std::visit(handler, element); });
A partial syntactic decomposition of a CSS stylesheet into syntactic elements.
void for_each(SyntacticElementHandler auto &&handler) const
Execute an operation for each syntactic element, in the order of their occurrence.
std::vector< SyntacticElement > _elements
SyntacticDecomposition(std::vector< SyntacticElement > elements)
Construct from a collection of syntactic elements.
bool empty() const
Returns true when there are no elements.
A SyntacticElementHandler is a callable which can accept all possible variant types of a syntactic el...
typedefG_BEGIN_DECLS struct _CRSelector CRSelector
std::shared_ptr< Css const > css
std::string OtherStatement
Another CSS statement, currently not handled in a special way; for example @charset.
std::string selector_to_validated_string(CRSelector const &croco_selector)
Convert a CSS selector to a string, performing a fix-up if needed.
std::variant< RuleStatement, BlockAtStatement, OtherStatement > SyntacticElement
A syntactic element of a CSS stylesheet is either a rule set statement, a block -statement,...
A decomposed block -statement, consisting of the statement and the contents of the associated block.
std::unique_ptr< SyntacticDecomposition > block_content
A decomposed CSS rule statement, consisting of a selector (which can be complex), and the associated ...
std::string selectors
Selectors for a rule set statement.
std::string rules
Semicolon-separated rules.
Abstracts a CSS2 selector as defined in the right part of the 'ruleset' production in the appendix D....