Commit c21445c9 authored by Maxime Perrotin's avatar Maxime Perrotin

Update readme of asn-iterators

parent 28e95302
(c) 2016-2017 European Space Agency
(c) 2016-2018 European Space Agency
Generic iterator functions in Ada for generating all combinations of values of ASN.1 data types
v0.1 support for INTEGER with a range and SEQUENCE OF INTEGER (fixed and variable size arrays)
This is a work in progress in early stage of development.
The iterators support integer (signed and unsigned), enumerations, and arrays of these types.
cd src
To work with the iterators you need an ASN.1 grammar. You can look at the one in the `test` folder:
Work in progress... Part of the TASTE project.
MyInteger ::= INTEGER (1..4)
MySeqOf ::= SEQUENCE (SIZE (3)) OF MyInteger
MyVarSeqOf ::= SEQUENCE (SIZE (1..4)) OF MyInteger
MyEnum ::= ENUMERATED { hello, world, how-are-you }
MySeqOfEnum ::= SEQUENCE (SIZE (3)) OF MyEnum
The tool generates Ada iterators for all these types, allowing you to use a syntax like this:
My_Enum : MyEnum_Iterator;
for Each of My_Enum loop
Put_Line (Each'Img);
end loop;
# will print:
# hello
# world
# how_are_you
This is a primary feature needed to build up the model checker. It must be possible to iterate on the parameter functions without pre-calculating all possible values in advance. This iteration does not use any memory as the values are computed on the fly (this is similar to Python's iterators, when you use the `yield` keyword).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment