diff --git a/specification/dsdl/grammar.parsimonious b/specification/dsdl/grammar.parsimonious index d56cb25..27bdcd4 100644 --- a/specification/dsdl/grammar.parsimonious +++ b/specification/dsdl/grammar.parsimonious @@ -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 diff --git a/specification/dsdl/grammar.tex b/specification/dsdl/grammar.tex index 86e14c3..ebf497c 100644 --- a/specification/dsdl/grammar.tex +++ b/specification/dsdl/grammar.tex @@ -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) \\ diff --git a/specification/dsdl/serializable_types.tex b/specification/dsdl/serializable_types.tex index e50f6f6..1b93bd1 100644 --- a/specification/dsdl/serializable_types.tex +++ b/specification/dsdl/serializable_types.tex @@ -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. @@ -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. \\ @@ -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}. diff --git a/specification/introduction/introduction.tex b/specification/introduction/introduction.tex index e18e007..938a1fb 100644 --- a/specification/introduction/introduction.tex +++ b/specification/introduction/introduction.tex @@ -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.