
Edit properties of a structure
The structure is a very important concept in Synalyze It! Basically it's a collection of elements which can be of type binary, number, offset, string or structure reference.
In a grammar, there must always be one main structure that encloses (normally) the whole file. This main structure can be set in the grammar info panel. Apart from the main structure a grammar can comprise many base structures which you find also on top level of the grammar. These base structures can be referenced from other structures and be parent structures - the inheriting structures get all elements from their parents. You can save a lot of work using this mechanism since many binary formats consist of similar structures.
- Extends: Select the parent structure here. The child inherits all elements.
- Consists of: Can be set for a parent structure. All structures you create inside this structure in the hex view will have this type
- Length: Can be
- left blank - size depends on the elements
- an expression containing names of unsigned number elements. The expression is evaluated as soon as all referenced elements are parsed. Both elements inside the structure and parsed before can be referenced, those inside have precedence.
- Alignment: Ensures that the structure starts at a file byte offset that's a multiple of this value.
- Element order: The element order can be fixed (default) or variable. A variable-order structure is similar to the switch/case you find in most programming languages. It implies that the contained structures or structure references ensure they match only if they should match at the current position while parsing the file. This is done using the fixed values you can set in binary, number and string elements. Set the minimum repeat count of the structures or structure references inside this structure to 0 to make this mechanism work.
- Repeat: Select here an unsigned number element that contains the repeat count of this structure. This element must be before the structure.
- Repeat min: Minimum repeat count of this structure. The structure mapping stops when this count is not reached.
- Repeat max: Maximum repeat count of this structure. Use this to limit the repeat count.
- Stroke color: The stroke color used in the hex view for this structure.
- Fill color: The fill color used in the hex view for this structure.
- Endian: The default endianness of number and offset elements inside this structure. Dynamic endianness can be controlled via scripting elements (requires Pro version)
- Signed: The default signedness of number elements inside this structure.
- Encoding: The default text encoding of string elements inside this structure.