specification icon indicating copy to clipboard operation
specification copied to clipboard

Allow multidimensional arrays

Open pavel-kirienko opened this issue 4 years ago • 0 comments

Multidimensional arrays are currently prohibited. They were avoided mostly due to the issues with byte alignment in variable-length arrays where the width of the length prefix is not a multiple of 8 bits. Since in UAVCAN v1 we require that implicit fields be always standard-size (8/16/32/64), it is now possible to allow multidimensional arrays without sacrificing data alignment.

One issue that has to be considered is how to introduce multidimensional arrays into the grammar while avoiding left recursion. This is because the DSDL syntax is defined through a PEG grammar which does not allow left recursion.

https://github.com/UAVCAN/pydsdl/blob/f53eb68f7c403fe27db5f8ff18e45289b6e14cae/pydsdl/grammar.parsimonious#L32-L41

pavel-kirienko avatar May 21 '20 11:05 pavel-kirienko