Skip to content

iris 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 C++ implementation of Iris. More...

Namespaces

namespace  build
 The spec builder (<iris/build.hpp>).

Classes

class  AccessError
 Misuse of the data accessors: an unknown name, a value of another type or depth, or an index out of range. More...
class  ValueRef
 A borrowed view of a value read, or of the part of it that a path selects. More...
class  Data
 The entries a read produces, in definition order (Specification §3.1). More...
struct  Location
 A position in a reader spec or an input. Lines and columns count from 1. More...
struct  ErrorDetails
 The parts of an Error besides its code and message, each absent unless the error has it. More...
class  Error
 A language error with the members of the canonical error document (Specification §3.7), and everything its diagnostic shows. More...
struct  Dynamic
 The value type of a handle whose leaf type is not known. More...
class  Array
 A view of an array of depth D, whose elements are views of depth D - 1. 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...
class  Params
 Values for the param statements of a reader spec, as name and value strings in the order they were first set (Specification §9.1). More...
class  Spec
 A parsed and checked reader spec. More...

Concepts

concept  HandleValue
 The value types of handles: std::int64_t, double, std::string, Number for num, and Dynamic for a type that is not known.

Typedefs

using Number = std::variant<std::int64_t, double>
 A number of a num entry: an integer or a float.
using Numbers
 The leaves of a one-dimensional num array: integers or floats.
template<class V, std::size_t D, Presence P>
using View
 The view that Data::get returns for a handle with value type V, depth D and presence P.
using DynField = Field<Dynamic, dynamic_depth, Presence::Maybe>
 A handle whose value type and depth are not known, and whose entry may be undefined: Data::get returns a std::optional<ValueRef>.

Enumerations

enum class  ValueType { Int , Float , String }
 The type of the leaves of a value (Specification §3.1). More...
enum class  ErrorCode {
  SpecUtf8 , SpecString , SpecNumber , SpecCharacter ,
  SpecPattern , SpecSyntax , SpecPlacement , SpecName ,
  SpecNameConflict , SpecUnknownType , SpecType , SpecNesting ,
  SpecFunction , SpecConstant , SpecRecordScope , SpecField ,
  SpecRecordValue , SpecCheckScope , Budget , CheckFailed ,
  CheckRecords , ComparisonType , Count , DivisionZero ,
  ExpectedToken , ExpectedValue , Exponent , FieldUndefined ,
  FindMatch , FunctionEmpty , FunctionType , IndexContext ,
  IndexMismatch , IndexRange , IndexScalar , IndexType ,
  InstanceEmpty , InstanceNotFound , InstanceNumber , InstanceSelection ,
  IntegerOverflow , IntegerType , Layout , LineMatch ,
  ListTerminator , NameUndefined , NoProgress , OffsetType ,
  ParamMissing , ParamType , ParamUnknown , PatternReference ,
  RangeBounds , RepeatDepth , RepeatMissing , RepeatTerminator ,
  SectionsRepeated , SectionsUnexpected , SizeLimit , SkipEof ,
  Symbol , TrailingInput , TypeUndefined , ValueTypeMix ,
  Utf8
}
 A registered error code of the Iris Language Specification (chapter 11). More...
enum class  Presence { Required , Maybe }
 Whether an entry is always defined, or may be left undefined. More...

Functions

std::string_view type_name (ValueType type)
 Return the spelling of type in canonical data: int, float, or string.
std::string_view code_name (ErrorCode code)
 Return the registry spelling of code, such as E-SPEC-SYNTAX.
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> && Integral<ValueOf<T>>
Expr< std::int64_t > operator! (T &&operand)
 Logical negation, !a.

Variables

constexpr std::size_t dynamic_depth
 The depth of a handle whose number of array levels is not known.

Detailed Description

The C++ implementation of Iris.

Typedef Documentation

DynField

A handle whose value type and depth are not known, and whose entry may be undefined: Data::get returns a std::optional<ValueRef>.

Number

using iris::Number = std::variant<std::int64_t, double>

A number of a num entry: an integer or a float.

Numbers

Initial value:
std::variant<std::span<const std::int64_t>, std::span<const double>>

The leaves of a one-dimensional num array: integers or floats.

View

template<class V, std::size_t D, Presence P>
using iris::View
Initial value:
std::conditional_t<P == Presence::Maybe,
std::optional<typename detail::ViewOf<V, D>::Type>,
typename detail::ViewOf<V, D>::Type>
@ Maybe
The entry may be undefined, as after a branch that did not run.
Definition handle.hpp:30

The view that Data::get returns for a handle with value type V, depth D and presence P.

Enumeration Type Documentation

ErrorCode

enum class iris::ErrorCode
strong

A registered error code of the Iris Language Specification (chapter 11).

Enumerator
SpecUtf8 

E-SPEC-UTF8

SpecString 

E-SPEC-STRING

SpecNumber 

E-SPEC-NUMBER

SpecCharacter 

E-SPEC-CHARACTER

SpecPattern 

E-SPEC-PATTERN

SpecSyntax 

E-SPEC-SYNTAX

SpecPlacement 

E-SPEC-PLACEMENT

