Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions specification/dsdl/grammar.parsimonious
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,22 @@ type_scalar = type_versioned
type_versioned = identifier ("." identifier)* "." type_version_specifier
type_version_specifier = literal_integer_decimal "." literal_integer_decimal

type_primitive = type_primitive_truncated
type_primitive = type_primitive_boolean
/ type_primitive_byte
/ type_primitive_utf8
/ type_primitive_truncated
/ type_primitive_saturated

type_primitive_boolean = "bool"
type_primitive_byte = "byte"
type_primitive_utf8 = "utf8"
type_primitive_truncated = "truncated" _ type_primitive_name
type_primitive_saturated = ("saturated" _)? type_primitive_name # Defaults to this.

type_primitive_name = type_primitive_name_boolean
/ type_primitive_name_unsigned_integer
type_primitive_name = type_primitive_name_unsigned_integer
/ type_primitive_name_signed_integer
/ type_primitive_name_floating_point

type_primitive_name_boolean = "bool"
type_primitive_name_unsigned_integer = "uint" type_bit_length_suffix
type_primitive_name_signed_integer = "int" type_bit_length_suffix
type_primitive_name_floating_point = "float" type_bit_length_suffix
Expand Down
4 changes: 3 additions & 1 deletion specification/dsdl/grammar.tex
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ \subsection{Reserved identifiers}\label{sec:dsdl_reserved_identifiers}
\texttt{saturated} & & Cast mode specifier \\
\texttt{true} & & Boolean literal \\
\texttt{false} & & Boolean literal \\
\texttt{bool} & & Primitive type category \\
\texttt{bool} & & Primitive type \\
\texttt{utf8} & & Primitive type \\
\texttt{byte} & & Primitive type \\
\texttt{u?int\textbackslash{}d*} & \texttt{uint8} & Primitive type category \\
\texttt{float\textbackslash{}d*} & \texttt{float} & Primitive type category \\
\texttt{u?q\textbackslash{}d+\_\textbackslash{}d+} & \texttt{q16\_8} & Primitive type category (future) \\
Expand Down
17 changes: 12 additions & 5 deletions specification/dsdl/serializable_types.tex
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ \subsubsection{Hierarchy}
The corresponding DSDL data type name pattern is ``\verb|uint[1-9]\d*|'',
where the trailing integer represents the length of the
serialized representation of the value, in bits, ranging from 1 to 64, inclusive.
\begin{itemize}
\item \textbf{UTF-8 octet.} This type is used as an element type of variable-length
arrays (section \ref{sec:dsdl_array_types}) containing UTF-8 encoded strings.
The DSDL name is ``\verb|utf8|''.
The only valid use of this type is as an element type of a variable-length array.

\item \textbf{Byte.} This type is used as an element type of fixed-length or variable-length
arrays (section \ref{sec:dsdl_array_types}) containing an arbitrary sequence of bytes.
The DSDL name is ``\verb|byte|''.
The only valid use of this type is as an element type of an array.
\end{itemize}
\end{itemize}

\item \textbf{Floating point types} are used to approximately represent real values.
Expand Down Expand Up @@ -138,10 +149,6 @@ \subsubsection{Cast mode}
Type category & Truncated mode & Saturated mode (default)
\label{table:dsdl_cast_mode} \\

Boolean &
Illegal: boolean type with truncated cast mode is not allowed. &
Falsity if the value is zero or false, truth otherwise. \\

Signed integer &
Illegal: signed integer types with truncated cast mode are not allowed. &
Nearest reachable value. \\
Expand Down Expand Up @@ -189,7 +196,7 @@ \subsubsection{Reference list}
\immediate\write18{../render_list_of_void_and_primitive_types.py > ../latex.tmp}
\immediate\input{../latex.tmp}

\subsection{Array types}
\subsection{Array types}\label{sec:dsdl_array_types}

An array type represents an ordered collection of values.
All values in the collection share the same type, which is referred to as \emph{array element type}.
Expand Down
2 changes: 2 additions & 0 deletions specification/introduction/introduction.tex
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ \subsection{v1.0 -- work in progress}
\item The constraint on DSDL namespaces being defined in a single folder was removed. Namespaces can be hosted
across multiple repositories and code can be generated from a union of said folders.

\item Support for UTF-8 strings and byte strings has been added.

\item Cyphal/UDP and Cyphal/serial transport specifications have been introduced.

\item Minor adjustments of the transport layer definitions.
Expand Down