Value field of a structure

+1 vote
asked Feb 28, 2020 in Grammars by murphyschaos (210 points)

Short version: 

Can "Value," on a structure, only be the name of a field inside?

Long version:

I've got some bytes that are essentially a keypath. As an example:

81 A4 74 68 69 73 A2 69 73 A2 6D 79 A7 6B 65 79 70 61 74 68 | ..this.is.my.keypath

Byte 0 is just a type specifier, indicating what kind of binary value would be found after this keypath. Bytes 1, 6, 9, and 12 are length indicators of the form A<length>. Byte 1 is A4, so the first word (this) is 4 bytes long. My grammar is (simplified):

<structure name="keypath" valueexpression="key">
    <structure name="key" valueexpression="value">
        <binary name="magic" length="4" lengthunit="bit"/>
        <binary name="length" length="4" lengthunit="bit"/>
        <string name="value" type="fixed-length" length="length"/>
    </structure>
</structure>

The value of keypath shows as the first instance of value, or this. I want the value of keypath to show something like this|is|my|keypath but all I get is this. Is there something I can set the value expression to that will do this for me, or am I stuck writing a script?

1 Answer

0 votes
answered Feb 18, 2023 by guruadmin (680 points)
Here you probably have to use a script that collects the single strings.
...