iris::build Namespace Reference
Doxygen 1.15.0 generates this reference during each site build from the public headers. The C++ guide shows the API in use.
The spec builder (<iris/build.hpp>). More...
Namespaces | |
| namespace | host |
| The host constants. | |
Classes | |
| class | Expr |
| An expression with value type V and shape S. More... | |
| class | Scope |
| The scope of a block, at depth D (the number of enclosing repeats) and presence P (whether the statements run in every record). More... | |
| class | Arms |
| The arms of a sections block: each arm is a pattern that starts a section, with or without a body. More... | |
| class | If |
| The branch of an if: else_if, else_ and else_read_if continue it, each directly after the branch before. More... | |
| struct | Scalar |
| The shape of an expression whose depth follows from its scope. More... | |
| struct | Open |
| The shape of an expression that looks a value up, such as x[i], whose depth is not known. More... | |
| class | BuildError |
| A mistake that SpecBuilder::build or SpecBuilder::source reports. More... | |
| class | Host |
| A host constant (Specification §8.11), which Iris spells with the host's prefix. More... | |
| class | Record |
| The records of a repeat: job.get(machine) projects a field of the current record, list() is the list of all of them, and comprehensions iterate over them. More... | |
| class | RecordExpr |
| A record selected by an expression, such as jobs[0]. More... | |
| class | RecordList |
| A list of records, such as jobs or job.tasks. More... | |
| class | Over |
| A domain with the name that a comprehension gives its element; see over. More... | |
| class | ListReading |
| A list reading with value type V, as in int_.until(eol). More... | |
| class | NamedType |
| A type that Scope::define_type declared, with value type V. More... | |
| struct | Eol |
| The end of a list: end of line, as in list x:int until eol. More... | |
| class | TypeOf |
| A type with value type V and N dimensions, as in int_.dim(n).dim(m). More... | |
| class | BaseType |
| A base type: one of the constants int_, float_, num, word and rest. More... | |
| class | Bound |
| A bound of a Range: an operand of value type std::int64_t, Number or Dynamic. More... | |
| struct | Range |
| An integer range type, given with designated initializers: {.from = 1,
.to = n} is 1..n, {.from = 0, .below = n} is 0..<n, and either bound may be left out. More... | |
| class | Alphabet |
| An alphabet type, which reads symbols as integers; see alphabet. More... | |
| struct | Untyped |
| The capture type that reads a token without a type, as {x} does. More... | |
| struct | Discard |
| The discard _: a target that stores nothing, and {_} in a pattern. More... | |
| struct | Blank |
| {} in a pattern, which matches a token More... | |
| struct | RestOfLine |
| ... in a pattern, which matches the rest of the line More... | |
| class | Part |
| A part of a pattern that bind, ref, validate or discard_as made. More... | |
| class | Pattern |
| A pattern of a line, find or sections arm, built at run time. More... | |
| class | PatternString |
| A pattern string with one {} for each of the types Parts, checked at compile time. More... | |
| class | PatternArg |
| The pattern of a statement: a Pattern, or a string literal without placeholders, checked at compile time. More... | |
| class | Strings |
| A list of strings: one string, or a braced list or range of them. More... | |
| class | StoreTarget |
| The target of a store: a new name, a handle, or nothing. More... | |
| struct | UntilOptions |
| The options of Scope::repeat_until. More... | |
| struct | SectionsOptions |
| One clause of the options of Scope::sections. More... | |
| struct | ArmOptions |
| The options of an arm of Arms. More... | |
| class | Indexing |
| The handles, records and expressions that a builder statement takes through [] and dynamic() on an iris::Field. More... | |
| class | SpecBuilder |
| A reader spec under construction: the scope of the top level, with the settings that only the top level has. More... | |
| struct | Dynamic |
| The value type of a handle whose leaf type is not known. More... | |
| class | Field |
| A typed handle to an entry: its name, the type of its leaves, its number of array levels, and whether it may be undefined. More... | |
Concepts | |
| concept | Operand |
| An operand of an expression: a handle, an expression, an integer, float or string literal, or a host constant. | |
| concept | Integral |
| The value types that +, -, *, /, %, pow, !, && and || take. | |
| concept | Numeric |
| The value types that unary -, <, <=, > and >= take. | |
| concept | BoundValue |
| The value types of range bounds. | |
| concept | Equatable |
| The pairs of value types that == and != compare. | |
| concept | TypeLike |
| A type: a constant such as int_, a Range, an alphabet, a NamedType, or a Type made from one of these. | |
| concept | CaptureType |
| A capture type: a type without dimensions, or untyped. | |
| concept | PatternPart |
| A part of a pattern: a capture handle, a Part, discard, blank or rest_of_line. | |
| concept | Domain |
| A domain of a comprehension: an array handle or expression, a Record, a RecordList, or an Over that names the element. | |
| concept | Definable |
| An expression that defined takes: a handle, an expression or records. | |
Typedefs | |
| template<Operand T> | |
| using | ValueOf = detail::OperandTraits<detail::Bare<T>>::Value |
| The value type of operand T. | |
| template<TypeLike T> | |
| using | TypeValue = detail::TypeTraits<std::remove_cvref_t<T>>::Value |
| The value type that type T reads. | |
| template<CaptureType T> | |
| using | CaptureValue = detail::CaptureValueOf<std::remove_cvref_t<T>>::Type |
| The value type of a capture of type T. | |
| template<Domain T> | |
| using | ItemOf = detail::DomainTraits<detail::Bare<T>>::Item |
| The element that a comprehension over domain T passes to its body. | |
| using | DynField |
| A handle whose value type and depth are not known, and whose entry may be undefined: Data::get returns a std::optional<ValueRef>. | |
| using | Number |
| A number of a num entry: an integer or a float. | |
Enumerations | |
| enum class | BuildErrorKind { Scope , Provenance , Redefinition , Unprintable , Binding , Spec } |
| What kind of mistake a BuildError reports. More... | |
| enum class | Presence |
| Whether an entry is always defined, or may be left undefined. More... | |
Functions | |
| template<class L, class R> requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>> | |
| Expr< std::int64_t > | operator+ (L &&left, R &&right) |
| Addition, a + b. | |
| template<class L, class R> requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>> | |
| Expr< std::int64_t > | operator- (L &&left, R &&right) |
| Subtraction, a - b. | |
| template<class L, class R> requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>> | |
| Expr< std::int64_t > | operator* (L &&left, R &&right) |
| Multiplication, a * b. | |
| template<class L, class R> requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>> | |
| Expr< std::int64_t > | operator/ (L &&left, R &&right) |
| Integer division, a / b. | |
| template<class L, class R> requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>> | |
| Expr< std::int64_t > | operator% (L &&left, R &&right) |
| Remainder, a % b. | |
| template<class L, class R> requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>> | |
| Expr< std::int64_t > | operator&& (L &&left, R &&right) |
| Conjunction, a && b. | |
| template<class L, class R> requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>> | |
| Expr< std::int64_t > | operator|| (L &&left, R &&right) |
| Disjunction, a || b. | |
| template<class L, class R> requires detail::Operands<L, R> && Equatable<ValueOf<L>, ValueOf<R>> | |
| Expr< std::int64_t > | operator== (L &&left, R &&right) |
| Equality, a == b. | |
| template<class L, class R> requires detail::Operands<L, R> && Equatable<ValueOf<L>, ValueOf<R>> | |
| Expr< std::int64_t > | operator!= (L &&left, R &&right) |
| Inequality, a != b. | |
| template<class L, class R> requires detail::Operands<L, R> && Numeric<ValueOf<L>> && Numeric<ValueOf<R>> | |
| Expr< std::int64_t > | operator< (L &&left, R &&right) |
| Comparison, a < b. | |
| template<class L, class R> requires detail::Operands<L, R> && Numeric<ValueOf<L>> && Numeric<ValueOf<R>> | |
| Expr< std::int64_t > | operator<= (L &&left, R &&right) |
| Comparison, a <= b. | |
| template<class L, class R> requires detail::Operands<L, R> && Numeric<ValueOf<L>> && Numeric<ValueOf<R>> | |
| Expr< std::int64_t > | operator> (L &&left, R &&right) |
| Comparison, a > b. | |
| template<class L, class R> requires detail::Operands<L, R> && Numeric<ValueOf<L>> && Numeric<ValueOf<R>> | |
| Expr< std::int64_t > | operator>= (L &&left, R &&right) |
| Comparison, a >= b. | |
| template<class T> requires detail::BuilderOperand<T> && Numeric<ValueOf<T>> | |
| Expr< ValueOf< T > > | operator- (T &&operand) |
| Negation, -a, of the same value type. | |
| template<class T> requires detail::BuilderOperand<T> && Integral<ValueOf<T>> | |
| Expr< std::int64_t > | operator! (T &&operand) |
| Logical negation, !a. | |
Variables | |
| template<TypeLike T> | |
| constexpr std::size_t | type_dims |
| The number of dimensions of type T, or dynamic_depth. | |
| constexpr Eol | eol {} |
| The end of line, which ends a list. | |
| constexpr BaseType< std::int64_t > | int_ {detail::HostName{}, "int"} |
| The type int, which reads an integer. | |
| constexpr BaseType< double > | float_ {detail::HostName{}, "float"} |
| The type float, which reads a float. | |
| constexpr BaseType< Number > | num {detail::HostName{}, "num"} |
| The type num, which reads an integer or a float. | |
| constexpr BaseType< std::string > | word {detail::HostName{}, "word"} |
| The type word, which reads a word. | |
| constexpr BaseType< std::string > | rest {detail::HostName{}, "rest"} |
| The type rest, which reads the rest of the line. | |
| constexpr Untyped | untyped {} |
| A capture without a type, as {x}. | |
| constexpr Discard | discard {} |
| _, which reads a value without storing it | |
| constexpr Blank | blank {} |
| {} in a pattern, which matches a token | |
| constexpr RestOfLine | rest_of_line {} |
| ... in a pattern, which matches the rest of the line | |
| constexpr detail::LitFn | lit {} |
| A literal or host constant as an expression, as in lit(1) or lit(host::int_max). | |
| constexpr detail::PowFn | pow {} |
| pow(a, b), which Iris spells a ^ b. | |
| constexpr detail::MinFn | min {{"min"}} |
| min(a, b, ...), or min(row) over an array; also takes a range of operands | |
| constexpr detail::MaxFn | max {{"max"}} |
| max(a, b, ...), or max(row) over an array; also takes a range of operands | |
| constexpr detail::DistinctFn | distinct {{"distinct"}} |
| distinct(a, b, ...), or distinct(row) over an array; also takes a range of operands | |
| constexpr detail::SumFn | sum {{"sum"}} |
| sum(a, b, ...), sum(row), or the comprehension sum(domain, body) that adds the body over the elements of a domain | |
| constexpr detail::CountFn | count {} |
| count(domain), the number of defined elements, or the comprehension count(domain, body) that counts the elements for which the body holds | |
| constexpr detail::SizeFn | size {} |
| size(domain), the number of elements | |
| constexpr detail::QuantifierFn | all {"all"} |
| The comprehension all(domain, body): whether the body holds for every element. | |
| constexpr detail::QuantifierFn | any {"any"} |
| The comprehension any(domain, body): whether the body holds for some element. | |
| constexpr detail::OverFn | over {} |
| A domain whose element the comprehension names, as in sum(over(row).named("x"), body). | |
| constexpr detail::DefinedFn | defined {} |
| defined(x): whether a name, element or field is defined | |
| constexpr detail::PatternFn | pattern {} |
| A pattern from a string literal with one {} for each part, checked at compile time, as in pattern("p cnf {} {}", vars, clauses). | |
| constexpr detail::BindFn | bind {} |
| {x:type} in a pattern, which defines the handle's name. | |
| constexpr detail::RefFn | ref {} |
| {$x} in a pattern, which matches the value of the handle's entry | |
| constexpr detail::TypedPartFn | validate {detail::Piece::Kind::Validate} |
| {:type} in a pattern, which checks a token without storing it | |
| constexpr detail::TypedPartFn | discard_as {detail::Piece::Kind::DiscardAs} |
| {_:type} in a pattern, which reads a token of a type and discards it | |
| constexpr detail::AlphabetFn | alphabet {} |
| The alphabet type with the symbols symbols, as in alphabet("01"). | |
| constexpr detail::TyFn | ty {} |
| A type as a TypeOf, which has every method of a type, as in ty(byte).until(eol). | |
| constexpr std::size_t | dynamic_depth |
| The depth of a handle whose number of array levels is not known. | |
Detailed Description
The spec builder (<iris/build.hpp>).
Typedef Documentation
CaptureValue
| using iris::build::CaptureValue = detail::CaptureValueOf<std::remove_cvref_t<T>>::Type |
The value type of a capture of type T.
DynField
| using iris::DynField |
A handle whose value type and depth are not known, and whose entry may be undefined: Data::get returns a std::optional<ValueRef>.
ItemOf
| using iris::build::ItemOf = detail::DomainTraits<detail::Bare<T>>::Item |
The element that a comprehension over domain T passes to its body.
Number
| using iris::Number |
A number of a num entry: an integer or a float.
TypeValue
| using iris::build::TypeValue = detail::TypeTraits<std::remove_cvref_t<T>>::Value |
The value type that type T reads.
ValueOf
| using iris::build::ValueOf = detail::OperandTraits<detail::Bare<T>>::Value |
The value type of operand T.
Enumeration Type Documentation
BuildErrorKind
|
strong |
What kind of mistake a BuildError reports.
| Enumerator | |
|---|---|
| Scope | A statement went to a scope that is not the innermost open block, or a branch continued after later statements. |
| Provenance | A handle, record or type came from another builder. |
| Redefinition | A name was defined or declared twice. |
| Unprintable | The statements have no spelling in Iris 0.1. |
| Binding | A capture, forward handle or record was bound wrongly or never. |
| Spec | The emitted text is not a valid reader spec: language_error() says why. |
Presence
|
strong |
Whether an entry is always defined, or may be left undefined.
Function Documentation
operator!()
requires detail::BuilderOperand<T> && Integral<ValueOf<T>>
| Expr< std::int64_t > iris::build::operator! | ( | T && | operand | ) |
Logical negation, !a.
operator!=()
| Expr< std::int64_t > iris::build::operator!= | ( | L && | left, |
| R && | right ) |
Inequality, a != b.
operator%()
requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>>
| Expr< std::int64_t > iris::build::operator% | ( | L && | left, |
| R && | right ) |
Remainder, a % b.
operator&&()
requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>>
| Expr< std::int64_t > iris::build::operator&& | ( | L && | left, |
| R && | right ) |
Conjunction, a && b.
operator*()
requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>>
| Expr< std::int64_t > iris::build::operator* | ( | L && | left, |
| R && | right ) |
Multiplication, a * b.
operator+()
requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>>
| Expr< std::int64_t > iris::build::operator+ | ( | L && | left, |
| R && | right ) |
Addition, a + b.
operator-() [1/2]
requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>>
| Expr< std::int64_t > iris::build::operator- | ( | L && | left, |
| R && | right ) |
Subtraction, a - b.
operator-() [2/2]
requires detail::BuilderOperand<T> && Numeric<ValueOf<T>>
| Expr< ValueOf< T > > iris::build::operator- | ( | T && | operand | ) |
Negation, -a, of the same value type.
operator/()
requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>>
| Expr< std::int64_t > iris::build::operator/ | ( | L && | left, |
| R && | right ) |
Integer division, a / b.
operator<()
requires detail::Operands<L, R> && Numeric<ValueOf<L>> && Numeric<ValueOf<R>>
| Expr< std::int64_t > iris::build::operator< | ( | L && | left, |
| R && | right ) |
Comparison, a < b.
operator<=()
requires detail::Operands<L, R> && Numeric<ValueOf<L>> && Numeric<ValueOf<R>>
| Expr< std::int64_t > iris::build::operator<= | ( | L && | left, |
| R && | right ) |
Comparison, a <= b.
operator==()
| Expr< std::int64_t > iris::build::operator== | ( | L && | left, |
| R && | right ) |
Equality, a == b.
operator>()
requires detail::Operands<L, R> && Numeric<ValueOf<L>> && Numeric<ValueOf<R>>
| Expr< std::int64_t > iris::build::operator> | ( | L && | left, |
| R && | right ) |
Comparison, a > b.
operator>=()
requires detail::Operands<L, R> && Numeric<ValueOf<L>> && Numeric<ValueOf<R>>
| Expr< std::int64_t > iris::build::operator>= | ( | L && | left, |
| R && | right ) |
Comparison, a >= b.
operator||()
requires detail::Operands<L, R> && Integral<ValueOf<L>> && Integral<ValueOf<R>>
| Expr< std::int64_t > iris::build::operator|| | ( | L && | left, |
| R && | right ) |
Disjunction, a || b.
Variable Documentation
all
|
inlineconstexpr |
The comprehension all(domain, body): whether the body holds for every element.
alphabet
|
inlineconstexpr |
The alphabet type with the symbols symbols, as in alphabet("01").
any
|
inlineconstexpr |
The comprehension any(domain, body): whether the body holds for some element.
bind
|
inlineconstexpr |
{x:type} in a pattern, which defines the handle's name.
Where the socket function ::bind is declared, as POSIX <sys/socket.h> and Windows <winsock2.h> declare it, using namespace iris::build; makes an unqualified bind ambiguous, so add using iris::build::bind; beside it, inside a function or namespace, since at global scope it collides with ::bind.
blank
|
inlineconstexpr |
{} in a pattern, which matches a token
count
|
inlineconstexpr |
count(domain), the number of defined elements, or the comprehension count(domain, body) that counts the elements for which the body holds
defined
|
inlineconstexpr |
defined(x): whether a name, element or field is defined
discard
|
inlineconstexpr |
_, which reads a value without storing it
discard_as
|
inlineconstexpr |
{_:type} in a pattern, which reads a token of a type and discards it
distinct
|
inlineconstexpr |
distinct(a, b, ...), or distinct(row) over an array; also takes a range of operands
dynamic_depth
|
inlineconstexpr |
The depth of a handle whose number of array levels is not known.
eol
|
inlineconstexpr |
The end of line, which ends a list.
float_
|
inlineconstexpr |
The type float, which reads a float.
int_
|
inlineconstexpr |
The type int, which reads an integer.
lit
|
inlineconstexpr |
A literal or host constant as an expression, as in lit(1) or lit(host::int_max).
max
|
inlineconstexpr |
max(a, b, ...), or max(row) over an array; also takes a range of operands
min
|
inlineconstexpr |
min(a, b, ...), or min(row) over an array; also takes a range of operands
num
The type num, which reads an integer or a float.
over
|
inlineconstexpr |
pattern
|
inlineconstexpr |
A pattern from a string literal with one {} for each part, checked at compile time, as in pattern("p cnf {} {}", vars, clauses).
pow
|
inlineconstexpr |
pow(a, b), which Iris spells a ^ b.
Where the C library's ::pow is declared, as <math.h> and MSVC's standard headers declare it, using namespace iris::build; makes an unqualified pow ambiguous, so add using iris::build::pow; beside it, inside a function or namespace, since at global scope it collides with ::pow.
ref
|
inlineconstexpr |
{$x} in a pattern, which matches the value of the handle's entry
rest
|
inlineconstexpr |
The type rest, which reads the rest of the line.
rest_of_line
|
inlineconstexpr |
... in a pattern, which matches the rest of the line
size
|
inlineconstexpr |
size(domain), the number of elements
sum
|
inlineconstexpr |
sum(a, b, ...), sum(row), or the comprehension sum(domain, body) that adds the body over the elements of a domain
ty
|
inlineconstexpr |
type_dims
|
inlineconstexpr |
The number of dimensions of type T, or dynamic_depth.
untyped
|
inlineconstexpr |
A capture without a type, as {x}.
validate
|
inlineconstexpr |
{:type} in a pattern, which checks a token without storing it