SpecName 

E-SPEC-NAME

SpecNameConflict 

E-SPEC-NAME-CONFLICT

SpecUnknownType 

E-SPEC-UNKNOWN-TYPE

SpecType 

E-SPEC-TYPE

SpecNesting 

E-SPEC-NESTING

SpecFunction 

E-SPEC-FUNCTION

SpecConstant 

E-SPEC-CONSTANT

SpecRecordScope 

E-SPEC-RECORD-SCOPE

SpecField 

E-SPEC-FIELD

SpecRecordValue 

E-SPEC-RECORD-VALUE

SpecCheckScope 

E-SPEC-CHECK-SCOPE

Budget 

E-BUDGET

CheckFailed 

E-CHECK-FAILED

CheckRecords 

E-CHECK-RECORDS

ComparisonType 

E-COMPARISON-TYPE

Count 

E-COUNT

DivisionZero 

E-DIVISION-ZERO

ExpectedToken 

E-EXPECTED-TOKEN

ExpectedValue 

E-EXPECTED-VALUE

Exponent 

E-EXPONENT

FieldUndefined 

E-FIELD-UNDEFINED

FindMatch 

E-FIND-MATCH

FunctionEmpty 

E-FUNCTION-EMPTY

FunctionType 

E-FUNCTION-TYPE

IndexContext 

E-INDEX-CONTEXT

IndexMismatch 

E-INDEX-MISMATCH

IndexRange 

E-INDEX-RANGE

IndexScalar 

E-INDEX-SCALAR

IndexType 

E-INDEX-TYPE

InstanceEmpty 

E-INSTANCE-EMPTY

InstanceNotFound 

E-INSTANCE-NOT-FOUND

InstanceNumber 

E-INSTANCE-NUMBER

InstanceSelection 

E-INSTANCE-SELECTION

IntegerOverflow 

E-INTEGER-OVERFLOW

IntegerType 

E-INTEGER-TYPE

Layout 

E-LAYOUT

LineMatch 

E-LINE-MATCH

ListTerminator 

E-LIST-TERMINATOR

NameUndefined 

E-NAME-UNDEFINED

NoProgress 

E-NO-PROGRESS

OffsetType 

E-OFFSET-TYPE

ParamMissing 

E-PARAM-MISSING

ParamType 

E-PARAM-TYPE

ParamUnknown 

E-PARAM-UNKNOWN

PatternReference 

E-PATTERN-REFERENCE

RangeBounds 

E-RANGE-BOUNDS

RepeatDepth 

E-REPEAT-DEPTH

RepeatMissing 

E-REPEAT-MISSING

RepeatTerminator 

E-REPEAT-TERMINATOR

SectionsRepeated 

E-SECTIONS-REPEATED

SectionsUnexpected 

E-SECTIONS-UNEXPECTED

SizeLimit 

E-SIZE-LIMIT

SkipEof 

E-SKIP-EOF

Symbol 

E-SYMBOL

TrailingInput 

E-TRAILING-INPUT

TypeUndefined 

E-TYPE-UNDEFINED

ValueTypeMix 

E-VALUE-TYPE-MIX

Utf8 

E-UTF8

Presence

enum class iris::Presence
strong

Whether an entry is always defined, or may be left undefined.

Enumerator
Required 

The entry is always defined.

Maybe 

The entry may be undefined, as after a branch that did not run.

ValueType

enum class iris::ValueType
strong

The type of the leaves of a value (Specification §3.1).

Enumerator
Int 

A 64-bit signed integer.

Float 

A double-precision float.

String 

A UTF-8 string.

Function Documentation

code_name()

std::string_view iris::code_name ( ErrorCode code)

Return the registry spelling of code, such as E-SPEC-SYNTAX.

operator!()

template<class T>
requires detail::BuilderOperand<T> && Integral<ValueOf<T>>
Expr< std::int64_t > iris::build::operator! ( T && operand)

Logical negation, !a.

operator!=()

template<class L, class R>
requires detail::Operands<L, R> && Equatable<ValueOf<L>, ValueOf<R>>
Expr< std::int64_t > iris::build::operator!= ( L && left,
R && right )

Inequality, a != b.

operator%()

template<class L, class R>
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&&()

template<class L, class R>
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*()

template<class L, class R>
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+()

template<class L, class R>
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-()

template<class L, class R>
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/()

template<class L, class R>
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<()

template<class L, class R>
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<=()

template<class L, class R>
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==()

template<class L, class R>
requires detail::Operands<L, R> && Equatable<ValueOf<L>, ValueOf<R>>
Expr< std::int64_t > iris::build::operator== ( L && left,
R && right )

Equality, a == b.

operator>()

template<class L, class R>
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>=()

template<class L, class R>
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||()

template<class L, class R>
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.

type_name()

std::string_view iris::type_name ( ValueType type)

Return the spelling of type in canonical data: int, float, or string.

Variable Documentation

dynamic_depth

std::size_t iris::dynamic_depth
inlineconstexpr
Initial value:
=
std::numeric_limits<std::size_t>::max()

The depth of a handle whose number of array levels is not known.